summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sys_vars
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/sys_vars')
-rw-r--r--mysql-test/suite/sys_vars/disabled.def2
-rw-r--r--mysql-test/suite/sys_vars/r/aria_pagecache_file_hash_size_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/back_log_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_commit_wait_count_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_commit_wait_usec_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_client_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_client_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_connection_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_connection_func.result2
-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_filesystem_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_results_basic.resultbin16480 -> 16480 bytes
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_results_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/collation_connection_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/default_master_connection_basic.result94
-rw-r--r--mysql-test/suite/sys_vars/r/default_regex_flags_basic.result57
-rw-r--r--mysql-test/suite/sys_vars/r/default_storage_engine_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_binlog_pos_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_binlog_state_basic.result11
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_current_pos_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_domain_id_basic.result29
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_ignore_duplicates_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_seq_no_basic.result16
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_slave_pos_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_strict_mode_basic.result29
-rw-r--r--mysql-test/suite/sys_vars/r/have_partitioning_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/histogram_size_basic.result136
-rw-r--r--mysql-test/suite/sys_vars/r/histogram_type_basic.result79
-rw-r--r--mysql-test/suite/sys_vars/r/host_cache_size_basic.result37
-rw-r--r--mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result5
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_lwm_basic.result96
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_adaptive_max_sleep_delay_basic.result46
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_api_bk_commit_interval_basic.result64
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_api_disable_rowlock_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_api_enable_binlog_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_api_enable_mdl_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_api_trx_level_basic.result66
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_autoextend_increment_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buf_flush_list_now_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_at_shutdown_basic.result18
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_now_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_pct_basic.result20
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result7
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_abort_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_at_startup_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result11
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_change_buffer_max_size_basic.result77
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_cleaner_eviction_factor_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_cleaner_flush_chunk_size_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_cleaner_free_list_lwm_basic.result35
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_cleaner_lru_chunk_size_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_cleaner_max_flush_time_basic.result25
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_cleaner_max_lru_time_basic.result25
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_cmp_per_index_enabled_basic.result65
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_compression_failure_threshold_pct_basic.result96
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_compression_level_basic.result73
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_compression_pad_pct_max_basic.result86
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_disable_background_merge_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_disable_sort_file_cache_basic.result92
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_doublewrite_batch_size_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result26
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_flush_log_at_timeout_basic.result96
-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_flush_neighbors_basic.result101
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_flushing_avg_loops_basic.result98
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_foreground_preflush_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_aux_table_basic.result32
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_cache_size_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_enable_diag_print_basic.result92
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_enable_stopword_basic.result121
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_max_token_size_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_min_token_size_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_num_word_optimize_basic.result56
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result32
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_server_stopword_table_basic.result32
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_sort_pll_degree_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_total_cache_size_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_user_stopword_table_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_io_capacity_max_basic.result96
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_arch_dir_basic.result38
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_arch_expire_sec_basic.result38
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_archive_basic.result38
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_checksum_algorithm_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_log_compressed_pages_basic.result69
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_lru_scan_depth_basic.result69
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_basic.result44
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_lwm_basic.result109
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result43
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_merge_sort_block_size_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result582
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result582
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result582
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result582
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_old_blocks_time_basic.result14
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_online_alter_log_max_size_basic.result64
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_optimize_fulltext_only_basic.result92
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_page_hash_locks_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_persistent_stats_root_page_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_print_all_deadlocks_basic.result124
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_priority_cleaner_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_priority_io_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_priority_master_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_priority_purge_basic.result31
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_purge_batch_size_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_purge_run_now_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_purge_stop_now_basic.result27
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_read_only_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result26
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sort_buffer_size_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_stats_auto_recalc_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result14
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_stats_persistent_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_stats_persistent_sample_pages_basic.result61
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result5
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_stats_transient_sample_pages_basic.result61
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_status_output_basic.result102
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_status_output_locks_basic.result102
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_sync_array_size_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result35
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_undo_directory_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_undo_logs_basic.result68
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_undo_tablespaces_basic.result38
-rw-r--r--mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result114
-rw-r--r--mysql-test/suite/sys_vars/r/last_gtid_basic.result9
-rw-r--r--mysql-test/suite/sys_vars/r/lc_time_names_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_verbosity_basic.result28
-rw-r--r--mysql-test/suite/sys_vars/r/max_connect_errors_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/max_digest_length_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result29
-rw-r--r--mysql-test/suite/sys_vars/r/metadata_locks_hash_instances_basic.result51
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result20
-rw-r--r--mysql-test/suite/sys_vars/r/old_mode_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_selectivity_sampling_limit_basic.result141
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_basic.result36
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown1.result5
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown2.result5
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_use_condition_selectivity_basic.result141
-rw-r--r--mysql-test/suite/sys_vars/r/oqgraph_allow_create_integer_latch_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_accounts_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_digests_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_events_stages_history_long_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_events_stages_history_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_events_statements_history_long_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_events_statements_history_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_hosts_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_max_digest_length_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_max_socket_classes_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_max_socket_instances_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_max_stage_classes_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_max_statement_classes_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_session_connect_attrs_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_setup_actors_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_setup_objects_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/pfs_users_size_basic.result23
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/server_id_basic.result15
-rw-r--r--mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_basic.result39
-rw-r--r--mysql-test/suite/sys_vars/r/slave_domain_parallel_threads_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/slave_parallel_max_queued_basic.result13
-rw-r--r--mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_selects_func.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sql_notes_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/ssl_crl_basic.result5
-rw-r--r--mysql-test/suite/sys_vars/r/ssl_crlpath_basic.result5
-rw-r--r--mysql-test/suite/sys_vars/r/storage_engine_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/table_open_cache_instances_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/transaction_prealloc_size_bug27322.result10
-rw-r--r--mysql-test/suite/sys_vars/r/tx_read_only_basic.result181
-rw-r--r--mysql-test/suite/sys_vars/r/use_stat_tables_basic.result95
-rw-r--r--mysql-test/suite/sys_vars/r/version_malloc_library_basic.result53
-rw-r--r--mysql-test/suite/sys_vars/t/aria_pagecache_file_hash_size_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_commit_wait_count_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_commit_wait_usec_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/default_master_connection_basic.test128
-rw-r--r--mysql-test/suite/sys_vars/t/default_regex_flags_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test267
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_file_basic-master.opt3
-rw-r--r--mysql-test/suite/sys_vars/t/general_log_file_func-master.opt3
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_binlog_pos_basic.test15
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_binlog_state_basic.test17
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_current_pos_basic.test15
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_domain_id_basic.test17
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_ignore_duplicates_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_seq_no_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test46
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_strict_mode_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/histogram_size_basic.test142
-rw-r--r--mysql-test/suite/sys_vars/t/histogram_type_basic.test92
-rw-r--r--mysql-test/suite/sys_vars/t/host_cache_size_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/host_cache_size_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/ignore_db_dirs_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_lwm_basic.test142
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_adaptive_max_sleep_delay_basic.test75
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_api_bk_commit_interval_basic.test58
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_api_disable_rowlock_basic.test (renamed from mysql-test/suite/sys_vars/t/have_ndbcluster_basic.test)50
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_api_enable_binlog_basic.test (renamed from mysql-test/suite/sys_vars/t/have_innodb_basic.test)50
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_api_enable_mdl_basic.test (renamed from mysql-test/suite/sys_vars/t/have_csv_basic.test)50
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_api_trx_level_basic.test58
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_autoextend_increment_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buf_flush_list_now_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_at_shutdown_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test25
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_pct_basic.test34
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_abort_basic.test15
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_at_startup_basic.test15
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test59
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_change_buffer_max_size_basic.test63
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test38
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_cleaner_eviction_factor_basic.test35
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_cleaner_flush_chunk_size_basic.test33
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_cleaner_free_list_lwm_basic.test35
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_cleaner_lru_chunk_size_basic.test33
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_cleaner_lsn_age_factor_basic.test28
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_cleaner_max_flush_time_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_cleaner_max_lru_time_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_cmp_per_index_enabled_basic.test69
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_compression_failure_threshold_pct_basic.test143
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_compression_level_basic.test64
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_compression_pad_pct_max_basic.test136
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_disable_background_merge_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_disable_sort_file_cache_basic.test70
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_doublewrite_batch_size_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.test30
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fil_make_page_dirty_debug_basic.test34
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_flush_log_at_timeout_basic.test151
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_flush_neighbors_basic.test73
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_flushing_avg_loops_basic.test143
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_foreground_preflush_basic.test30
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_aux_table_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_cache_size_basic.test26
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_enable_diag_print_basic.test70
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_enable_stopword_basic.test85
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_max_token_size_basic.test26
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_min_token_size_basic.test26
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_num_word_optimize_basic.test52
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test38
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_server_stopword_table_basic.test41
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_sort_pll_degree_basic.test26
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_total_cache_size_basic.test27
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_ft_user_stopword_table_basic.test38
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_io_capacity_max_basic.test85
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_arch_dir_basic.test68
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_arch_expire_sec_basic.test60
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_archive_basic.test61
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_checksum_algorithm_basic.test38
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_log_compressed_pages_basic.test93
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_lru_scan_depth_basic.test58
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_lwm_basic.test151
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_merge_sort_block_size_basic.test19
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_monitor_disable_basic.test383
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_monitor_enable_basic.test383
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_monitor_reset_all_basic.test383
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_monitor_reset_basic.test383
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_online_alter_log_max_size_basic.test51
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_optimize_fulltext_only_basic.test70
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_page_hash_locks_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_persistent_stats_root_page_basic.test26
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_print_all_deadlocks_basic.test113
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_priority_cleaner_basic.test36
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_priority_io_basic.test36
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_priority_master_basic.test36
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_priority_purge_basic.test36
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_purge_run_now_basic.test53
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_purge_stop_now_basic.test53
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_read_only_basic.test20
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_saved_page_number_debug_basic.test35
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test43
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test44
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test44
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test44
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sort_buffer_size_basic.test26
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_stats_auto_recalc_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_stats_persistent_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_stats_persistent_sample_pages_basic.test57
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_stats_transient_sample_pages_basic.test57
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_status_output_basic.test69
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_status_output_locks_basic.test69
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_sync_array_size_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test48
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_undo_directory_basic.test85
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_undo_logs_basic.test95
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_undo_tablespaces_basic.test77
-rw-r--r--mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test168
-rw-r--r--mysql-test/suite/sys_vars/t/last_gtid_basic.test11
-rw-r--r--mysql-test/suite/sys_vars/t/lc_time_names_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/log_basic.test62
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_queries_basic.test186
-rw-r--r--mysql-test/suite/sys_vars/t/log_slow_verbosity_basic.test16
-rw-r--r--mysql-test/suite/sys_vars/t/max_digest_length_basic.test46
-rw-r--r--mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/metadata_locks_hash_instances_basic.test60
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/old_mode_basic.test5
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_selectivity_sampling_limit_basic.test154
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown1-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown1.test5
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown2-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown2.test5
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_use_condition_selectivity_basic.test154
-rw-r--r--mysql-test/suite/sys_vars/t/oqgraph_allow_create_integer_latch_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_accounts_size_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_accounts_size_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_events_stages_history_long_size_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_events_stages_history_long_size_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_events_stages_history_size_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_events_stages_history_size_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_events_statements_history_long_size_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_events_statements_history_long_size_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_events_statements_history_size_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_events_statements_history_size_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_hosts_size_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_hosts_size_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_digest_length-master_basic.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_socket_classes_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_socket_classes_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_socket_instances_basic-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_socket_instances_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_stage_classes_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_stage_classes_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_statement_classes_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_max_statement_classes_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic.test47
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_setup_actors_size_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_setup_actors_size_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_setup_objects_size_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_setup_objects_size_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_users_size_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/pfs_users_size_basic.test32
-rw-r--r--mysql-test/suite/sys_vars/t/report_port_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func-master.opt3
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test6
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/server_id_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/slave_ddl_exec_mode_basic.test67
-rw-r--r--mysql-test/suite/sys_vars/t/slave_domain_parallel_threads_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/slave_parallel_max_queued_basic.test14
-rw-r--r--mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf5
-rw-r--r--mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_selects_func.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_tables_basic.test170
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_tables_func.test145
-rw-r--r--mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test221
-rw-r--r--mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test51
-rw-r--r--mysql-test/suite/sys_vars/t/sql_max_join_size_func.test133
-rw-r--r--mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/ssl_ca_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/ssl_cert_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/ssl_crl_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/ssl_crlpath_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/ssl_key_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/table_open_cache_instances_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/transaction_prealloc_size_bug27322.test23
-rw-r--r--mysql-test/suite/sys_vars/t/tx_read_only_basic.test199
-rw-r--r--mysql-test/suite/sys_vars/t/use_stat_tables_basic.test100
-rw-r--r--mysql-test/suite/sys_vars/t/version_malloc_library_basic.test (renamed from mysql-test/suite/sys_vars/t/have_partitioning_basic.test)66
387 files changed, 16765 insertions, 1823 deletions
diff --git a/mysql-test/suite/sys_vars/disabled.def b/mysql-test/suite/sys_vars/disabled.def
index 596191d09b6..758215208de 100644
--- a/mysql-test/suite/sys_vars/disabled.def
+++ b/mysql-test/suite/sys_vars/disabled.def
@@ -11,4 +11,4 @@
##############################################################################
innodb_flush_checkpoint_debug_basic: removed from XtraDB-26.0
-
+table_open_cache_instances_basic: no such variable in MariaDB
diff --git a/mysql-test/suite/sys_vars/r/aria_pagecache_file_hash_size_basic.result b/mysql-test/suite/sys_vars/r/aria_pagecache_file_hash_size_basic.result
new file mode 100644
index 00000000000..0bdd56c298f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_pagecache_file_hash_size_basic.result
@@ -0,0 +1,21 @@
+select @@global.aria_pagecache_file_hash_size;
+@@global.aria_pagecache_file_hash_size
+512
+select @@session.aria_pagecache_file_hash_size;
+ERROR HY000: Variable 'aria_pagecache_file_hash_size' is a GLOBAL variable
+show global variables like 'aria_pagecache_file_hash_size';
+Variable_name Value
+aria_pagecache_file_hash_size 512
+show session variables like 'aria_pagecache_file_hash_size';
+Variable_name Value
+aria_pagecache_file_hash_size 512
+select * from information_schema.global_variables where variable_name='aria_pagecache_file_hash_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_FILE_HASH_SIZE 512
+select * from information_schema.session_variables where variable_name='aria_pagecache_file_hash_size';
+VARIABLE_NAME VARIABLE_VALUE
+ARIA_PAGECACHE_FILE_HASH_SIZE 512
+set global aria_pagecache_file_hash_size=200;
+ERROR HY000: Variable 'aria_pagecache_file_hash_size' is a read only variable
+set session aria_pagecache_file_hash_size=200;
+ERROR HY000: Variable 'aria_pagecache_file_hash_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result
index cf067c7e7b6..56522566ec9 100644
--- a/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result
@@ -1,30 +1,34 @@
SET @start_global_value = @@global.aria_sort_buffer_size;
select @@global.aria_sort_buffer_size;
@@global.aria_sort_buffer_size
-134217728
+268434432
select @@session.aria_sort_buffer_size;
@@session.aria_sort_buffer_size
-134217728
+268434432
show global variables like 'aria_sort_buffer_size';
Variable_name Value
-aria_sort_buffer_size 134217728
+aria_sort_buffer_size 268434432
show session variables like 'aria_sort_buffer_size';
Variable_name Value
-aria_sort_buffer_size 134217728
+aria_sort_buffer_size 268434432
select * from information_schema.global_variables where variable_name='aria_sort_buffer_size';
VARIABLE_NAME VARIABLE_VALUE
-ARIA_SORT_BUFFER_SIZE 134217728
+ARIA_SORT_BUFFER_SIZE 268434432
select * from information_schema.session_variables where variable_name='aria_sort_buffer_size';
VARIABLE_NAME VARIABLE_VALUE
-ARIA_SORT_BUFFER_SIZE 134217728
+ARIA_SORT_BUFFER_SIZE 268434432
set global aria_sort_buffer_size=10;
+Warnings:
+Warning 1292 Truncated incorrect aria_sort_buffer_size value: '10'
select @@global.aria_sort_buffer_size;
@@global.aria_sort_buffer_size
-10
+4096
set session aria_sort_buffer_size=10;
+Warnings:
+Warning 1292 Truncated incorrect aria_sort_buffer_size value: '10'
select @@session.aria_sort_buffer_size;
@@session.aria_sort_buffer_size
-10
+4096
set global aria_sort_buffer_size=1.1;
ERROR 42000: Incorrect argument type to variable 'aria_sort_buffer_size'
set session aria_sort_buffer_size=1e1;
@@ -36,7 +40,7 @@ Warnings:
Warning 1292 Truncated incorrect aria_sort_buffer_size value: '0'
select @@global.aria_sort_buffer_size;
@@global.aria_sort_buffer_size
-4
+4096
set session aria_sort_buffer_size=cast(-1 as unsigned int);
select @@session.aria_sort_buffer_size;
@@session.aria_sort_buffer_size
diff --git a/mysql-test/suite/sys_vars/r/back_log_basic.result b/mysql-test/suite/sys_vars/r/back_log_basic.result
index 5cfb0da65d6..d68e72a8a4a 100644
--- a/mysql-test/suite/sys_vars/r/back_log_basic.result
+++ b/mysql-test/suite/sys_vars/r/back_log_basic.result
@@ -1,20 +1,20 @@
select @@global.back_log;
@@global.back_log
-50
+150
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
+back_log 150
show session variables like 'back_log';
Variable_name Value
-back_log 50
+back_log 150
select * from information_schema.global_variables where variable_name='back_log';
VARIABLE_NAME VARIABLE_VALUE
-BACK_LOG 50
+BACK_LOG 150
select * from information_schema.session_variables where variable_name='back_log';
VARIABLE_NAME VARIABLE_VALUE
-BACK_LOG 50
+BACK_LOG 150
set global back_log=1;
ERROR HY000: Variable 'back_log' is a read only variable
set session back_log=1;
diff --git a/mysql-test/suite/sys_vars/r/binlog_commit_wait_count_basic.result b/mysql-test/suite/sys_vars/r/binlog_commit_wait_count_basic.result
new file mode 100644
index 00000000000..6837489311a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/binlog_commit_wait_count_basic.result
@@ -0,0 +1,13 @@
+SET @save_binlog_commit_wait_count= @@GLOBAL.binlog_commit_wait_count;
+SELECT @@GLOBAL.binlog_commit_wait_count as 'must be zero because of default';
+must be zero because of default
+0
+SELECT @@SESSION.binlog_commit_wait_count as 'no session var';
+ERROR HY000: Variable 'binlog_commit_wait_count' is a GLOBAL variable
+SET GLOBAL binlog_commit_wait_count= 0;
+SET GLOBAL binlog_commit_wait_count= DEFAULT;
+SET GLOBAL binlog_commit_wait_count= 10;
+SELECT @@GLOBAL.binlog_commit_wait_count;
+@@GLOBAL.binlog_commit_wait_count
+10
+SET GLOBAL binlog_commit_wait_count = @save_binlog_commit_wait_count;
diff --git a/mysql-test/suite/sys_vars/r/binlog_commit_wait_usec_basic.result b/mysql-test/suite/sys_vars/r/binlog_commit_wait_usec_basic.result
new file mode 100644
index 00000000000..b85af0bc9c7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/binlog_commit_wait_usec_basic.result
@@ -0,0 +1,13 @@
+SET @save_binlog_commit_wait_usec= @@GLOBAL.binlog_commit_wait_usec;
+SELECT @@GLOBAL.binlog_commit_wait_usec as 'check default';
+check default
+100000
+SELECT @@SESSION.binlog_commit_wait_usec as 'no session var';
+ERROR HY000: Variable 'binlog_commit_wait_usec' is a GLOBAL variable
+SET GLOBAL binlog_commit_wait_usec= 0;
+SET GLOBAL binlog_commit_wait_usec= DEFAULT;
+SET GLOBAL binlog_commit_wait_usec= 10000;
+SELECT @@GLOBAL.binlog_commit_wait_usec;
+@@GLOBAL.binlog_commit_wait_usec
+10000
+SET GLOBAL binlog_commit_wait_usec = @save_binlog_commit_wait_usec;
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 b0b8d620a9e..e6502d63c78 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
@@ -430,7 +430,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
-39
+40
'#--------------------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 82c1548d438..3e39b24c8db 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
@@ -30,7 +30,7 @@ SET @@session.character_set_client = utf8;
INSERT INTO t1 values('è');
SELECT hex(a),CHAR_LENGTH(a) FROM t1;
hex(a) CHAR_LENGTH(a)
-03 1
+033F 2
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 4ed313c71c7..ad9e9c80902 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
@@ -424,7 +424,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
-39
+40
'#--------------------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_connection_func.result b/mysql-test/suite/sys_vars/r/character_set_connection_func.result
index 6fc33a4f369..7f3c4e42ce6 100644
--- a/mysql-test/suite/sys_vars/r/character_set_connection_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_connection_func.result
@@ -11,7 +11,7 @@ SELECT @@global.character_set_connection;
utf8
SELECT @@session.character_set_connection;
@@session.character_set_connection
-utf8
+latin1
'#--------------------FN_DYNVARS_011_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
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 88f311adf87..2fec211cf8d 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
@@ -424,7 +424,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
-39
+40
'#--------------------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_filesystem_basic.result b/mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result
index 826dc98a832..c1a77b73fb3 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
@@ -402,7 +402,7 @@ ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
-39
+40
'#--------------------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 3354dcb1838..244fa4670b8 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_results_func.result b/mysql-test/suite/sys_vars/r/character_set_results_func.result
index d92821fdfa6..14bad0f4eb4 100644
--- a/mysql-test/suite/sys_vars/r/character_set_results_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_results_func.result
@@ -9,7 +9,7 @@ SELECT @@global.character_set_results;
utf8
SELECT @@session.character_set_results;
@@session.character_set_results
-utf8
+latin1
'#--------------------FN_DYNVARS_012_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/sys_vars/r/collation_connection_func.result b/mysql-test/suite/sys_vars/r/collation_connection_func.result
index 18f82dc60e1..b40efda517f 100644
--- a/mysql-test/suite/sys_vars/r/collation_connection_func.result
+++ b/mysql-test/suite/sys_vars/r/collation_connection_func.result
@@ -9,7 +9,7 @@ SELECT @@global.collation_connection;
latin1_danish_ci
SELECT @@session.collation_connection;
@@session.collation_connection
-latin1_danish_ci
+latin1_swedish_ci
'#--------------------FN_DYNVARS_015_02-------------------------#'
'connection default'
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/sys_vars/r/default_master_connection_basic.result b/mysql-test/suite/sys_vars/r/default_master_connection_basic.result
new file mode 100644
index 00000000000..78425049324
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/default_master_connection_basic.result
@@ -0,0 +1,94 @@
+SET @start_session_value = @@session.default_master_connection;
+SELECT @start_session_value;
+@start_session_value
+
+SET @@session.default_master_connection = 'bar';
+SET @@session.default_master_connection = DEFAULT;
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+
+SET @@session.default_master_connection = @start_session_value;
+SELECT @@session.default_master_connection = '';
+@@session.default_master_connection = ''
+1
+SET @@global.default_master_connection = 'master1';
+ERROR HY000: Variable 'default_master_connection' is a SESSION variable and can't be used with SET GLOBAL
+SELECT @@global.default_master_connection;
+ERROR HY000: Variable 'default_master_connection' is a SESSION variable
+SET @@session.default_master_connection = 'master1';
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+master1
+SET @@session.default_master_connection = '';
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+
+SET @@session.default_master_connection = '1234-5678';
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+1234-5678
+SET @@session.default_master_connection = '@!*/"';
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+@!*/"
+SET @@session.default_master_connection = REPEAT('a',191);
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+SET @@session.default_master_connection = master2;
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+master2
+SET @@session.default_master_connection = 1;
+ERROR 42000: Incorrect argument type to variable 'default_master_connection'
+SET @@session.default_master_connection = 65530.30;
+ERROR 42000: Incorrect argument type to variable 'default_master_connection'
+SET @@session.default_master_connection = FALSE;
+ERROR 42000: Incorrect argument type to variable 'default_master_connection'
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+master2
+SET @@session.default_master_connection = REPEAT('a',192);
+ERROR 42000: Variable 'default_master_connection' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+master2
+SET @@session.default_master_connection = NULL;
+ERROR 42000: Variable 'default_master_connection' can't be set to the value of 'NULL'
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+master2
+SELECT @@global.default_master_connection = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='default_master_connection';
+ERROR HY000: Variable 'default_master_connection' is a SESSION variable
+SELECT @@session.default_master_connection = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='default_master_connection';
+@@session.default_master_connection = VARIABLE_VALUE
+1
+SET @@default_master_connection = 'foo';
+SELECT @@default_master_connection = @@local.default_master_connection;
+@@default_master_connection = @@local.default_master_connection
+1
+SELECT @@local.default_master_connection = @@session.default_master_connection;
+@@local.default_master_connection = @@session.default_master_connection
+1
+SET default_master_connection = 'foo';
+SELECT @@default_master_connection;
+@@default_master_connection
+foo
+SET local.default_master_connection = 'foo';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'default_master_connection = 'foo'' at line 1
+SELECT local.default_master_connection;
+ERROR 42S02: Unknown table 'local' in field list
+SET session.default_master_connection = 'foo';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'default_master_connection = 'foo'' at line 1
+SELECT session.default_master_connection;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT default_master_connection = @@session.default_master_connection;
+ERROR 42S22: Unknown column 'default_master_connection' in 'field list'
+SET @@session.default_master_connection = @start_session_value;
+SELECT @@session.default_master_connection;
+@@session.default_master_connection
+
diff --git a/mysql-test/suite/sys_vars/r/default_regex_flags_basic.result b/mysql-test/suite/sys_vars/r/default_regex_flags_basic.result
new file mode 100644
index 00000000000..84c55f3d2b6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/default_regex_flags_basic.result
@@ -0,0 +1,57 @@
+SET default_regex_flags='';
+SELECT @@default_regex_flags;
+@@default_regex_flags
+
+SET default_regex_flags=DEFAULT;
+SELECT @@default_regex_flags;
+@@default_regex_flags
+
+SET default_regex_flags=NULL;
+ERROR 42000: Variable 'default_regex_flags' can't be set to the value of 'NULL'
+SELECT @@default_regex_flags;
+@@default_regex_flags
+
+SET default_regex_flags='UNKNOWN';
+ERROR 42000: Variable 'default_regex_flags' can't be set to the value of 'UNKNOWN'
+SET default_regex_flags=123;
+ERROR 42000: Variable 'default_regex_flags' can't be set to the value of '123'
+SET default_regex_flags=123.0;
+ERROR 42000: Incorrect argument type to variable 'default_regex_flags'
+SET default_regex_flags=123e0;
+ERROR 42000: Incorrect argument type to variable 'default_regex_flags'
+SET default_regex_flags='DOTALL';
+SELECT @@default_regex_flags;
+@@default_regex_flags
+DOTALL
+SET default_regex_flags=NULL;
+ERROR 42000: Variable 'default_regex_flags' can't be set to the value of 'NULL'
+SELECT @@default_regex_flags;
+@@default_regex_flags
+DOTALL
+SET @@default_regex_flags=63;
+SELECT @@default_regex_flags;
+@@default_regex_flags
+DOTALL,DUPNAMES,EXTENDED,EXTRA,MULTILINE,UNGREEDY
+SET @@default_regex_flags='DOTALL';
+SELECT @@default_regex_flags;
+@@default_regex_flags
+DOTALL
+SET @@default_regex_flags='DOTALL,DUPNAMES,EXTENDED,EXTRA,MULTILINE,UNGREEDY';
+SELECT @@default_regex_flags;
+@@default_regex_flags
+DOTALL,DUPNAMES,EXTENDED,EXTRA,MULTILINE,UNGREEDY
+SET @@default_regex_flags=DEFAULT;
+SET @@global.default_regex_flags='MULTILINE';
+SELECT @@session.default_regex_flags;
+@@session.default_regex_flags
+
+# connection con1
+SELECT @@session.default_regex_flags;
+@@session.default_regex_flags
+MULTILINE
+# connection default
+SELECT @@session.default_regex_flags;
+@@session.default_regex_flags
+
+SET @@global.default_regex_flags=DEFAULT;
+SET default_regex_flags=DEFAULT;
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
index 727e6ca88f2..7e12c7dc477 100644
--- a/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result
+++ b/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result
@@ -19,7 +19,7 @@ MyISAM
SET @@global.default_storage_engine = MERGE;
SELECT @@global.default_storage_engine;
@@global.default_storage_engine
-MRG_MYISAM
+MRG_MyISAM
SET @@global.default_storage_engine = MEMORY;
SELECT @@global.default_storage_engine;
@@global.default_storage_engine
@@ -36,7 +36,7 @@ MyISAM
SET @@session.default_storage_engine = MERGE;
SELECT @@session.default_storage_engine;
@@session.default_storage_engine
-MRG_MYISAM
+MRG_MyISAM
SET @@session.default_storage_engine = MEMORY;
SELECT @@session.default_storage_engine;
@@session.default_storage_engine
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 55e6f747a19..64028e537bf 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
@@ -9,7 +9,7 @@ SELECT @global_start_value;
select @old_session_opt_switch:=@@session.optimizer_switch,
@old_global_opt_switch:=@@global.optimizer_switch;
@old_session_opt_switch:=@@session.optimizer_switch @old_global_opt_switch:=@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
'#--------------------FN_DYNVARS_028_01------------------------#'
SET @@session.engine_condition_pushdown = 0;
Warnings:
@@ -212,7 +212,7 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
set @@session.engine_condition_pushdown = TRUE;
Warnings:
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
@@ -220,7 +220,7 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
set @@session.engine_condition_pushdown = FALSE;
Warnings:
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
@@ -228,7 +228,7 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
set @@global.engine_condition_pushdown = TRUE;
Warnings:
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
@@ -236,7 +236,7 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
set @@global.engine_condition_pushdown = FALSE;
Warnings:
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
@@ -244,31 +244,31 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
set @@session.optimizer_switch = "engine_condition_pushdown=on";
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
set @@session.optimizer_switch = "engine_condition_pushdown=off";
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
set @@global.optimizer_switch = "engine_condition_pushdown=on";
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
set @@global.optimizer_switch = "engine_condition_pushdown=off";
select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
SET @@session.engine_condition_pushdown = @session_start_value;
Warnings:
Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead
@@ -287,4 +287,4 @@ select @@session.engine_condition_pushdown,
@@global.engine_condition_pushdown,
@@session.optimizer_switch, @@global.optimizer_switch;
@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off
diff --git a/mysql-test/suite/sys_vars/r/gtid_binlog_pos_basic.result b/mysql-test/suite/sys_vars/r/gtid_binlog_pos_basic.result
new file mode 100644
index 00000000000..6d9d0ec449d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_binlog_pos_basic.result
@@ -0,0 +1,9 @@
+SET GLOBAL gtid_binlog_pos= '';
+ERROR HY000: Variable 'gtid_binlog_pos' is a read only variable
+SELECT variable_name FROM information_schema.global_variables
+WHERE variable_name='gtid_binlog_pos';
+variable_name
+GTID_BINLOG_POS
+SELECT @@gtid_binlog_pos;
+SELECT @@session.gtid_binlog_pos;
+ERROR HY000: Variable 'gtid_binlog_pos' is a GLOBAL variable
diff --git a/mysql-test/suite/sys_vars/r/gtid_binlog_state_basic.result b/mysql-test/suite/sys_vars/r/gtid_binlog_state_basic.result
new file mode 100644
index 00000000000..ae845d08086
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_binlog_state_basic.result
@@ -0,0 +1,11 @@
+SELECT @@GLOBAL.gtid_slave_pos;
+@@GLOBAL.gtid_slave_pos
+
+SET gtid_binlog_state= '';
+ERROR HY000: Variable 'gtid_binlog_state' is a GLOBAL variable and should be set with SET GLOBAL
+SET SESSION gtid_binlog_state= '';
+ERROR HY000: Variable 'gtid_binlog_state' is a GLOBAL variable and should be set with SET GLOBAL
+SET GLOBAL gtid_binlog_state= DEFAULT;
+ERROR 42000: Variable 'gtid_binlog_state' doesn't have a default value
+SELECT @@session.gtid_binlog_state;
+ERROR HY000: Variable 'gtid_binlog_state' is a GLOBAL variable
diff --git a/mysql-test/suite/sys_vars/r/gtid_current_pos_basic.result b/mysql-test/suite/sys_vars/r/gtid_current_pos_basic.result
new file mode 100644
index 00000000000..3ddc20d9b8c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_current_pos_basic.result
@@ -0,0 +1,9 @@
+SET GLOBAL gtid_current_pos= '';
+ERROR HY000: Variable 'gtid_current_pos' is a read only variable
+SELECT variable_name FROM information_schema.global_variables
+WHERE variable_name='gtid_current_pos';
+variable_name
+GTID_CURRENT_POS
+SELECT @@gtid_current_pos;
+SELECT @@session.gtid_current_pos;
+ERROR HY000: Variable 'gtid_current_pos' is a GLOBAL variable
diff --git a/mysql-test/suite/sys_vars/r/gtid_domain_id_basic.result b/mysql-test/suite/sys_vars/r/gtid_domain_id_basic.result
new file mode 100644
index 00000000000..ac195ecb13b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_domain_id_basic.result
@@ -0,0 +1,29 @@
+SET @old_gtid_domain_id= @@global.gtid_domain_id;
+SELECT @@global.gtid_domain_id;
+@@global.gtid_domain_id
+0
+SET GLOBAL gtid_domain_id= 10;
+SET SESSION gtid_domain_id= 20;
+SELECT @@global.gtid_domain_id;
+@@global.gtid_domain_id
+10
+SELECT @@session.gtid_domain_id;
+@@session.gtid_domain_id
+20
+SET GLOBAL gtid_domain_id= DEFAULT;
+SELECT @@global.gtid_domain_id;
+@@global.gtid_domain_id
+0
+SET GLOBAL gtid_domain_id= -10;
+Warnings:
+Warning 1292 Truncated incorrect gtid_domain_id value: '-10'
+SELECT @@global.gtid_domain_id;
+@@global.gtid_domain_id
+0
+SET SESSION gtid_domain_id= -1;
+Warnings:
+Warning 1292 Truncated incorrect gtid_domain_id value: '-1'
+SELECT @@session.gtid_domain_id;
+@@session.gtid_domain_id
+0
+SET GLOBAL gtid_domain_id= @old_gtid_domain_id;
diff --git a/mysql-test/suite/sys_vars/r/gtid_ignore_duplicates_basic.result b/mysql-test/suite/sys_vars/r/gtid_ignore_duplicates_basic.result
new file mode 100644
index 00000000000..b0256673825
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_ignore_duplicates_basic.result
@@ -0,0 +1,13 @@
+SET @save_gtid_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
+SELECT @@GLOBAL.gtid_ignore_duplicates as 'must be zero because of default';
+must be zero because of default
+0
+SELECT @@SESSION.gtid_ignore_duplicates as 'no session var';
+ERROR HY000: Variable 'gtid_ignore_duplicates' is a GLOBAL variable
+SET GLOBAL gtid_ignore_duplicates= FALSE;
+SET GLOBAL gtid_ignore_duplicates= DEFAULT;
+SET GLOBAL gtid_ignore_duplicates= TRUE;
+SELECT @@GLOBAL.gtid_ignore_duplicates;
+@@GLOBAL.gtid_ignore_duplicates
+1
+SET GLOBAL gtid_ignore_duplicates = @save_gtid_ignore_duplicates;
diff --git a/mysql-test/suite/sys_vars/r/gtid_seq_no_basic.result b/mysql-test/suite/sys_vars/r/gtid_seq_no_basic.result
new file mode 100644
index 00000000000..f0aa0d2ba97
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_seq_no_basic.result
@@ -0,0 +1,16 @@
+SELECT @@global.gtid_seq_no;
+ERROR HY000: Variable 'gtid_seq_no' is a SESSION variable
+SET GLOBAL gtid_seq_no= 10;
+ERROR HY000: Variable 'gtid_seq_no' is a SESSION variable and can't be used with SET GLOBAL
+SET SESSION gtid_seq_no= 20;
+SELECT @@session.gtid_seq_no;
+@@session.gtid_seq_no
+20
+SET GLOBAL gtid_seq_no= DEFAULT;
+ERROR HY000: Variable 'gtid_seq_no' is a SESSION variable and can't be used with SET GLOBAL
+SET SESSION gtid_seq_no= -1;
+Warnings:
+Warning 1292 Truncated incorrect gtid_seq_no value: '-1'
+SELECT @@session.gtid_seq_no;
+@@session.gtid_seq_no
+0
diff --git a/mysql-test/suite/sys_vars/r/gtid_slave_pos_basic.result b/mysql-test/suite/sys_vars/r/gtid_slave_pos_basic.result
new file mode 100644
index 00000000000..3d880418f31
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_slave_pos_basic.result
@@ -0,0 +1,47 @@
+SET @old_gtid_slave_pos= @@gtid_slave_pos;
+SET GLOBAL gtid_slave_pos= '';
+SELECT @@gtid_slave_pos;
+@@gtid_slave_pos
+
+SET GLOBAL gtid_slave_pos= '1-2-3';
+SELECT variable_value FROM information_schema.global_variables
+WHERE variable_name='gtid_slave_pos';
+variable_value
+1-2-3
+SET @@global.gtid_slave_pos= '1-2-4';
+SELECT @@gtid_slave_pos;
+@@gtid_slave_pos
+1-2-4
+SET GLOBAL gtid_slave_pos= ' 1-2-3';
+SELECT @@gtid_slave_pos;
+@@gtid_slave_pos
+1-2-3
+SET GLOBAL gtid_slave_pos= '1-2-3, 2-4-6';
+SELECT @@gtid_slave_pos;
+@@gtid_slave_pos
+1-2-3,2-4-6
+SET GLOBAL gtid_slave_pos= '-1-2-3';
+ERROR HY000: Could not parse GTID list
+SET GLOBAL gtid_slave_pos= '1-2 -3';
+ERROR HY000: Could not parse GTID list
+SET GLOBAL gtid_slave_pos= '1-2-3 ';
+ERROR HY000: Could not parse GTID list
+SET GLOBAL gtid_slave_pos= '1-2-3,2-4';
+ERROR HY000: Could not parse GTID list
+SET GLOBAL gtid_slave_pos= '0-1-10,0-2-20';
+ERROR HY000: GTID 0-2-20 and 0-1-10 conflict (duplicate domain id 0)
+SET GLOBAL gtid_slave_pos= '0-1-10,1-2-20,2-3-30,1-20-200,3-4-1';
+ERROR HY000: GTID 1-20-200 and 1-2-20 conflict (duplicate domain id 1)
+SET gtid_slave_pos= '';
+ERROR HY000: Variable 'gtid_slave_pos' is a GLOBAL variable and should be set with SET GLOBAL
+SET SESSION gtid_slave_pos= '';
+ERROR HY000: Variable 'gtid_slave_pos' is a GLOBAL variable and should be set with SET GLOBAL
+SET GLOBAL gtid_slave_pos= '1-2-3,2-4-6';
+SELECT @@gtid_slave_pos;
+@@gtid_slave_pos
+1-2-3,2-4-6
+SET GLOBAL gtid_slave_pos= DEFAULT;
+ERROR 42000: Variable 'gtid_slave_pos' doesn't have a default value
+SELECT @@session.gtid_slave_pos;
+ERROR HY000: Variable 'gtid_slave_pos' is a GLOBAL variable
+SET GLOBAL gtid_slave_pos= @old_gtid_slave_pos;
diff --git a/mysql-test/suite/sys_vars/r/gtid_strict_mode_basic.result b/mysql-test/suite/sys_vars/r/gtid_strict_mode_basic.result
new file mode 100644
index 00000000000..25afe97f4c9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/gtid_strict_mode_basic.result
@@ -0,0 +1,29 @@
+select @@global.gtid_strict_mode;
+@@global.gtid_strict_mode
+0
+select @@session.gtid_strict_mode;
+ERROR HY000: Variable 'gtid_strict_mode' is a GLOBAL variable
+show global variables like 'gtid_strict_mode';
+Variable_name Value
+gtid_strict_mode OFF
+show session variables like 'gtid_strict_mode';
+Variable_name Value
+gtid_strict_mode OFF
+select * from information_schema.global_variables where variable_name='gtid_strict_mode';
+VARIABLE_NAME VARIABLE_VALUE
+GTID_STRICT_MODE OFF
+select * from information_schema.session_variables where variable_name='gtid_strict_mode';
+VARIABLE_NAME VARIABLE_VALUE
+GTID_STRICT_MODE OFF
+SET @old= @@GLOBAL.gtid_strict_mode;
+set global gtid_strict_mode=1;
+select @@global.gtid_strict_mode;
+@@global.gtid_strict_mode
+1
+set global gtid_strict_mode=0;
+select @@global.gtid_strict_mode;
+@@global.gtid_strict_mode
+0
+set global gtid_strict_mode=@old;
+set session gtid_strict_mode=1;
+ERROR HY000: Variable 'gtid_strict_mode' is a GLOBAL variable and should be set with SET GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/have_partitioning_basic.result b/mysql-test/suite/sys_vars/r/have_partitioning_basic.result
deleted file mode 100644
index 8a18288a3ec..00000000000
--- a/mysql-test/suite/sys_vars/r/have_partitioning_basic.result
+++ /dev/null
@@ -1,53 +0,0 @@
-'#---------------------BS_STVARS_014_01----------------------#'
-SELECT COUNT(@@GLOBAL.have_partitioning);
-COUNT(@@GLOBAL.have_partitioning)
-1
-1 Expected
-'#---------------------BS_STVARS_014_02----------------------#'
-SET @@GLOBAL.have_partitioning=1;
-ERROR HY000: Variable 'have_partitioning' is a read only variable
-Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.have_partitioning);
-COUNT(@@GLOBAL.have_partitioning)
-1
-1 Expected
-'#---------------------BS_STVARS_014_03----------------------#'
-SELECT @@GLOBAL.have_partitioning = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_partitioning';
-@@GLOBAL.have_partitioning = VARIABLE_VALUE
-1
-1 Expected
-SELECT COUNT(@@GLOBAL.have_partitioning);
-COUNT(@@GLOBAL.have_partitioning)
-1
-1 Expected
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_partitioning';
-COUNT(VARIABLE_VALUE)
-1
-1 Expected
-'#---------------------BS_STVARS_014_04----------------------#'
-SELECT @@have_partitioning = @@GLOBAL.have_partitioning;
-@@have_partitioning = @@GLOBAL.have_partitioning
-1
-1 Expected
-'#---------------------BS_STVARS_014_05----------------------#'
-SELECT COUNT(@@have_partitioning);
-COUNT(@@have_partitioning)
-1
-1 Expected
-SELECT COUNT(@@local.have_partitioning);
-ERROR HY000: Variable 'have_partitioning' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@SESSION.have_partitioning);
-ERROR HY000: Variable 'have_partitioning' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.have_partitioning);
-COUNT(@@GLOBAL.have_partitioning)
-1
-1 Expected
-SELECT have_partitioning = @@SESSION.have_partitioning;
-ERROR 42S22: Unknown column 'have_partitioning' in 'field list'
-Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/histogram_size_basic.result b/mysql-test/suite/sys_vars/r/histogram_size_basic.result
new file mode 100644
index 00000000000..1f310600d00
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/histogram_size_basic.result
@@ -0,0 +1,136 @@
+SET @start_global_value = @@global.histogram_size;
+SELECT @start_global_value;
+@start_global_value
+0
+SET @start_session_value = @@session.histogram_size;
+SELECT @start_session_value;
+@start_session_value
+0
+'#--------------------FN_DYNVARS_053_01-------------------------#'
+SET @@global.histogram_size = DEFAULT;
+SELECT @@global.histogram_size;
+@@global.histogram_size
+0
+SET @@session.histogram_size = DEFAULT;
+SELECT @@session.histogram_size;
+@@session.histogram_size
+0
+'#--------------------FN_DYNVARS_053_03-------------------------#'
+SET @@global.histogram_size = 1;
+SELECT @@global.histogram_size;
+@@global.histogram_size
+1
+SET @@global.histogram_size = 31;
+SELECT @@global.histogram_size;
+@@global.histogram_size
+31
+SET @@global.histogram_size = 255;
+SELECT @@global.histogram_size;
+@@global.histogram_size
+255
+'#--------------------FN_DYNVARS_053_04-------------------------#'
+SET @@session.histogram_size = 1;
+SELECT @@session.histogram_size;
+@@session.histogram_size
+1
+SET @@session.histogram_size = 31;
+SELECT @@session.histogram_size;
+@@session.histogram_size
+31
+SET @@session.histogram_size = 255;
+SELECT @@session.histogram_size;
+@@session.histogram_size
+255
+'#------------------FN_DYNVARS_053_05-----------------------#'
+SET @@global.histogram_size = -1;
+Warnings:
+Warning 1292 Truncated incorrect histogram_size value: '-1'
+SELECT @@global.histogram_size;
+@@global.histogram_size
+0
+SET @@global.histogram_size = 256;
+Warnings:
+Warning 1292 Truncated incorrect histogram_size value: '256'
+SELECT @@global.histogram_size;
+@@global.histogram_size
+255
+SET @@global.histogram_size = 1024;
+Warnings:
+Warning 1292 Truncated incorrect histogram_size value: '1024'
+SELECT @@global.histogram_size;
+@@global.histogram_size
+255
+SET @@global.histogram_size = 4.5;
+ERROR 42000: Incorrect argument type to variable 'histogram_size'
+SELECT @@global.histogram_size;
+@@global.histogram_size
+255
+SET @@global.histogram_size = test;
+ERROR 42000: Incorrect argument type to variable 'histogram_size'
+SELECT @@global.histogram_size;
+@@global.histogram_size
+255
+SET @@session.histogram_size = -1;
+Warnings:
+Warning 1292 Truncated incorrect histogram_size value: '-1'
+SELECT @@session.histogram_size;
+@@session.histogram_size
+0
+SET @@session.histogram_size = 256;
+Warnings:
+Warning 1292 Truncated incorrect histogram_size value: '256'
+SELECT @@session.histogram_size;
+@@session.histogram_size
+255
+SET @@session.histogram_size = 1024;
+Warnings:
+Warning 1292 Truncated incorrect histogram_size value: '1024'
+SELECT @@session.histogram_size;
+@@session.histogram_size
+255
+SET @@session.histogram_size = 4.5;
+ERROR 42000: Incorrect argument type to variable 'histogram_size'
+SELECT @@session.histogram_size;
+@@session.histogram_size
+255
+SET @@session.histogram_size = test;
+ERROR 42000: Incorrect argument type to variable 'histogram_size'
+SELECT @@session.histogram_size;
+@@session.histogram_size
+255
+'#------------------FN_DYNVARS_053_06-----------------------#'
+SELECT @@global.histogram_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='histogram_size';
+@@global.histogram_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_053_07-----------------------#'
+SELECT @@session.histogram_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='histogram_size';
+@@session.histogram_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_053_08-----------------------#'
+SET @@global.histogram_size = TRUE;
+SET @@global.histogram_size = FALSE;
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.histogram_size = 10;
+SELECT @@histogram_size = @@global.histogram_size;
+@@histogram_size = @@global.histogram_size
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@histogram_size = 100;
+SELECT @@histogram_size = @@local.histogram_size;
+@@histogram_size = @@local.histogram_size
+1
+SELECT @@local.histogram_size = @@session.histogram_size;
+@@local.histogram_size = @@session.histogram_size
+1
+SET @@global.histogram_size = @start_global_value;
+SELECT @@global.histogram_size;
+@@global.histogram_size
+0
+SET @@session.histogram_size = @start_session_value;
+SELECT @@session.histogram_size;
+@@session.histogram_size
+0
diff --git a/mysql-test/suite/sys_vars/r/histogram_type_basic.result b/mysql-test/suite/sys_vars/r/histogram_type_basic.result
new file mode 100644
index 00000000000..f688a2a15fd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/histogram_type_basic.result
@@ -0,0 +1,79 @@
+SET @start_global_value = @@global.histogram_type;
+SELECT @start_global_value;
+@start_global_value
+SINGLE_PREC_HB
+SET @start_session_value = @@session.histogram_type;
+SELECT @start_session_value;
+@start_session_value
+SINGLE_PREC_HB
+SET @@global.histogram_type = 1;
+SET @@global.histogram_type = DEFAULT;
+SELECT @@global.histogram_type;
+@@global.histogram_type
+SINGLE_PREC_HB
+SET @@global.histogram_type = 0;
+SELECT @@global.histogram_type;
+@@global.histogram_type
+SINGLE_PREC_HB
+SET @@global.histogram_type = 1;
+SELECT @@global.histogram_type;
+@@global.histogram_type
+DOUBLE_PREC_HB
+SET @@global.histogram_type = SINGLE_PREC_HB;
+SELECT @@global.histogram_type;
+@@global.histogram_type
+SINGLE_PREC_HB
+SET @@global.histogram_type = DOUBLE_PREC_HB;
+SELECT @@global.histogram_type;
+@@global.histogram_type
+DOUBLE_PREC_HB
+SET @@session.histogram_type = 0;
+SELECT @@session.histogram_type;
+@@session.histogram_type
+SINGLE_PREC_HB
+SET @@session.histogram_type = 1;
+SELECT @@session.histogram_type;
+@@session.histogram_type
+DOUBLE_PREC_HB
+SET @@session.histogram_type = SINGLE_PREC_HB;
+SELECT @@session.histogram_type;
+@@session.histogram_type
+SINGLE_PREC_HB
+SET @@session.histogram_type = DOUBLE_PREC_HB;
+SELECT @@session.histogram_type;
+@@session.histogram_type
+DOUBLE_PREC_HB
+set sql_mode=TRADITIONAL;
+SET @@global.histogram_type = 10;
+ERROR 42000: Variable 'histogram_type' can't be set to the value of '10'
+SET @@global.histogram_type = -1024;
+ERROR 42000: Variable 'histogram_type' can't be set to the value of '-1024'
+SET @@global.histogram_type = 2.4;
+ERROR 42000: Incorrect argument type to variable 'histogram_type'
+SET @@global.histogram_type = OFF;
+ERROR 42000: Variable 'histogram_type' can't be set to the value of 'OFF'
+SET @@session.histogram_type = 10;
+ERROR 42000: Variable 'histogram_type' can't be set to the value of '10'
+SET @@session.histogram_type = -2;
+ERROR 42000: Variable 'histogram_type' can't be set to the value of '-2'
+SET @@session.histogram_type = 1.2;
+ERROR 42000: Incorrect argument type to variable 'histogram_type'
+SET @@session.histogram_type = ON;
+ERROR 42000: Variable 'histogram_type' can't be set to the value of 'ON'
+SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='histogram_type';
+VARIABLE_NAME VARIABLE_VALUE
+HISTOGRAM_TYPE DOUBLE_PREC_HB
+SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='histogram_type';
+VARIABLE_NAME VARIABLE_VALUE
+HISTOGRAM_TYPE DOUBLE_PREC_HB
+SET @@global.histogram_type = @start_global_value;
+SELECT @@global.histogram_type;
+@@global.histogram_type
+SINGLE_PREC_HB
+SET @@session.histogram_type = @start_session_value;
+SELECT @@session.histogram_type;
+@@session.histogram_type
+SINGLE_PREC_HB
+set sql_mode='';
diff --git a/mysql-test/suite/sys_vars/r/host_cache_size_basic.result b/mysql-test/suite/sys_vars/r/host_cache_size_basic.result
new file mode 100644
index 00000000000..0a25202e7e4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/host_cache_size_basic.result
@@ -0,0 +1,37 @@
+select @@global.host_cache_size;
+@@global.host_cache_size
+123
+select @@session.host_cache_size;
+ERROR HY000: Variable 'host_cache_size' is a GLOBAL variable
+show global variables like 'host_cache_size';
+Variable_name Value
+host_cache_size 123
+show session variables like 'host_cache_size';
+Variable_name Value
+host_cache_size 123
+select * from information_schema.global_variables
+where variable_name='host_cache_size';
+VARIABLE_NAME VARIABLE_VALUE
+HOST_CACHE_SIZE 123
+select * from information_schema.session_variables
+where variable_name='host_cache_size';
+VARIABLE_NAME VARIABLE_VALUE
+HOST_CACHE_SIZE 123
+set global host_cache_size=1;
+select @@global.host_cache_size;
+@@global.host_cache_size
+1
+set global host_cache_size=12;
+select @@global.host_cache_size;
+@@global.host_cache_size
+12
+set global host_cache_size=0;
+select @@global.host_cache_size;
+@@global.host_cache_size
+0
+set session host_cache_size=1;
+ERROR HY000: Variable 'host_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+set global host_cache_size=123;
+select @@global.host_cache_size;
+@@global.host_cache_size
+123
diff --git a/mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result b/mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result
index 55d61800a39..6ae3fd70188 100644
--- a/mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result
+++ b/mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("table or database name '.otherdir'");
select @@ignore_db_dirs;
@@ignore_db_dirs
e,lost+found,.mysqlgui,ignored_db
@@ -6,8 +7,8 @@ e,lost+found,.mysqlgui,ignored_db
# with '.'
SHOW DATABASES;
Database
-information_schema
#mysql50#.otherdir
+information_schema
mtr
mysql
performance_schema
@@ -33,8 +34,8 @@ id
2
SHOW DATABASES;
Database
-information_schema
#mysql50#.otherdir
+information_schema
lost+found
mtr
mysql
diff --git a/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_lwm_basic.result b/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_lwm_basic.result
new file mode 100644
index 00000000000..bfd59cfd9cc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_lwm_basic.result
@@ -0,0 +1,96 @@
+SET @global_start_value = @@global.innodb_adaptive_flushing_lwm;
+SELECT @global_start_value;
+@global_start_value
+10
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_adaptive_flushing_lwm = 1;
+SET @@global.innodb_adaptive_flushing_lwm = DEFAULT;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+10.000000
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_adaptive_flushing_lwm = 1;
+ERROR HY000: Variable 'innodb_adaptive_flushing_lwm' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_adaptive_flushing_lwm;
+@@innodb_adaptive_flushing_lwm
+10.000000
+SELECT local.innodb_adaptive_flushing_lwm;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_adaptive_flushing_lwm = 1;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+1.000000
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_adaptive_flushing_lwm = 1;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+1.000000
+SET @@global.innodb_adaptive_flushing_lwm = 60;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+60.000000
+SET @@global.innodb_adaptive_flushing_lwm = 70;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+70.000000
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_adaptive_flushing_lwm = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_adaptive_flushing_lwm value: '-1'
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+0.000000
+SET @@global.innodb_adaptive_flushing_lwm = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_flushing_lwm'
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+0.000000
+SET @@global.innodb_adaptive_flushing_lwm = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_flushing_lwm'
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+0.000000
+SET @@global.innodb_adaptive_flushing_lwm = 71;
+Warnings:
+Warning 1292 Truncated incorrect innodb_adaptive_flushing_lwm value: '71'
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+70.000000
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_adaptive_flushing_lwm =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_adaptive_flushing_lwm';
+@@global.innodb_adaptive_flushing_lwm =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+70.000000
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_adaptive_flushing_lwm';
+VARIABLE_VALUE
+70.000000
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_adaptive_flushing_lwm = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_flushing_lwm'
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+70.000000
+SET @@global.innodb_adaptive_flushing_lwm = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_flushing_lwm'
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+70.000000
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_adaptive_flushing_lwm = TRUE;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+1.000000
+SET @@global.innodb_adaptive_flushing_lwm = FALSE;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+0.000000
+SET @@global.innodb_adaptive_flushing_lwm = @global_start_value;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+@@global.innodb_adaptive_flushing_lwm
+10.000000
diff --git a/mysql-test/suite/sys_vars/r/innodb_adaptive_max_sleep_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_adaptive_max_sleep_delay_basic.result
new file mode 100644
index 00000000000..54b1c1e78b4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_adaptive_max_sleep_delay_basic.result
@@ -0,0 +1,46 @@
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+@@GLOBAL.innodb_adaptive_max_sleep_delay
+150000
+150000 Expected
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100;
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000001;
+Warnings:
+Warning 1292 Truncated incorrect innodb_adaptive_max_sleep_delay value: '1000001'
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+@@GLOBAL.innodb_adaptive_max_sleep_delay
+1000000
+1000000 Expected
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=-1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_adaptive_max_sleep_delay value: '-1'
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+@@GLOBAL.innodb_adaptive_max_sleep_delay
+0
+0 Expected
+SELECT COUNT(@@GLOBAL.innodb_adaptive_max_sleep_delay);
+COUNT(@@GLOBAL.innodb_adaptive_max_sleep_delay)
+1
+1 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_adaptive_max_sleep_delay';
+VARIABLE_VALUE
+0
+100 Expected
+SELECT @@innodb_adaptive_max_sleep_delay = @@GLOBAL.innodb_adaptive_max_sleep_delay;
+@@innodb_adaptive_max_sleep_delay = @@GLOBAL.innodb_adaptive_max_sleep_delay
+1
+1000000 Expected
+SELECT COUNT(@@innodb_adaptive_max_sleep_delay);
+COUNT(@@innodb_adaptive_max_sleep_delay)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_adaptive_max_sleep_delay);
+ERROR HY000: Variable 'innodb_adaptive_max_sleep_delay' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_adaptive_max_sleep_delay);
+ERROR HY000: Variable 'innodb_adaptive_max_sleep_delay' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT innodb_adaptive_max_sleep_delay = @@SESSION.innodb_adaptive_max_sleep_delay;
+ERROR 42S22: Unknown column 'innodb_adaptive_max_sleep_delay' in 'field list'
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=150000;
diff --git a/mysql-test/suite/sys_vars/r/innodb_api_bk_commit_interval_basic.result b/mysql-test/suite/sys_vars/r/innodb_api_bk_commit_interval_basic.result
new file mode 100644
index 00000000000..d2773b7da69
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_api_bk_commit_interval_basic.result
@@ -0,0 +1,64 @@
+SET @start_global_value = @@global.innodb_api_bk_commit_interval;
+SELECT @start_global_value;
+@start_global_value
+5
+Valid values are positive number
+SELECT @@global.innodb_api_bk_commit_interval > 0;
+@@global.innodb_api_bk_commit_interval > 0
+1
+SELECT @@global.innodb_api_bk_commit_interval <= 1024*1024*1024;
+@@global.innodb_api_bk_commit_interval <= 1024*1024*1024
+1
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+5
+SELECT @@session.innodb_api_bk_commit_interval;
+ERROR HY000: Variable 'innodb_api_bk_commit_interval' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_api_bk_commit_interval';
+Variable_name Value
+innodb_api_bk_commit_interval 5
+SHOW session variables LIKE 'innodb_api_bk_commit_interval';
+Variable_name Value
+innodb_api_bk_commit_interval 5
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_bk_commit_interval';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_API_BK_COMMIT_INTERVAL 5
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_api_bk_commit_interval';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_API_BK_COMMIT_INTERVAL 5
+SET global innodb_api_bk_commit_interval=100;
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+100
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_bk_commit_interval';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_API_BK_COMMIT_INTERVAL 100
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_api_bk_commit_interval';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_API_BK_COMMIT_INTERVAL 100
+SET session innodb_api_bk_commit_interval=1;
+ERROR HY000: Variable 'innodb_api_bk_commit_interval' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_api_bk_commit_interval=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_api_bk_commit_interval'
+SET global innodb_api_bk_commit_interval=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_api_bk_commit_interval'
+SET global innodb_api_bk_commit_interval="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_api_bk_commit_interval'
+SET global innodb_api_bk_commit_interval=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_api_bk_commit_interval value: '-7'
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+1
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_bk_commit_interval';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_API_BK_COMMIT_INTERVAL 1
+SET @@global.innodb_api_bk_commit_interval = @start_global_value;
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+5
diff --git a/mysql-test/suite/sys_vars/r/innodb_api_disable_rowlock_basic.result b/mysql-test/suite/sys_vars/r/innodb_api_disable_rowlock_basic.result
new file mode 100644
index 00000000000..5256c1ece8a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_api_disable_rowlock_basic.result
@@ -0,0 +1,53 @@
+'#---------------------BS_STVARS_035_01----------------------#'
+SELECT COUNT(@@GLOBAL.innodb_api_disable_rowlock);
+COUNT(@@GLOBAL.innodb_api_disable_rowlock)
+1
+1 Expected
+'#---------------------BS_STVARS_035_02----------------------#'
+SET @@GLOBAL.innodb_api_disable_rowlock=1;
+ERROR HY000: Variable 'innodb_api_disable_rowlock' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_api_disable_rowlock);
+COUNT(@@GLOBAL.innodb_api_disable_rowlock)
+1
+1 Expected
+'#---------------------BS_STVARS_035_03----------------------#'
+SELECT IF(@@GLOBAL.innodb_api_disable_rowlock, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_api_disable_rowlock';
+IF(@@GLOBAL.innodb_api_disable_rowlock, 'ON', 'OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_api_disable_rowlock);
+COUNT(@@GLOBAL.innodb_api_disable_rowlock)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_api_disable_rowlock';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_035_04----------------------#'
+SELECT @@innodb_api_disable_rowlock = @@GLOBAL.innodb_api_enable_binlog;
+@@innodb_api_disable_rowlock = @@GLOBAL.innodb_api_enable_binlog
+1
+1 Expected
+'#---------------------BS_STVARS_035_05----------------------#'
+SELECT COUNT(@@innodb_api_disable_rowlock);
+COUNT(@@innodb_api_disable_rowlock)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_api_disable_rowlock);
+ERROR HY000: Variable 'innodb_api_disable_rowlock' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_api_disable_rowlock);
+ERROR HY000: Variable 'innodb_api_disable_rowlock' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_api_disable_rowlock);
+COUNT(@@GLOBAL.innodb_api_disable_rowlock)
+1
+1 Expected
+SELECT innodb_api_disable_rowlock = @@SESSION.innodb_api_enable_binlog;
+ERROR 42S22: Unknown column 'innodb_api_disable_rowlock' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_api_enable_binlog_basic.result b/mysql-test/suite/sys_vars/r/innodb_api_enable_binlog_basic.result
new file mode 100644
index 00000000000..f06fbeb8da7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_api_enable_binlog_basic.result
@@ -0,0 +1,53 @@
+'#---------------------BS_STVARS_035_01----------------------#'
+SELECT COUNT(@@GLOBAL.innodb_api_enable_binlog);
+COUNT(@@GLOBAL.innodb_api_enable_binlog)
+1
+1 Expected
+'#---------------------BS_STVARS_035_02----------------------#'
+SET @@GLOBAL.innodb_api_enable_binlog=1;
+ERROR HY000: Variable 'innodb_api_enable_binlog' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_api_enable_binlog);
+COUNT(@@GLOBAL.innodb_api_enable_binlog)
+1
+1 Expected
+'#---------------------BS_STVARS_035_03----------------------#'
+SELECT IF(@@GLOBAL.innodb_api_enable_binlog, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_api_enable_binlog';
+IF(@@GLOBAL.innodb_api_enable_binlog, 'ON', 'OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_api_enable_binlog);
+COUNT(@@GLOBAL.innodb_api_enable_binlog)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_api_enable_binlog';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_035_04----------------------#'
+SELECT @@innodb_api_enable_binlog = @@GLOBAL.innodb_api_enable_binlog;
+@@innodb_api_enable_binlog = @@GLOBAL.innodb_api_enable_binlog
+1
+1 Expected
+'#---------------------BS_STVARS_035_05----------------------#'
+SELECT COUNT(@@innodb_api_enable_binlog);
+COUNT(@@innodb_api_enable_binlog)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_api_enable_binlog);
+ERROR HY000: Variable 'innodb_api_enable_binlog' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_api_enable_binlog);
+ERROR HY000: Variable 'innodb_api_enable_binlog' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_api_enable_binlog);
+COUNT(@@GLOBAL.innodb_api_enable_binlog)
+1
+1 Expected
+SELECT innodb_api_enable_binlog = @@SESSION.innodb_api_enable_binlog;
+ERROR 42S22: Unknown column 'innodb_api_enable_binlog' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_api_enable_mdl_basic.result b/mysql-test/suite/sys_vars/r/innodb_api_enable_mdl_basic.result
new file mode 100644
index 00000000000..4484b151396
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_api_enable_mdl_basic.result
@@ -0,0 +1,53 @@
+'#---------------------BS_STVARS_035_01----------------------#'
+SELECT COUNT(@@GLOBAL.innodb_api_enable_mdl);
+COUNT(@@GLOBAL.innodb_api_enable_mdl)
+1
+1 Expected
+'#---------------------BS_STVARS_035_02----------------------#'
+SET @@GLOBAL.innodb_api_enable_mdl=1;
+ERROR HY000: Variable 'innodb_api_enable_mdl' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_api_enable_mdl);
+COUNT(@@GLOBAL.innodb_api_enable_mdl)
+1
+1 Expected
+'#---------------------BS_STVARS_035_03----------------------#'
+SELECT IF(@@GLOBAL.innodb_api_enable_mdl, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_api_enable_mdl';
+IF(@@GLOBAL.innodb_api_enable_mdl, 'ON', 'OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_api_enable_mdl);
+COUNT(@@GLOBAL.innodb_api_enable_mdl)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_api_enable_mdl';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_035_04----------------------#'
+SELECT @@innodb_api_enable_mdl = @@GLOBAL.innodb_api_enable_mdl;
+@@innodb_api_enable_mdl = @@GLOBAL.innodb_api_enable_mdl
+1
+1 Expected
+'#---------------------BS_STVARS_035_05----------------------#'
+SELECT COUNT(@@innodb_api_enable_mdl);
+COUNT(@@innodb_api_enable_mdl)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_api_enable_mdl);
+ERROR HY000: Variable 'innodb_api_enable_mdl' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_api_enable_mdl);
+ERROR HY000: Variable 'innodb_api_enable_mdl' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_api_enable_mdl);
+COUNT(@@GLOBAL.innodb_api_enable_mdl)
+1
+1 Expected
+SELECT innodb_api_enable_mdl = @@SESSION.innodb_api_enable_mdl;
+ERROR 42S22: Unknown column 'innodb_api_enable_mdl' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_api_trx_level_basic.result b/mysql-test/suite/sys_vars/r/innodb_api_trx_level_basic.result
new file mode 100644
index 00000000000..41071799883
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_api_trx_level_basic.result
@@ -0,0 +1,66 @@
+SET @start_global_value = @@global.innodb_api_trx_level;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are zero or above
+SELECT @@global.innodb_api_trx_level >=0;
+@@global.innodb_api_trx_level >=0
+1
+SELECT @@global.innodb_api_trx_level <=3;
+@@global.innodb_api_trx_level <=3
+1
+SELECT @@global.innodb_api_trx_level;
+@@global.innodb_api_trx_level
+0
+SELECT @@session.innodb_api_trx_level;
+ERROR HY000: Variable 'innodb_api_trx_level' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_api_trx_level';
+Variable_name Value
+innodb_api_trx_level 0
+SHOW session variables LIKE 'innodb_api_trx_level';
+Variable_name Value
+innodb_api_trx_level 0
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_trx_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_API_TRX_LEVEL 0
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_api_trx_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_API_TRX_LEVEL 0
+SET global innodb_api_trx_level=100;
+Warnings:
+Warning 1292 Truncated incorrect innodb_api_trx_level value: '100'
+SELECT @@global.innodb_api_trx_level;
+@@global.innodb_api_trx_level
+3
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_trx_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_API_TRX_LEVEL 3
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_api_trx_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_API_TRX_LEVEL 3
+SET session innodb_api_trx_level=1;
+ERROR HY000: Variable 'innodb_api_trx_level' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_api_trx_level=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_api_trx_level'
+SET global innodb_api_trx_level=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_api_trx_level'
+SET global innodb_api_trx_level="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_api_trx_level'
+SET global innodb_api_trx_level=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_api_trx_level value: '-7'
+SELECT @@global.innodb_api_trx_level;
+@@global.innodb_api_trx_level
+0
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_trx_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_API_TRX_LEVEL 0
+SET @@global.innodb_api_trx_level = @start_global_value;
+SELECT @@global.innodb_api_trx_level;
+@@global.innodb_api_trx_level
+0
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 1f458a8e1fd..900f0167261 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
@@ -6,13 +6,13 @@ Warning 1292 Truncated incorrect innodb_autoextend_increment value: '0'
SET @@global.innodb_autoextend_increment = DEFAULT;
SELECT @@global.innodb_autoextend_increment ;
@@global.innodb_autoextend_increment
-8
+64
'#---------------------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
-8
+64
SELECT local.innodb_autoextend_increment ;
ERROR 42S02: Unknown table 'local' in field list
SET global innodb_autoextend_increment = 0;
diff --git a/mysql-test/suite/sys_vars/r/innodb_buf_flush_list_now_basic.result b/mysql-test/suite/sys_vars/r/innodb_buf_flush_list_now_basic.result
new file mode 100644
index 00000000000..95b4e6fe780
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buf_flush_list_now_basic.result
@@ -0,0 +1,23 @@
+#
+# Basic test for innodb_buf_flush_list_now.
+#
+SELECT @@global.innodb_buf_flush_list_now;
+@@global.innodb_buf_flush_list_now
+0
+set global innodb_buf_flush_list_now = 1;
+SELECT @@global.innodb_buf_flush_list_now;
+@@global.innodb_buf_flush_list_now
+0
+set global innodb_buf_flush_list_now = 0;
+set global innodb_buf_flush_list_now = dummy;
+ERROR 42000: Variable 'innodb_buf_flush_list_now' can't be set to the value of 'dummy'
+set innodb_buf_flush_list_now = ON;
+ERROR HY000: Variable 'innodb_buf_flush_list_now' is a GLOBAL variable and should be set with SET GLOBAL
+# Setting to ON is ok.
+set global innodb_buf_flush_list_now = ON;
+# Setting to OFF is ok.
+set global innodb_buf_flush_list_now = OFF;
+# Must always be 0.
+SELECT @@global.innodb_buf_flush_list_now;
+@@global.innodb_buf_flush_list_now
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_at_shutdown_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_at_shutdown_basic.result
new file mode 100644
index 00000000000..26bb44b4587
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_at_shutdown_basic.result
@@ -0,0 +1,18 @@
+SET @orig = @@global.innodb_buffer_pool_dump_at_shutdown;
+SELECT @orig;
+@orig
+0
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = OFF;
+SELECT @@global.innodb_buffer_pool_dump_at_shutdown;
+@@global.innodb_buffer_pool_dump_at_shutdown
+0
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = ON;
+SELECT @@global.innodb_buffer_pool_dump_at_shutdown;
+@@global.innodb_buffer_pool_dump_at_shutdown
+1
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = 12.34;
+Got one of the listed errors
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = "string";
+Got one of the listed errors
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = 5;
+Got one of the listed errors
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_now_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_now_basic.result
new file mode 100644
index 00000000000..9c3a37f892b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_now_basic.result
@@ -0,0 +1,8 @@
+SET @orig = @@global.innodb_buffer_pool_dump_now;
+SELECT @orig;
+@orig
+0
+SET GLOBAL innodb_buffer_pool_dump_now = ON;
+SELECT @@global.innodb_buffer_pool_dump_now;
+@@global.innodb_buffer_pool_dump_now
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_pct_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_pct_basic.result
new file mode 100644
index 00000000000..51c72cfe791
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_pct_basic.result
@@ -0,0 +1,20 @@
+SET @orig = @@global.innodb_buffer_pool_dump_pct;
+SELECT @orig;
+@orig
+100
+SET GLOBAL innodb_buffer_pool_dump_pct=3, GLOBAL innodb_buffer_pool_dump_now = ON;
+SET GLOBAL innodb_buffer_pool_dump_pct=0;
+SELECT @@global.innodb_buffer_pool_dump_pct;
+@@global.innodb_buffer_pool_dump_pct
+1
+SHOW WARNINGS;
+Level Code Message
+Warning 1292 Truncated incorrect innodb_buffer_pool_dump_pct value: '0'
+SET GLOBAL innodb_buffer_pool_dump_pct=101;
+SELECT @@global.innodb_buffer_pool_dump_pct;
+@@global.innodb_buffer_pool_dump_pct
+100
+SHOW WARNINGS;
+Level Code Message
+Warning 1292 Truncated incorrect innodb_buffer_pool_dump_pct value: '101'
+SET GLOBAL innodb_buffer_pool_dump_pct=@orig;
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result
new file mode 100644
index 00000000000..5e50a715307
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result
@@ -0,0 +1,7 @@
+SET @orig = @@global.innodb_buffer_pool_filename;
+SELECT @orig;
+@orig
+ib_buffer_pool
+SET GLOBAL innodb_buffer_pool_filename = 'innodb_foobar_dump';
+SET GLOBAL innodb_buffer_pool_dump_now = ON;
+SET GLOBAL innodb_buffer_pool_filename = @orig;
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_abort_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_abort_basic.result
new file mode 100644
index 00000000000..255c3428eb5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_abort_basic.result
@@ -0,0 +1,8 @@
+SET @orig = @@global.innodb_buffer_pool_load_abort;
+SELECT @orig;
+@orig
+0
+SET GLOBAL innodb_buffer_pool_load_abort = ON;
+SELECT @@global.innodb_buffer_pool_load_abort;
+@@global.innodb_buffer_pool_load_abort
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_at_startup_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_at_startup_basic.result
new file mode 100644
index 00000000000..1dad72baefd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_at_startup_basic.result
@@ -0,0 +1,8 @@
+SET @orig = @@global.innodb_buffer_pool_load_at_startup;
+SELECT @orig;
+@orig
+0
+SET GLOBAL innodb_buffer_pool_load_at_startup = OFF;
+ERROR HY000: Variable 'innodb_buffer_pool_load_at_startup' is a read only variable
+SET GLOBAL innodb_buffer_pool_load_at_startup = ON;
+ERROR HY000: Variable 'innodb_buffer_pool_load_at_startup' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result
new file mode 100644
index 00000000000..3185d1ca170
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result
@@ -0,0 +1,11 @@
+SET @orig = @@global.innodb_buffer_pool_load_now;
+SELECT @orig;
+@orig
+0
+SET GLOBAL innodb_buffer_pool_dump_now = ON;
+SET GLOBAL innodb_buffer_pool_load_now = ON;
+SELECT variable_value
+FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
+variable_value
+Buffer pool(s) load completed at TIMESTAMP_NOW
diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffer_max_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffer_max_size_basic.result
new file mode 100644
index 00000000000..03f11ece358
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_change_buffer_max_size_basic.result
@@ -0,0 +1,77 @@
+SET @start_global_value = @@global.innodb_change_buffer_max_size;
+SELECT @start_global_value;
+@start_global_value
+25
+Valid values are between 0 and 50
+select @@global.innodb_change_buffer_max_size between 0 and 50;
+@@global.innodb_change_buffer_max_size between 0 and 50
+1
+select @@global.innodb_change_buffer_max_size;
+@@global.innodb_change_buffer_max_size
+25
+select @@session.innodb_change_buffer_max_size;
+ERROR HY000: Variable 'innodb_change_buffer_max_size' is a GLOBAL variable
+show global variables like 'innodb_change_buffer_max_size';
+Variable_name Value
+innodb_change_buffer_max_size 25
+show session variables like 'innodb_change_buffer_max_size';
+Variable_name Value
+innodb_change_buffer_max_size 25
+select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_CHANGE_BUFFER_MAX_SIZE 25
+select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_CHANGE_BUFFER_MAX_SIZE 25
+set global innodb_change_buffer_max_size=10;
+select @@global.innodb_change_buffer_max_size;
+@@global.innodb_change_buffer_max_size
+10
+select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_CHANGE_BUFFER_MAX_SIZE 10
+select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_CHANGE_BUFFER_MAX_SIZE 10
+set session innodb_change_buffer_max_size=1;
+ERROR HY000: Variable 'innodb_change_buffer_max_size' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_change_buffer_max_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_change_buffer_max_size'
+set global innodb_change_buffer_max_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_change_buffer_max_size'
+set global innodb_change_buffer_max_size="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_change_buffer_max_size'
+set global innodb_change_buffer_max_size=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_change_buffer_max_size value: '-7'
+select @@global.innodb_change_buffer_max_size;
+@@global.innodb_change_buffer_max_size
+0
+select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_CHANGE_BUFFER_MAX_SIZE 0
+set global innodb_change_buffer_max_size=56;
+Warnings:
+Warning 1292 Truncated incorrect innodb_change_buffer_max_size value: '56'
+select @@global.innodb_change_buffer_max_size;
+@@global.innodb_change_buffer_max_size
+50
+select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_CHANGE_BUFFER_MAX_SIZE 50
+set global innodb_change_buffer_max_size=0;
+select @@global.innodb_change_buffer_max_size;
+@@global.innodb_change_buffer_max_size
+0
+set global innodb_change_buffer_max_size=50;
+select @@global.innodb_change_buffer_max_size;
+@@global.innodb_change_buffer_max_size
+50
+set global innodb_change_buffer_max_size=DEFAULT;
+select @@global.innodb_change_buffer_max_size;
+@@global.innodb_change_buffer_max_size
+25
+SET @@global.innodb_change_buffer_max_size = @start_global_value;
+SELECT @@global.innodb_change_buffer_max_size;
+@@global.innodb_change_buffer_max_size
+25
diff --git a/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result b/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result
new file mode 100644
index 00000000000..d2d96596a93
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result
@@ -0,0 +1,47 @@
+SET @orig = @@global.innodb_checksum_algorithm;
+SELECT @orig;
+@orig
+innodb
+SET GLOBAL innodb_checksum_algorithm = 'crc32';
+SELECT @@global.innodb_checksum_algorithm;
+@@global.innodb_checksum_algorithm
+crc32
+SET GLOBAL innodb_checksum_algorithm = 'strict_crc32';
+SELECT @@global.innodb_checksum_algorithm;
+@@global.innodb_checksum_algorithm
+strict_crc32
+SET GLOBAL innodb_checksum_algorithm = 'innodb';
+SELECT @@global.innodb_checksum_algorithm;
+@@global.innodb_checksum_algorithm
+innodb
+SET GLOBAL innodb_checksum_algorithm = 'strict_innodb';
+SELECT @@global.innodb_checksum_algorithm;
+@@global.innodb_checksum_algorithm
+strict_innodb
+SET GLOBAL innodb_checksum_algorithm = 'none';
+SELECT @@global.innodb_checksum_algorithm;
+@@global.innodb_checksum_algorithm
+none
+SET GLOBAL innodb_checksum_algorithm = 'strict_none';
+SELECT @@global.innodb_checksum_algorithm;
+@@global.innodb_checksum_algorithm
+strict_none
+SET GLOBAL innodb_checksum_algorithm = '';
+ERROR 42000: Variable 'innodb_checksum_algorithm' can't be set to the value of ''
+SELECT @@global.innodb_checksum_algorithm;
+@@global.innodb_checksum_algorithm
+strict_none
+SET GLOBAL innodb_checksum_algorithm = 'foobar';
+ERROR 42000: Variable 'innodb_checksum_algorithm' can't be set to the value of 'foobar'
+SELECT @@global.innodb_checksum_algorithm;
+@@global.innodb_checksum_algorithm
+strict_none
+SET GLOBAL innodb_checksum_algorithm = 123;
+ERROR 42000: Variable 'innodb_checksum_algorithm' can't be set to the value of '123'
+SELECT @@global.innodb_checksum_algorithm;
+@@global.innodb_checksum_algorithm
+strict_none
+SET GLOBAL innodb_checksum_algorithm = @orig;
+SELECT @@global.innodb_checksum_algorithm;
+@@global.innodb_checksum_algorithm
+innodb
diff --git a/mysql-test/suite/sys_vars/r/innodb_cleaner_eviction_factor_basic.result b/mysql-test/suite/sys_vars/r/innodb_cleaner_eviction_factor_basic.result
new file mode 100644
index 00000000000..8f017ea40ec
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_cleaner_eviction_factor_basic.result
@@ -0,0 +1,31 @@
+SET @start_value = @@GLOBAL.innodb_cleaner_eviction_factor;
+SELECT @@GLOBAL.innodb_cleaner_eviction_factor;
+@@GLOBAL.innodb_cleaner_eviction_factor
+0
+SELECT @@SESSION.innodb_cleaner_eviction_factor;
+ERROR HY000: Variable 'innodb_cleaner_eviction_factor' is a GLOBAL variable
+SET GLOBAL innodb_cleaner_eviction_factor='OFF';
+SELECT @@GLOBAL.innodb_cleaner_eviction_factor;
+@@GLOBAL.innodb_cleaner_eviction_factor
+0
+SET GLOBAL innodb_cleaner_eviction_factor='ON';
+SELECT @@GLOBAL.innodb_cleaner_eviction_factor;
+@@GLOBAL.innodb_cleaner_eviction_factor
+1
+SET GLOBAL innodb_cleaner_eviction_factor=0;
+SELECT @@GLOBAL.innodb_cleaner_eviction_factor;
+@@GLOBAL.innodb_cleaner_eviction_factor
+0
+SET GLOBAL innodb_cleaner_eviction_factor=1;
+SELECT @@GLOBAL.innodb_cleaner_eviction_factor;
+@@GLOBAL.innodb_cleaner_eviction_factor
+1
+SET GLOBAL innodb_cleaner_eviction_factor=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_eviction_factor'
+SET GLOBAL innodb_cleaner_eviction_factor=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_eviction_factor'
+SET GLOBAL innodb_cleaner_eviction_factor=2;
+ERROR 42000: Variable 'innodb_cleaner_eviction_factor' can't be set to the value of '2'
+SET GLOBAL innodb_cleaner_eviction_factor='foo';
+ERROR 42000: Variable 'innodb_cleaner_eviction_factor' can't be set to the value of 'foo'
+SET GLOBAL innodb_cleaner_eviction_factor = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_cleaner_flush_chunk_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_cleaner_flush_chunk_size_basic.result
new file mode 100644
index 00000000000..651023d7a38
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_cleaner_flush_chunk_size_basic.result
@@ -0,0 +1,31 @@
+SET @start_value = @@GLOBAL.innodb_cleaner_flush_chunk_size;
+SELECT @@GLOBAL.innodb_cleaner_flush_chunk_size;
+@@GLOBAL.innodb_cleaner_flush_chunk_size
+100
+SELECT @@SESSION.innodb_cleaner_flush_chunk_size;
+ERROR HY000: Variable 'innodb_cleaner_flush_chunk_size' is a GLOBAL variable
+SET GLOBAL innodb_cleaner_flush_chunk_size=1;
+SELECT @@GLOBAL.innodb_cleaner_flush_chunk_size;
+@@GLOBAL.innodb_cleaner_flush_chunk_size
+1
+SET GLOBAL innodb_cleaner_flush_chunk_size=1000;
+SELECT @@GLOBAL.innodb_cleaner_flush_chunk_size;
+@@GLOBAL.innodb_cleaner_flush_chunk_size
+1000
+SET GLOBAL innodb_cleaner_flush_chunk_size=4294967295;
+SELECT @@GLOBAL.innodb_cleaner_flush_chunk_size;
+@@GLOBAL.innodb_cleaner_flush_chunk_size
+4294967295
+SET GLOBAL innodb_cleaner_flush_chunk_size=0;
+Warnings:
+Warning 1292 Truncated incorrect innodb_cleaner_flush_chunk_size value: '0'
+SELECT @@GLOBAL.innodb_cleaner_flush_chunk_size;
+@@GLOBAL.innodb_cleaner_flush_chunk_size
+1
+SET GLOBAL innodb_cleaner_flush_chunk_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_flush_chunk_size'
+SET GLOBAL innodb_cleaner_flush_chunk_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_flush_chunk_size'
+SET GLOBAL innodb_cleaner_flush_chunk_size='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_flush_chunk_size'
+SET GLOBAL innodb_cleaner_flush_chunk_size = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_cleaner_free_list_lwm_basic.result b/mysql-test/suite/sys_vars/r/innodb_cleaner_free_list_lwm_basic.result
new file mode 100644
index 00000000000..2d7883b7d83
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_cleaner_free_list_lwm_basic.result
@@ -0,0 +1,35 @@
+SET @start_value = @@GLOBAL.innodb_cleaner_free_list_lwm;
+SELECT @@GLOBAL.innodb_cleaner_free_list_lwm;
+@@GLOBAL.innodb_cleaner_free_list_lwm
+10
+SELECT @@SESSION.innodb_cleaner_free_list_lwm;
+ERROR HY000: Variable 'innodb_cleaner_free_list_lwm' is a GLOBAL variable
+SET GLOBAL innodb_cleaner_free_list_lwm=0;
+SELECT @@GLOBAL.innodb_cleaner_free_list_lwm;
+@@GLOBAL.innodb_cleaner_free_list_lwm
+0
+SET GLOBAL innodb_cleaner_free_list_lwm=1;
+SELECT @@GLOBAL.innodb_cleaner_free_list_lwm;
+@@GLOBAL.innodb_cleaner_free_list_lwm
+1
+SET GLOBAL innodb_cleaner_free_list_lwm=99;
+SELECT @@GLOBAL.innodb_cleaner_free_list_lwm;
+@@GLOBAL.innodb_cleaner_free_list_lwm
+99
+SET GLOBAL innodb_cleaner_free_list_lwm=100;
+SELECT @@GLOBAL.innodb_cleaner_free_list_lwm;
+@@GLOBAL.innodb_cleaner_free_list_lwm
+100
+SET GLOBAL innodb_cleaner_free_list_lwm=101;
+Warnings:
+Warning 1292 Truncated incorrect innodb_cleaner_free_list_lwm value: '101'
+SELECT @@innodb_cleaner_free_list_lwm;
+@@innodb_cleaner_free_list_lwm
+100
+SET GLOBAL innodb_cleaner_free_list_lwm=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_free_list_lwm'
+SET GLOBAL innodb_cleaner_free_list_lwm=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_free_list_lwm'
+SET GLOBAL innodb_cleaner_free_list_lwm='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_free_list_lwm'
+SET GLOBAL innodb_cleaner_free_list_lwm = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_cleaner_lru_chunk_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_cleaner_lru_chunk_size_basic.result
new file mode 100644
index 00000000000..5dfc6738e11
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_cleaner_lru_chunk_size_basic.result
@@ -0,0 +1,31 @@
+SET @start_value = @@GLOBAL.innodb_cleaner_lru_chunk_size;
+SELECT @@GLOBAL.innodb_cleaner_lru_chunk_size;
+@@GLOBAL.innodb_cleaner_lru_chunk_size
+100
+SELECT @@SESSION.innodb_cleaner_lru_chunk_size;
+ERROR HY000: Variable 'innodb_cleaner_lru_chunk_size' is a GLOBAL variable
+SET GLOBAL innodb_cleaner_lru_chunk_size=1;
+SELECT @@GLOBAL.innodb_cleaner_lru_chunk_size;
+@@GLOBAL.innodb_cleaner_lru_chunk_size
+1
+SET GLOBAL innodb_cleaner_lru_chunk_size=1000;
+SELECT @@GLOBAL.innodb_cleaner_lru_chunk_size;
+@@GLOBAL.innodb_cleaner_lru_chunk_size
+1000
+SET GLOBAL innodb_cleaner_lru_chunk_size=4294967295;
+SELECT @@GLOBAL.innodb_cleaner_lru_chunk_size;
+@@GLOBAL.innodb_cleaner_lru_chunk_size
+4294967295
+SET GLOBAL innodb_cleaner_lru_chunk_size=0;
+Warnings:
+Warning 1292 Truncated incorrect innodb_cleaner_lru_chunk_size value: '0'
+SELECT @@GLOBAL.innodb_cleaner_lru_chunk_size;
+@@GLOBAL.innodb_cleaner_lru_chunk_size
+1
+SET GLOBAL innodb_cleaner_lru_chunk_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_lru_chunk_size'
+SET GLOBAL innodb_cleaner_lru_chunk_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_lru_chunk_size'
+SET GLOBAL innodb_cleaner_lru_chunk_size='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_lru_chunk_size'
+SET GLOBAL innodb_cleaner_lru_chunk_size = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result b/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result
new file mode 100644
index 00000000000..6dd1b6dc489
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result
@@ -0,0 +1,21 @@
+SET @start_value = @@GLOBAL.innodb_cleaner_lsn_age_factor;
+SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
+@@GLOBAL.innodb_cleaner_lsn_age_factor
+high_checkpoint
+SELECT @@SESSION.innodb_cleaner_lsn_age_factor;
+ERROR HY000: Variable 'innodb_cleaner_lsn_age_factor' is a GLOBAL variable
+SET GLOBAL innodb_cleaner_lsn_age_factor='legacy';
+SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
+@@GLOBAL.innodb_cleaner_lsn_age_factor
+legacy
+SET GLOBAL innodb_cleaner_lsn_age_factor='high_checkpoint';
+SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
+@@GLOBAL.innodb_cleaner_lsn_age_factor
+high_checkpoint
+SET GLOBAL innodb_cleaner_lsn_age_factor=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_lsn_age_factor'
+SET GLOBAL innodb_cleaner_lsn_age_factor=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_lsn_age_factor'
+SET GLOBAL innodb_cleaner_lsn_age_factor='foo';
+ERROR 42000: Variable 'innodb_cleaner_lsn_age_factor' can't be set to the value of 'foo'
+SET GLOBAL innodb_cleaner_lsn_age_factor = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_cleaner_max_flush_time_basic.result b/mysql-test/suite/sys_vars/r/innodb_cleaner_max_flush_time_basic.result
new file mode 100644
index 00000000000..e4a3fa26e73
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_cleaner_max_flush_time_basic.result
@@ -0,0 +1,25 @@
+SET @start_value = @@GLOBAL.innodb_cleaner_max_flush_time;
+SELECT @@GLOBAL.innodb_cleaner_max_flush_time;
+@@GLOBAL.innodb_cleaner_max_flush_time
+1000
+SELECT @@SESSION.innodb_cleaner_max_flush_time;
+ERROR HY000: Variable 'innodb_cleaner_max_flush_time' is a GLOBAL variable
+SET GLOBAL innodb_cleaner_max_flush_time=0;
+SELECT @@GLOBAL.innodb_cleaner_max_flush_time;
+@@GLOBAL.innodb_cleaner_max_flush_time
+0
+SET GLOBAL innodb_cleaner_max_flush_time=1000;
+SELECT @@GLOBAL.innodb_cleaner_max_flush_time;
+@@GLOBAL.innodb_cleaner_max_flush_time
+1000
+SET GLOBAL innodb_cleaner_max_flush_time=4294967295;
+SELECT @@GLOBAL.innodb_cleaner_max_flush_time;
+@@GLOBAL.innodb_cleaner_max_flush_time
+4294967295
+SET GLOBAL innodb_cleaner_max_flush_time=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_max_flush_time'
+SET GLOBAL innodb_cleaner_max_flush_time=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_max_flush_time'
+SET GLOBAL innodb_cleaner_max_flush_time='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_max_flush_time'
+SET GLOBAL innodb_cleaner_max_flush_time = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_cleaner_max_lru_time_basic.result b/mysql-test/suite/sys_vars/r/innodb_cleaner_max_lru_time_basic.result
new file mode 100644
index 00000000000..f7bacbbd62e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_cleaner_max_lru_time_basic.result
@@ -0,0 +1,25 @@
+SET @start_value = @@GLOBAL.innodb_cleaner_max_lru_time;
+SELECT @@GLOBAL.innodb_cleaner_max_lru_time;
+@@GLOBAL.innodb_cleaner_max_lru_time
+1000
+SELECT @@SESSION.innodb_cleaner_max_lru_time;
+ERROR HY000: Variable 'innodb_cleaner_max_lru_time' is a GLOBAL variable
+SET GLOBAL innodb_cleaner_max_lru_time=0;
+SELECT @@GLOBAL.innodb_cleaner_max_lru_time;
+@@GLOBAL.innodb_cleaner_max_lru_time
+0
+SET GLOBAL innodb_cleaner_max_lru_time=1000;
+SELECT @@GLOBAL.innodb_cleaner_max_lru_time;
+@@GLOBAL.innodb_cleaner_max_lru_time
+1000
+SET GLOBAL innodb_cleaner_max_lru_time=4294967295;
+SELECT @@GLOBAL.innodb_cleaner_max_lru_time;
+@@GLOBAL.innodb_cleaner_max_lru_time
+4294967295
+SET GLOBAL innodb_cleaner_max_lru_time=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_max_lru_time'
+SET GLOBAL innodb_cleaner_max_lru_time=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_max_lru_time'
+SET GLOBAL innodb_cleaner_max_lru_time='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_max_lru_time'
+SET GLOBAL innodb_cleaner_max_lru_time = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_cmp_per_index_enabled_basic.result b/mysql-test/suite/sys_vars/r/innodb_cmp_per_index_enabled_basic.result
new file mode 100644
index 00000000000..3ee9448bdab
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_cmp_per_index_enabled_basic.result
@@ -0,0 +1,65 @@
+SELECT @@global.innodb_cmp_per_index_enabled;
+@@global.innodb_cmp_per_index_enabled
+0
+SET GLOBAL innodb_stats_persistent=123;
+ERROR 42000: Variable 'innodb_stats_persistent' can't be set to the value of '123'
+SET GLOBAL innodb_stats_persistent='foo';
+ERROR 42000: Variable 'innodb_stats_persistent' can't be set to the value of 'foo'
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+SELECT @@global.innodb_cmp_per_index_enabled;
+@@global.innodb_cmp_per_index_enabled
+1
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+SELECT @@global.innodb_cmp_per_index_enabled;
+@@global.innodb_cmp_per_index_enabled
+1
+SET GLOBAL innodb_cmp_per_index_enabled=OFF;
+SELECT @@global.innodb_cmp_per_index_enabled;
+@@global.innodb_cmp_per_index_enabled
+0
+SET GLOBAL innodb_cmp_per_index_enabled=OFF;
+SELECT @@global.innodb_cmp_per_index_enabled;
+@@global.innodb_cmp_per_index_enabled
+0
+SET GLOBAL innodb_file_format=Barracuda;
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+CREATE TABLE t (a INT) ENGINE=INNODB KEY_BLOCK_SIZE=8;
+INSERT INTO t VALUES (1);
+SELECT * FROM information_schema.innodb_cmp_per_index;
+database_name test
+table_name t
+index_name GEN_CLUST_INDEX
+compress_ops 1
+compress_ops_ok 1
+compress_time 0
+uncompress_ops 0
+uncompress_time 0
+SET GLOBAL innodb_cmp_per_index_enabled=OFF;
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+SELECT * FROM information_schema.innodb_cmp_per_index;
+DROP TABLE t;
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+CREATE TABLE t (a INT) ENGINE=INNODB KEY_BLOCK_SIZE=8;
+INSERT INTO t VALUES (1);
+SELECT * FROM information_schema.innodb_cmp_per_index;
+database_name test
+table_name t
+index_name GEN_CLUST_INDEX
+compress_ops 1
+compress_ops_ok 1
+compress_time 0
+uncompress_ops 0
+uncompress_time 0
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+SELECT * FROM information_schema.innodb_cmp_per_index;
+database_name test
+table_name t
+index_name GEN_CLUST_INDEX
+compress_ops 1
+compress_ops_ok 1
+compress_time 0
+uncompress_ops 0
+uncompress_time 0
+DROP TABLE t;
+SET GLOBAL innodb_file_format=default;
+SET GLOBAL innodb_cmp_per_index_enabled=default;
diff --git a/mysql-test/suite/sys_vars/r/innodb_compression_failure_threshold_pct_basic.result b/mysql-test/suite/sys_vars/r/innodb_compression_failure_threshold_pct_basic.result
new file mode 100644
index 00000000000..9f85eccdb7a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_compression_failure_threshold_pct_basic.result
@@ -0,0 +1,96 @@
+SET @global_start_value = @@global.innodb_compression_failure_threshold_pct;
+SELECT @global_start_value;
+@global_start_value
+5
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_compression_failure_threshold_pct = 0;
+SET @@global.innodb_compression_failure_threshold_pct = DEFAULT;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+5
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_compression_failure_threshold_pct = 1;
+ERROR HY000: Variable 'innodb_compression_failure_threshold_pct' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_compression_failure_threshold_pct;
+@@innodb_compression_failure_threshold_pct
+5
+SELECT local.innodb_compression_failure_threshold_pct;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_compression_failure_threshold_pct = 0;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+0
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_compression_failure_threshold_pct = 0;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+0
+SET @@global.innodb_compression_failure_threshold_pct = 1;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+1
+SET @@global.innodb_compression_failure_threshold_pct = 100;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+100
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_compression_failure_threshold_pct = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_compression_failure_thres value: '-1'
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+0
+SET @@global.innodb_compression_failure_threshold_pct = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_failure_threshold_pct'
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+0
+SET @@global.innodb_compression_failure_threshold_pct = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_failure_threshold_pct'
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+0
+SET @@global.innodb_compression_failure_threshold_pct = 101;
+Warnings:
+Warning 1292 Truncated incorrect innodb_compression_failure_thres value: '101'
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+100
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_compression_failure_threshold_pct =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_compression_failure_threshold_pct';
+@@global.innodb_compression_failure_threshold_pct =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+100
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_compression_failure_threshold_pct';
+VARIABLE_VALUE
+100
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_compression_failure_threshold_pct = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_failure_threshold_pct'
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+100
+SET @@global.innodb_compression_failure_threshold_pct = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_failure_threshold_pct'
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+100
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_compression_failure_threshold_pct = TRUE;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+1
+SET @@global.innodb_compression_failure_threshold_pct = FALSE;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+0
+SET @@global.innodb_compression_failure_threshold_pct = @global_start_value;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+@@global.innodb_compression_failure_threshold_pct
+5
diff --git a/mysql-test/suite/sys_vars/r/innodb_compression_level_basic.result b/mysql-test/suite/sys_vars/r/innodb_compression_level_basic.result
new file mode 100644
index 00000000000..b9d1a2e4953
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_compression_level_basic.result
@@ -0,0 +1,73 @@
+SET @start_global_value = @@global.innodb_compression_level;
+SELECT @start_global_value;
+@start_global_value
+6
+Valid value 0-9
+select @@global.innodb_compression_level <= 9;
+@@global.innodb_compression_level <= 9
+1
+select @@global.innodb_compression_level;
+@@global.innodb_compression_level
+6
+select @@session.innodb_compression_level;
+ERROR HY000: Variable 'innodb_compression_level' is a GLOBAL variable
+show global variables like 'innodb_compression_level';
+Variable_name Value
+innodb_compression_level 6
+show session variables like 'innodb_compression_level';
+Variable_name Value
+innodb_compression_level 6
+select * from information_schema.global_variables where variable_name='innodb_compression_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_COMPRESSION_LEVEL 6
+select * from information_schema.session_variables where variable_name='innodb_compression_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_COMPRESSION_LEVEL 6
+set global innodb_compression_level=2;
+select @@global.innodb_compression_level;
+@@global.innodb_compression_level
+2
+select * from information_schema.global_variables where variable_name='innodb_compression_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_COMPRESSION_LEVEL 2
+select * from information_schema.session_variables where variable_name='innodb_compression_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_COMPRESSION_LEVEL 2
+set session innodb_compression_level=4;
+ERROR HY000: Variable 'innodb_compression_level' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_compression_level=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_level'
+set global innodb_compression_level=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_level'
+set global innodb_compression_level="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_level'
+set global innodb_compression_level=10;
+Warnings:
+Warning 1292 Truncated incorrect innodb_compression_level value: '10'
+select @@global.innodb_compression_level;
+@@global.innodb_compression_level
+9
+select * from information_schema.global_variables where variable_name='innodb_compression_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_COMPRESSION_LEVEL 9
+set global innodb_compression_level=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_compression_level value: '-7'
+select @@global.innodb_compression_level;
+@@global.innodb_compression_level
+0
+select * from information_schema.global_variables where variable_name='innodb_compression_level';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_COMPRESSION_LEVEL 0
+set global innodb_compression_level=0;
+select @@global.innodb_compression_level;
+@@global.innodb_compression_level
+0
+set global innodb_compression_level=9;
+select @@global.innodb_compression_level;
+@@global.innodb_compression_level
+9
+SET @@global.innodb_compression_level = @start_global_value;
+SELECT @@global.innodb_compression_level;
+@@global.innodb_compression_level
+6
diff --git a/mysql-test/suite/sys_vars/r/innodb_compression_pad_pct_max_basic.result b/mysql-test/suite/sys_vars/r/innodb_compression_pad_pct_max_basic.result
new file mode 100644
index 00000000000..628993ef873
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_compression_pad_pct_max_basic.result
@@ -0,0 +1,86 @@
+SET @global_start_value = @@global.innodb_compression_pad_pct_max;
+SELECT @global_start_value;
+@global_start_value
+50
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_compression_pad_pct_max = DEFAULT;
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+50
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_compression_pad_pct_max = 1;
+ERROR HY000: Variable 'innodb_compression_pad_pct_max' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_compression_pad_pct_max;
+@@innodb_compression_pad_pct_max
+50
+SELECT local.innodb_compression_pad_pct_max;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_compression_pad_pct_max = 0;
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+0
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_compression_pad_pct_max = 0;
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+0
+SET @@global.innodb_compression_pad_pct_max = 75;
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+75
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_compression_pad_pct_max = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_compression_pad_pct_max value: '-1'
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+0
+SET @@global.innodb_compression_pad_pct_max = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_pad_pct_max'
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+0
+SET @@global.innodb_compression_pad_pct_max = 76;
+Warnings:
+Warning 1292 Truncated incorrect innodb_compression_pad_pct_max value: '76'
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+75
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_compression_pad_pct_max =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_compression_pad_pct_max';
+@@global.innodb_compression_pad_pct_max =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+75
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_compression_pad_pct_max';
+VARIABLE_VALUE
+75
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_compression_pad_pct_max = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_pad_pct_max'
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+75
+SET @@global.innodb_compression_pad_pct_max = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_compression_pad_pct_max'
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+75
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_compression_pad_pct_max = TRUE;
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+1
+SET @@global.innodb_compression_pad_pct_max = FALSE;
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+0
+SET @@global.innodb_compression_pad_pct_max = @global_start_value;
+SELECT @@global.innodb_compression_pad_pct_max;
+@@global.innodb_compression_pad_pct_max
+50
diff --git a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result
index cd27de0cb0b..0b790fb3557 100644
--- a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic.result
@@ -1,7 +1,7 @@
SET @global_start_value = @@global.innodb_concurrency_tickets;
SELECT @global_start_value;
@global_start_value
-500
+5000
'#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_concurrency_tickets = 0;
Warnings:
@@ -9,13 +9,13 @@ Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0'
SET @@global.innodb_concurrency_tickets = DEFAULT;
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-500
+5000
'#---------------------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
+5000
SELECT local.innodb_concurrency_tickets;
ERROR 42S02: Unknown table 'local' in field list
SET global innodb_concurrency_tickets = 0;
@@ -97,4 +97,4 @@ SELECT @@global.innodb_concurrency_tickets;
SET @@global.innodb_concurrency_tickets = @global_start_value;
SELECT @@global.innodb_concurrency_tickets;
@@global.innodb_concurrency_tickets
-500
+5000
diff --git a/mysql-test/suite/sys_vars/r/innodb_disable_background_merge_basic.result b/mysql-test/suite/sys_vars/r/innodb_disable_background_merge_basic.result
new file mode 100644
index 00000000000..c4bf621a33d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_disable_background_merge_basic.result
@@ -0,0 +1,4 @@
+SET @orig = @@global.innodb_disable_background_merge;
+SELECT @orig;
+@orig
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_disable_sort_file_cache_basic.result b/mysql-test/suite/sys_vars/r/innodb_disable_sort_file_cache_basic.result
new file mode 100644
index 00000000000..ed5f9415861
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_disable_sort_file_cache_basic.result
@@ -0,0 +1,92 @@
+SET @start_global_value = @@global.innodb_disable_sort_file_cache;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_disable_sort_file_cache in (0, 1);
+@@global.innodb_disable_sort_file_cache in (0, 1)
+1
+select @@global.innodb_disable_sort_file_cache;
+@@global.innodb_disable_sort_file_cache
+0
+select @@session.innodb_disable_sort_file_cache;
+ERROR HY000: Variable 'innodb_disable_sort_file_cache' is a GLOBAL variable
+show global variables like 'innodb_disable_sort_file_cache';
+Variable_name Value
+innodb_disable_sort_file_cache OFF
+show session variables like 'innodb_disable_sort_file_cache';
+Variable_name Value
+innodb_disable_sort_file_cache OFF
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE OFF
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE OFF
+set global innodb_disable_sort_file_cache='OFF';
+select @@global.innodb_disable_sort_file_cache;
+@@global.innodb_disable_sort_file_cache
+0
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE OFF
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE OFF
+set @@global.innodb_disable_sort_file_cache=1;
+select @@global.innodb_disable_sort_file_cache;
+@@global.innodb_disable_sort_file_cache
+1
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE ON
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE ON
+set global innodb_disable_sort_file_cache=0;
+select @@global.innodb_disable_sort_file_cache;
+@@global.innodb_disable_sort_file_cache
+0
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE OFF
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE OFF
+set @@global.innodb_disable_sort_file_cache='ON';
+select @@global.innodb_disable_sort_file_cache;
+@@global.innodb_disable_sort_file_cache
+1
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE ON
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE ON
+set session innodb_disable_sort_file_cache='OFF';
+ERROR HY000: Variable 'innodb_disable_sort_file_cache' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_disable_sort_file_cache='ON';
+ERROR HY000: Variable 'innodb_disable_sort_file_cache' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_disable_sort_file_cache=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_disable_sort_file_cache'
+set global innodb_disable_sort_file_cache=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_disable_sort_file_cache'
+set global innodb_disable_sort_file_cache=2;
+ERROR 42000: Variable 'innodb_disable_sort_file_cache' can't be set to the value of '2'
+set global innodb_disable_sort_file_cache=-3;
+ERROR 42000: Variable 'innodb_disable_sort_file_cache' can't be set to the value of '-3'
+select @@global.innodb_disable_sort_file_cache;
+@@global.innodb_disable_sort_file_cache
+1
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE ON
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DISABLE_SORT_FILE_CACHE ON
+set global innodb_disable_sort_file_cache='AUTO';
+ERROR 42000: Variable 'innodb_disable_sort_file_cache' can't be set to the value of 'AUTO'
+SET @@global.innodb_disable_sort_file_cache = @start_global_value;
+SELECT @@global.innodb_disable_sort_file_cache;
+@@global.innodb_disable_sort_file_cache
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_doublewrite_batch_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_doublewrite_batch_size_basic.result
new file mode 100644
index 00000000000..cec90ea8950
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_doublewrite_batch_size_basic.result
@@ -0,0 +1,24 @@
+select @@global.innodb_doublewrite_batch_size between 1 and 127;
+@@global.innodb_doublewrite_batch_size between 1 and 127
+1
+select @@global.innodb_doublewrite_batch_size;
+@@global.innodb_doublewrite_batch_size
+120
+select @@session.innodb_doublewrite_batch_size;
+ERROR HY000: Variable 'innodb_doublewrite_batch_size' is a GLOBAL variable
+show global variables like 'innodb_doublewrite_batch_size';
+Variable_name Value
+innodb_doublewrite_batch_size 120
+show session variables like 'innodb_doublewrite_batch_size';
+Variable_name Value
+innodb_doublewrite_batch_size 120
+select * from information_schema.global_variables where variable_name='innodb_doublewrite_batch_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DOUBLEWRITE_BATCH_SIZE 120
+select * from information_schema.session_variables where variable_name='innodb_doublewrite_batch_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_DOUBLEWRITE_BATCH_SIZE 120
+set global innodb_doublewrite_batch_size=1;
+ERROR HY000: Variable 'innodb_doublewrite_batch_size' is a read only variable
+set @@session.innodb_doublewrite_batch_size='some';
+ERROR HY000: Variable 'innodb_doublewrite_batch_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result b/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result
new file mode 100644
index 00000000000..f95553e3fa2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_empty_free_list_algorithm_basic.result
@@ -0,0 +1,23 @@
+SET @start_value = @@GLOBAL.innodb_empty_free_list_algorithm;
+SELECT @@GLOBAL.innodb_empty_free_list_algorithm;
+@@GLOBAL.innodb_empty_free_list_algorithm
+backoff
+SELECT @@SESSION.innodb_empty_free_list_algorithm;
+ERROR HY000: Variable 'innodb_empty_free_list_algorithm' is a GLOBAL variable
+SET GLOBAL innodb_empty_free_list_algorithm='legacy';
+SELECT @@GLOBAL.innodb_empty_free_list_algorithm;
+@@GLOBAL.innodb_empty_free_list_algorithm
+legacy
+SET GLOBAL innodb_empty_free_list_algorithm='backoff';
+SELECT @@GLOBAL.innodb_empty_free_list_algorithm;
+@@GLOBAL.innodb_empty_free_list_algorithm
+backoff
+SET GLOBAL innodb_empty_free_list_algorithm=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_empty_free_list_algorithm'
+SET GLOBAL innodb_empty_free_list_algorithm=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_empty_free_list_algorithm'
+SET GLOBAL innodb_empty_free_list_algorithm=2;
+ERROR 42000: Variable 'innodb_empty_free_list_algorithm' can't be set to the value of '2'
+SET GLOBAL innodb_empty_free_list_algorithm='foo';
+ERROR 42000: Variable 'innodb_empty_free_list_algorithm' can't be set to the value of 'foo'
+SET GLOBAL innodb_empty_free_list_algorithm = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result
new file mode 100644
index 00000000000..abf2cdaf1c4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result
@@ -0,0 +1,26 @@
+#
+# Basic test for innodb_fil_make_page_dirty_debug.
+#
+SELECT @@global.innodb_fil_make_page_dirty_debug;
+@@global.innodb_fil_make_page_dirty_debug
+0
+set global innodb_fil_make_page_dirty_debug = 0;
+SELECT @@global.innodb_fil_make_page_dirty_debug;
+@@global.innodb_fil_make_page_dirty_debug
+0
+set global innodb_fil_make_page_dirty_debug = 0;
+set global innodb_fil_make_page_dirty_debug = dummy;
+ERROR 42000: Incorrect argument type to variable 'innodb_fil_make_page_dirty_debug'
+set innodb_fil_make_page_dirty_debug = ON;
+ERROR HY000: Variable 'innodb_fil_make_page_dirty_debug' is a GLOBAL variable and should be set with SET GLOBAL
+# An example usage.
+create table t1 (f1 int primary key) engine = innodb;
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+drop table t1;
+# Must always be 0.
+SELECT @@global.innodb_fil_make_page_dirty_debug;
+@@global.innodb_fil_make_page_dirty_debug
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
index ecf11351cd9..9780357e69f 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
@@ -1,7 +1,7 @@
SET @start_global_value = @@global.innodb_file_per_table;
SELECT @start_global_value;
@start_global_value
-0
+1
'#---------------------BS_STVARS_028_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_file_per_table);
COUNT(@@GLOBAL.innodb_file_per_table)
@@ -66,4 +66,4 @@ ERROR 42S22: Unknown column 'innodb_file_per_table' in 'field list'
SET @@global.innodb_file_per_table = @start_global_value;
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
-0
+1
diff --git a/mysql-test/suite/sys_vars/r/innodb_flush_log_at_timeout_basic.result b/mysql-test/suite/sys_vars/r/innodb_flush_log_at_timeout_basic.result
new file mode 100644
index 00000000000..60a4081849f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_flush_log_at_timeout_basic.result
@@ -0,0 +1,96 @@
+SET @global_start_value = @@global.innodb_flush_log_at_timeout;
+SELECT @global_start_value;
+@global_start_value
+1
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_flush_log_at_timeout = 0;
+SET @@global.innodb_flush_log_at_timeout = DEFAULT;
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+1
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_flush_log_at_timeout = 1;
+ERROR HY000: Variable 'innodb_flush_log_at_timeout' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_flush_log_at_timeout;
+@@innodb_flush_log_at_timeout
+1
+SELECT local.innodb_flush_log_at_timeout;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_flush_log_at_timeout = 0;
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+0
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_flush_log_at_timeout = 0;
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+0
+SET @@global.innodb_flush_log_at_timeout = 10;
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+10
+SET @@global.innodb_flush_log_at_timeout = 2700;
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+2700
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_flush_log_at_timeout = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_flush_log_at_timeout value: '-1'
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+0
+SET @@global.innodb_flush_log_at_timeout = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_log_at_timeout'
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+0
+SET @@global.innodb_flush_log_at_timeout = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_log_at_timeout'
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+0
+SET @@global.innodb_flush_log_at_timeout = 2701;
+Warnings:
+Warning 1292 Truncated incorrect innodb_flush_log_at_timeout value: '2701'
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+2700
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_flush_log_at_timeout =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_flush_log_at_timeout';
+@@global.innodb_flush_log_at_timeout =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+2700
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_flush_log_at_timeout';
+VARIABLE_VALUE
+2700
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_flush_log_at_timeout = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_log_at_timeout'
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+2700
+SET @@global.innodb_flush_log_at_timeout = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_log_at_timeout'
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+2700
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_flush_log_at_timeout = TRUE;
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+1
+SET @@global.innodb_flush_log_at_timeout = FALSE;
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+0
+SET @@global.innodb_flush_log_at_timeout = @global_start_value;
+SELECT @@global.innodb_flush_log_at_timeout;
+@@global.innodb_flush_log_at_timeout
+1
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 441fb4cd362..268d40c1be3 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
@@ -50,7 +50,7 @@ Warnings:
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
+3
'#----------------------FN_DYNVARS_046_05------------------------#'
SELECT @@global.innodb_flush_log_at_trx_commit =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -60,22 +60,22 @@ VARIABLE_VALUE
1
SELECT @@global.innodb_flush_log_at_trx_commit;
@@global.innodb_flush_log_at_trx_commit
-2
+3
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_flush_log_at_trx_commit';
VARIABLE_VALUE
-2
+3
'#---------------------FN_DYNVARS_046_06-------------------------#'
SET @@global.innodb_flush_log_at_trx_commit = OFF;
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
+3
SET @@global.innodb_flush_log_at_trx_commit = ON;
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
+3
'#---------------------FN_DYNVARS_046_07----------------------#'
SET @@global.innodb_flush_log_at_trx_commit = TRUE;
SELECT @@global.innodb_flush_log_at_trx_commit;
diff --git a/mysql-test/suite/sys_vars/r/innodb_flush_neighbors_basic.result b/mysql-test/suite/sys_vars/r/innodb_flush_neighbors_basic.result
new file mode 100644
index 00000000000..167c613135d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_flush_neighbors_basic.result
@@ -0,0 +1,101 @@
+SET @start_global_value = @@global.innodb_flush_neighbors;
+SELECT @start_global_value;
+@start_global_value
+1
+select @@global.innodb_flush_neighbors;
+@@global.innodb_flush_neighbors
+1
+select @@session.innodb_flush_neighbors;
+ERROR HY000: Variable 'innodb_flush_neighbors' is a GLOBAL variable
+show global variables like 'innodb_flush_neighbors';
+Variable_name Value
+innodb_flush_neighbors 1
+show session variables like 'innodb_flush_neighbors';
+Variable_name Value
+innodb_flush_neighbors 1
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 1
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 1
+set global innodb_flush_neighbors=0;
+select @@global.innodb_flush_neighbors;
+@@global.innodb_flush_neighbors
+0
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 0
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 0
+set @@global.innodb_flush_neighbors=TRUE;
+select @@global.innodb_flush_neighbors;
+@@global.innodb_flush_neighbors
+1
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 1
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 1
+set global innodb_flush_neighbors=0;
+select @@global.innodb_flush_neighbors;
+@@global.innodb_flush_neighbors
+0
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 0
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 0
+set @@global.innodb_flush_neighbors=2;
+select @@global.innodb_flush_neighbors;
+@@global.innodb_flush_neighbors
+2
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 2
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 2
+set @@global.innodb_flush_neighbors=DEFAULT;
+select @@global.innodb_flush_neighbors;
+@@global.innodb_flush_neighbors
+1
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 1
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FLUSH_NEIGHBORS 1
+set session innodb_flush_neighbors=0;
+ERROR HY000: Variable 'innodb_flush_neighbors' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_flush_neighbors=1;
+ERROR HY000: Variable 'innodb_flush_neighbors' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_flush_neighbors='OFF';
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_neighbors'
+set global innodb_flush_neighbors='ON';
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_neighbors'
+set global innodb_flush_neighbors=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_neighbors'
+set global innodb_flush_neighbors=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_neighbors'
+set global innodb_flush_neighbors=3;
+Warnings:
+Warning 1292 Truncated incorrect innodb_flush_neighbors value: '3'
+select @@global.innodb_flush_neighbors;
+@@global.innodb_flush_neighbors
+2
+set global innodb_flush_neighbors=-3;
+Warnings:
+Warning 1292 Truncated incorrect innodb_flush_neighbors value: '-3'
+select @@global.innodb_flush_neighbors;
+@@global.innodb_flush_neighbors
+0
+set global innodb_flush_neighbors='AUTO';
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_neighbors'
+SET @@global.innodb_flush_neighbors = @start_global_value;
+SELECT @@global.innodb_flush_neighbors;
+@@global.innodb_flush_neighbors
+1
diff --git a/mysql-test/suite/sys_vars/r/innodb_flushing_avg_loops_basic.result b/mysql-test/suite/sys_vars/r/innodb_flushing_avg_loops_basic.result
new file mode 100644
index 00000000000..caa41bd64ed
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_flushing_avg_loops_basic.result
@@ -0,0 +1,98 @@
+SET @global_start_value = @@global.innodb_flushing_avg_loops;
+SELECT @global_start_value;
+@global_start_value
+30
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_flushing_avg_loops = 1;
+SET @@global.innodb_flushing_avg_loops = DEFAULT;
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+30
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_flushing_avg_loops = 1;
+ERROR HY000: Variable 'innodb_flushing_avg_loops' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_flushing_avg_loops;
+@@innodb_flushing_avg_loops
+30
+SELECT local.innodb_flushing_avg_loops;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_flushing_avg_loops = 1;
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_flushing_avg_loops = 1;
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1
+SET @@global.innodb_flushing_avg_loops = 60;
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+60
+SET @@global.innodb_flushing_avg_loops = 1000;
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1000
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_flushing_avg_loops = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_flushing_avg_loops value: '-1'
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1
+SET @@global.innodb_flushing_avg_loops = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_flushing_avg_loops'
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1
+SET @@global.innodb_flushing_avg_loops = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_flushing_avg_loops'
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1
+SET @@global.innodb_flushing_avg_loops = 1001;
+Warnings:
+Warning 1292 Truncated incorrect innodb_flushing_avg_loops value: '1001'
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1000
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_flushing_avg_loops =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_flushing_avg_loops';
+@@global.innodb_flushing_avg_loops =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1000
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_flushing_avg_loops';
+VARIABLE_VALUE
+1000
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_flushing_avg_loops = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_flushing_avg_loops'
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1000
+SET @@global.innodb_flushing_avg_loops = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_flushing_avg_loops'
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1000
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_flushing_avg_loops = TRUE;
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1
+SET @@global.innodb_flushing_avg_loops = FALSE;
+Warnings:
+Warning 1292 Truncated incorrect innodb_flushing_avg_loops value: '0'
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+1
+SET @@global.innodb_flushing_avg_loops = @global_start_value;
+SELECT @@global.innodb_flushing_avg_loops;
+@@global.innodb_flushing_avg_loops
+30
diff --git a/mysql-test/suite/sys_vars/r/innodb_foreground_preflush_basic.result b/mysql-test/suite/sys_vars/r/innodb_foreground_preflush_basic.result
new file mode 100644
index 00000000000..4ad0ce8d78e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_foreground_preflush_basic.result
@@ -0,0 +1,23 @@
+SET @start_value = @@GLOBAL.innodb_foreground_preflush;
+SELECT @@GLOBAL.innodb_foreground_preflush;
+@@GLOBAL.innodb_foreground_preflush
+exponential_backoff
+SELECT @@SESSION.innodb_foreground_preflush;
+ERROR HY000: Variable 'innodb_foreground_preflush' is a GLOBAL variable
+SET GLOBAL innodb_foreground_preflush='sync_preflush';
+SELECT @@GLOBAL.innodb_foreground_preflush;
+@@GLOBAL.innodb_foreground_preflush
+sync_preflush
+SET GLOBAL innodb_foreground_preflush='exponential_backoff';
+SELECT @@GLOBAL.innodb_foreground_preflush;
+@@GLOBAL.innodb_foreground_preflush
+exponential_backoff
+SET GLOBAL innodb_foreground_preflush=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_foreground_preflush'
+SET GLOBAL innodb_foreground_preflush=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_foreground_preflush'
+SET GLOBAL innodb_foreground_preflush=2;
+ERROR 42000: Variable 'innodb_foreground_preflush' can't be set to the value of '2'
+SET GLOBAL innodb_foreground_preflush='foo';
+ERROR 42000: Variable 'innodb_foreground_preflush' can't be set to the value of 'foo'
+SET GLOBAL innodb_foreground_preflush = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_aux_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_aux_table_basic.result
new file mode 100644
index 00000000000..780c6920456
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_aux_table_basic.result
@@ -0,0 +1,32 @@
+SET @start_global_value = @@global.innodb_ft_aux_table;
+SELECT @start_global_value;
+@start_global_value
+NULL
+select @@session.innodb_ft_aux_table;
+ERROR HY000: Variable 'innodb_ft_aux_table' is a GLOBAL variable
+show global variables like 'innodb_ft_aux_table';
+Variable_name Value
+innodb_ft_aux_table
+show session variables like 'innodb_ft_aux_table';
+Variable_name Value
+innodb_ft_aux_table
+select * from information_schema.global_variables where variable_name='innodb_ft_aux_table';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_AUX_TABLE
+select * from information_schema.session_variables where variable_name='innodb_ft_aux_table';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_AUX_TABLE
+set session innodb_ft_aux_table='Salmon';
+ERROR HY000: Variable 'innodb_ft_aux_table' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_ft_aux_table='Salmon';
+ERROR HY000: Variable 'innodb_ft_aux_table' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_ft_aux_table=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_aux_table'
+set global innodb_ft_aux_table=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_aux_table'
+set global innodb_ft_aux_table='Salmon';
+ERROR 42000: Variable 'innodb_ft_aux_table' can't be set to the value of 'Salmon'
+SET @@global.innodb_ft_aux_table = @start_global_value;
+SELECT @@global.innodb_ft_aux_table;
+@@global.innodb_ft_aux_table
+NULL
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_cache_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_cache_size_basic.result
new file mode 100644
index 00000000000..f50b6d4180c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_cache_size_basic.result
@@ -0,0 +1,21 @@
+select @@global.innodb_ft_cache_size;
+@@global.innodb_ft_cache_size
+8000000
+select @@session.innodb_ft_cache_size;
+ERROR HY000: Variable 'innodb_ft_cache_size' is a GLOBAL variable
+show global variables like 'innodb_ft_cache_size';
+Variable_name Value
+innodb_ft_cache_size 8000000
+show session variables like 'innodb_ft_cache_size';
+Variable_name Value
+innodb_ft_cache_size 8000000
+select * from information_schema.global_variables where variable_name='innodb_ft_cache_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_CACHE_SIZE 8000000
+select * from information_schema.session_variables where variable_name='innodb_ft_cache_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_CACHE_SIZE 8000000
+set global innodb_ft_cache_size=1;
+ERROR HY000: Variable 'innodb_ft_cache_size' is a read only variable
+set session innodb_ft_cache_size=1;
+ERROR HY000: Variable 'innodb_ft_cache_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_enable_diag_print_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_enable_diag_print_basic.result
new file mode 100644
index 00000000000..5401e26d8a5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_enable_diag_print_basic.result
@@ -0,0 +1,92 @@
+SET @start_global_value = @@global.innodb_ft_enable_diag_print;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_ft_enable_diag_print in (0, 1);
+@@global.innodb_ft_enable_diag_print in (0, 1)
+1
+select @@global.innodb_ft_enable_diag_print;
+@@global.innodb_ft_enable_diag_print
+0
+select @@session.innodb_ft_enable_diag_print;
+ERROR HY000: Variable 'innodb_ft_enable_diag_print' is a GLOBAL variable
+show global variables like 'innodb_ft_enable_diag_print';
+Variable_name Value
+innodb_ft_enable_diag_print OFF
+show session variables like 'innodb_ft_enable_diag_print';
+Variable_name Value
+innodb_ft_enable_diag_print OFF
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT OFF
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT OFF
+set global innodb_ft_enable_diag_print='OFF';
+select @@global.innodb_ft_enable_diag_print;
+@@global.innodb_ft_enable_diag_print
+0
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT OFF
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT OFF
+set @@global.innodb_ft_enable_diag_print=1;
+select @@global.innodb_ft_enable_diag_print;
+@@global.innodb_ft_enable_diag_print
+1
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT ON
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT ON
+set global innodb_ft_enable_diag_print=0;
+select @@global.innodb_ft_enable_diag_print;
+@@global.innodb_ft_enable_diag_print
+0
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT OFF
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT OFF
+set @@global.innodb_ft_enable_diag_print='ON';
+select @@global.innodb_ft_enable_diag_print;
+@@global.innodb_ft_enable_diag_print
+1
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT ON
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT ON
+set session innodb_ft_enable_diag_print='OFF';
+ERROR HY000: Variable 'innodb_ft_enable_diag_print' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_ft_enable_diag_print='ON';
+ERROR HY000: Variable 'innodb_ft_enable_diag_print' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_ft_enable_diag_print=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_enable_diag_print'
+set global innodb_ft_enable_diag_print=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_enable_diag_print'
+set global innodb_ft_enable_diag_print=2;
+ERROR 42000: Variable 'innodb_ft_enable_diag_print' can't be set to the value of '2'
+set global innodb_ft_enable_diag_print=-3;
+ERROR 42000: Variable 'innodb_ft_enable_diag_print' can't be set to the value of '-3'
+select @@global.innodb_ft_enable_diag_print;
+@@global.innodb_ft_enable_diag_print
+1
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT ON
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_DIAG_PRINT ON
+set global innodb_ft_enable_diag_print='AUTO';
+ERROR 42000: Variable 'innodb_ft_enable_diag_print' can't be set to the value of 'AUTO'
+SET @@global.innodb_ft_enable_diag_print = @start_global_value;
+SELECT @@global.innodb_ft_enable_diag_print;
+@@global.innodb_ft_enable_diag_print
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_enable_stopword_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_enable_stopword_basic.result
new file mode 100644
index 00000000000..d0cd535637a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_enable_stopword_basic.result
@@ -0,0 +1,121 @@
+SET @start_global_value = @@global.innodb_ft_enable_stopword;
+SELECT @start_global_value;
+@start_global_value
+1
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_ft_enable_stopword in (0, 1);
+@@global.innodb_ft_enable_stopword in (0, 1)
+1
+select @@global.innodb_ft_enable_stopword;
+@@global.innodb_ft_enable_stopword
+1
+select @@session.innodb_ft_enable_stopword in (0, 1);
+@@session.innodb_ft_enable_stopword in (0, 1)
+1
+select @@session.innodb_ft_enable_stopword;
+@@session.innodb_ft_enable_stopword
+1
+show global variables like 'innodb_ft_enable_stopword';
+Variable_name Value
+innodb_ft_enable_stopword ON
+show session variables like 'innodb_ft_enable_stopword';
+Variable_name Value
+innodb_ft_enable_stopword ON
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD ON
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD ON
+set global innodb_ft_enable_stopword='OFF';
+set session innodb_ft_enable_stopword='OFF';
+select @@global.innodb_ft_enable_stopword;
+@@global.innodb_ft_enable_stopword
+0
+select @@session.innodb_ft_enable_stopword;
+@@session.innodb_ft_enable_stopword
+0
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD OFF
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD OFF
+set @@global.innodb_ft_enable_stopword=1;
+set @@session.innodb_ft_enable_stopword=1;
+select @@global.innodb_ft_enable_stopword;
+@@global.innodb_ft_enable_stopword
+1
+select @@session.innodb_ft_enable_stopword;
+@@session.innodb_ft_enable_stopword
+1
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD ON
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD ON
+set global innodb_ft_enable_stopword=0;
+set session innodb_ft_enable_stopword=0;
+select @@global.innodb_ft_enable_stopword;
+@@global.innodb_ft_enable_stopword
+0
+select @@session.innodb_ft_enable_stopword;
+@@session.innodb_ft_enable_stopword
+0
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD OFF
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD OFF
+set @@global.innodb_ft_enable_stopword='ON';
+set @@session.innodb_ft_enable_stopword='ON';
+select @@global.innodb_ft_enable_stopword;
+@@global.innodb_ft_enable_stopword
+1
+select @@session.innodb_ft_enable_stopword;
+@@session.innodb_ft_enable_stopword
+1
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD ON
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD ON
+set global innodb_ft_enable_stopword=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_enable_stopword'
+set session innodb_ft_enable_stopword=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_enable_stopword'
+set global innodb_ft_enable_stopword=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_enable_stopword'
+set session innodb_ft_enable_stopword=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_enable_stopword'
+set global innodb_ft_enable_stopword=2;
+ERROR 42000: Variable 'innodb_ft_enable_stopword' can't be set to the value of '2'
+set session innodb_ft_enable_stopword=2;
+ERROR 42000: Variable 'innodb_ft_enable_stopword' can't be set to the value of '2'
+set global innodb_ft_enable_stopword='AUTO';
+ERROR 42000: Variable 'innodb_ft_enable_stopword' can't be set to the value of 'AUTO'
+set session innodb_ft_enable_stopword='AUTO';
+ERROR 42000: Variable 'innodb_ft_enable_stopword' can't be set to the value of 'AUTO'
+set global innodb_ft_enable_stopword=-3;
+ERROR 42000: Variable 'innodb_ft_enable_stopword' can't be set to the value of '-3'
+set session innodb_ft_enable_stopword=-7;
+ERROR 42000: Variable 'innodb_ft_enable_stopword' can't be set to the value of '-7'
+select @@global.innodb_ft_enable_stopword;
+@@global.innodb_ft_enable_stopword
+1
+select @@session.innodb_ft_enable_stopword;
+@@session.innodb_ft_enable_stopword
+1
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD ON
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_ENABLE_STOPWORD ON
+SET @@global.innodb_ft_enable_stopword = @start_global_value;
+SELECT @@global.innodb_ft_enable_stopword;
+@@global.innodb_ft_enable_stopword
+1
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_max_token_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_max_token_size_basic.result
new file mode 100644
index 00000000000..f1828b67787
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_max_token_size_basic.result
@@ -0,0 +1,21 @@
+select @@global.innodb_ft_max_token_size;
+@@global.innodb_ft_max_token_size
+84
+select @@session.innodb_ft_max_token_size;
+ERROR HY000: Variable 'innodb_ft_max_token_size' is a GLOBAL variable
+show global variables like 'innodb_ft_max_token_size';
+Variable_name Value
+innodb_ft_max_token_size 84
+show session variables like 'innodb_ft_max_token_size';
+Variable_name Value
+innodb_ft_max_token_size 84
+select * from information_schema.global_variables where variable_name='innodb_ft_max_token_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_MAX_TOKEN_SIZE 84
+select * from information_schema.session_variables where variable_name='innodb_ft_max_token_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_MAX_TOKEN_SIZE 84
+set global innodb_ft_max_token_size=1;
+ERROR HY000: Variable 'innodb_ft_max_token_size' is a read only variable
+set session innodb_ft_max_token_size=1;
+ERROR HY000: Variable 'innodb_ft_max_token_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_min_token_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_min_token_size_basic.result
new file mode 100644
index 00000000000..25d5e28468d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_min_token_size_basic.result
@@ -0,0 +1,21 @@
+select @@global.innodb_ft_min_token_size;
+@@global.innodb_ft_min_token_size
+3
+select @@session.innodb_ft_min_token_size;
+ERROR HY000: Variable 'innodb_ft_min_token_size' is a GLOBAL variable
+show global variables like 'innodb_ft_min_token_size';
+Variable_name Value
+innodb_ft_min_token_size 3
+show session variables like 'innodb_ft_min_token_size';
+Variable_name Value
+innodb_ft_min_token_size 3
+select * from information_schema.global_variables where variable_name='innodb_ft_min_token_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_MIN_TOKEN_SIZE 3
+select * from information_schema.session_variables where variable_name='innodb_ft_min_token_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_MIN_TOKEN_SIZE 3
+set global innodb_ft_min_token_size=1;
+ERROR HY000: Variable 'innodb_ft_min_token_size' is a read only variable
+set session innodb_ft_min_token_size=1;
+ERROR HY000: Variable 'innodb_ft_min_token_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_num_word_optimize_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_num_word_optimize_basic.result
new file mode 100644
index 00000000000..1eed900e321
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_num_word_optimize_basic.result
@@ -0,0 +1,56 @@
+SET @start_global_value = @@global.innodb_ft_num_word_optimize;
+SELECT @start_global_value;
+@start_global_value
+2000
+Valid values are zero or above
+select @@global.innodb_ft_num_word_optimize >=1000;
+@@global.innodb_ft_num_word_optimize >=1000
+1
+select @@global.innodb_ft_num_word_optimize;
+@@global.innodb_ft_num_word_optimize
+2000
+select @@session.innodb_ft_num_word_optimize;
+ERROR HY000: Variable 'innodb_ft_num_word_optimize' is a GLOBAL variable
+show global variables like 'innodb_ft_num_word_optimize';
+Variable_name Value
+innodb_ft_num_word_optimize 2000
+show session variables like 'innodb_ft_num_word_optimize';
+Variable_name Value
+innodb_ft_num_word_optimize 2000
+select * from information_schema.global_variables where variable_name='innodb_ft_num_word_optimize';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_NUM_WORD_OPTIMIZE 2000
+select * from information_schema.session_variables where variable_name='innodb_ft_num_word_optimize';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_NUM_WORD_OPTIMIZE 2000
+set global innodb_ft_num_word_optimize=1000;
+select @@global.innodb_ft_num_word_optimize;
+@@global.innodb_ft_num_word_optimize
+1000
+select * from information_schema.global_variables where variable_name='innodb_ft_num_word_optimize';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_NUM_WORD_OPTIMIZE 1000
+select * from information_schema.session_variables where variable_name='innodb_ft_num_word_optimize';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_NUM_WORD_OPTIMIZE 1000
+set session innodb_ft_num_word_optimize=1000;
+ERROR HY000: Variable 'innodb_ft_num_word_optimize' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_ft_num_word_optimize=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_num_word_optimize'
+set global innodb_ft_num_word_optimize=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_num_word_optimize'
+set global innodb_ft_num_word_optimize="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_num_word_optimize'
+set global innodb_ft_num_word_optimize=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_ft_num_word_optimize value: '-7'
+select @@global.innodb_ft_num_word_optimize;
+@@global.innodb_ft_num_word_optimize
+1000
+select * from information_schema.global_variables where variable_name='innodb_ft_num_word_optimize';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_NUM_WORD_OPTIMIZE 1000
+SET @@global.innodb_ft_num_word_optimize = @start_global_value;
+SELECT @@global.innodb_ft_num_word_optimize;
+@@global.innodb_ft_num_word_optimize
+2000
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result
new file mode 100644
index 00000000000..0aefabd48f7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit_basic.result
@@ -0,0 +1,32 @@
+select @@global.innodb_ft_result_cache_limit;
+@@global.innodb_ft_result_cache_limit
+2000000000
+select @@session.innodb_ft_result_cache_limit;
+ERROR HY000: Variable 'innodb_ft_result_cache_limit' is a GLOBAL variable
+show global variables like 'innodb_ft_result_cache_limit';
+Variable_name Value
+innodb_ft_result_cache_limit 2000000000
+show session variables like 'innodb_ft_result_cache_limit';
+Variable_name Value
+innodb_ft_result_cache_limit 2000000000
+select * from information_schema.global_variables where variable_name='innodb_ft_result_cache_limit';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_RESULT_CACHE_LIMIT 2000000000
+select * from information_schema.session_variables where variable_name='innodb_ft_result_cache_limit';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_RESULT_CACHE_LIMIT 2000000000
+set global innodb_ft_result_cache_limit=900000;
+Warnings:
+Warning 1292 Truncated incorrect innodb_ft_result_cache_limit value: '900000'
+select @@innodb_ft_result_cache_limit;
+@@innodb_ft_result_cache_limit
+1000000
+set global innodb_ft_result_cache_limit=1000000;
+select @@innodb_ft_result_cache_limit;
+@@innodb_ft_result_cache_limit
+1000000
+set global innodb_ft_result_cache_limit=4000000000;
+select @@innodb_ft_result_cache_limit;
+@@innodb_ft_result_cache_limit
+4000000000
+set global innodb_ft_result_cache_limit=2000000000;
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_server_stopword_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_server_stopword_table_basic.result
new file mode 100644
index 00000000000..044e8f80951
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_server_stopword_table_basic.result
@@ -0,0 +1,32 @@
+SET @start_global_value = @@global.innodb_ft_server_stopword_table;
+SELECT @start_global_value;
+@start_global_value
+NULL
+select @@session.innodb_ft_server_stopword_table;
+ERROR HY000: Variable 'innodb_ft_server_stopword_table' is a GLOBAL variable
+show global variables like 'innodb_ft_server_stopword_table';
+Variable_name Value
+innodb_ft_server_stopword_table
+show session variables like 'innodb_ft_server_stopword_table';
+Variable_name Value
+innodb_ft_server_stopword_table
+select * from information_schema.global_variables where variable_name='innodb_ft_server_stopword_table';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_SERVER_STOPWORD_TABLE
+select * from information_schema.session_variables where variable_name='innodb_ft_server_stopword_table';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_SERVER_STOPWORD_TABLE
+set session innodb_ft_server_stopword_table='Salmon';
+ERROR HY000: Variable 'innodb_ft_server_stopword_table' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_ft_server_stopword_table='Salmon';
+ERROR HY000: Variable 'innodb_ft_server_stopword_table' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_ft_server_stopword_table=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_server_stopword_table'
+set global innodb_ft_server_stopword_table=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_server_stopword_table'
+set global innodb_ft_server_stopword_table='Salmon';
+ERROR 42000: Variable 'innodb_ft_server_stopword_table' can't be set to the value of 'Salmon'
+SET @@global.innodb_ft_server_stopword_table = @start_global_value;
+SELECT @@global.innodb_ft_server_stopword_table;
+@@global.innodb_ft_server_stopword_table
+NULL
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_sort_pll_degree_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_sort_pll_degree_basic.result
new file mode 100644
index 00000000000..be1f454d79f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_sort_pll_degree_basic.result
@@ -0,0 +1,21 @@
+select @@global.innodb_ft_sort_pll_degree;
+@@global.innodb_ft_sort_pll_degree
+2
+select @@session.innodb_ft_sort_pll_degree;
+ERROR HY000: Variable 'innodb_ft_sort_pll_degree' is a GLOBAL variable
+show global variables like 'innodb_ft_sort_pll_degree';
+Variable_name Value
+innodb_ft_sort_pll_degree 2
+show session variables like 'innodb_ft_sort_pll_degree';
+Variable_name Value
+innodb_ft_sort_pll_degree 2
+select * from information_schema.global_variables where variable_name='innodb_ft_sort_pll_degree';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_SORT_PLL_DEGREE 2
+select * from information_schema.session_variables where variable_name='innodb_ft_sort_pll_degree';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_SORT_PLL_DEGREE 2
+set global innodb_ft_sort_pll_degree=1;
+ERROR HY000: Variable 'innodb_ft_sort_pll_degree' is a read only variable
+set session innodb_ft_sort_pll_degree=1;
+ERROR HY000: Variable 'innodb_ft_sort_pll_degree' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_total_cache_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_total_cache_size_basic.result
new file mode 100644
index 00000000000..ff234a1fcbf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_total_cache_size_basic.result
@@ -0,0 +1,21 @@
+select @@global.innodb_ft_total_cache_size;
+@@global.innodb_ft_total_cache_size
+640000000
+select @@session.innodb_ft_total_cache_size;
+ERROR HY000: Variable 'innodb_ft_total_cache_size' is a GLOBAL variable
+show global variables like 'innodb_ft_total_cache_size';
+Variable_name Value
+innodb_ft_total_cache_size 640000000
+show session variables like 'innodb_ft_total_cache_size';
+Variable_name Value
+innodb_ft_total_cache_size 640000000
+select * from information_schema.global_variables where variable_name='innodb_ft_total_cache_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_TOTAL_CACHE_SIZE 640000000
+select * from information_schema.session_variables where variable_name='innodb_ft_total_cache_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_TOTAL_CACHE_SIZE 640000000
+set global innodb_ft_total_cache_size=1;
+ERROR HY000: Variable 'innodb_ft_total_cache_size' is a read only variable
+set session innodb_ft_total_cache_size=1;
+ERROR HY000: Variable 'innodb_ft_total_cache_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_user_stopword_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_ft_user_stopword_table_basic.result
new file mode 100644
index 00000000000..66298481693
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_user_stopword_table_basic.result
@@ -0,0 +1,30 @@
+SET @start_global_value = @@global.innodb_ft_user_stopword_table;
+SELECT @start_global_value;
+@start_global_value
+NULL
+select @@session.innodb_ft_user_stopword_table;
+@@session.innodb_ft_user_stopword_table
+NULL
+show global variables like 'innodb_ft_user_stopword_table';
+Variable_name Value
+innodb_ft_user_stopword_table
+show session variables like 'innodb_ft_user_stopword_table';
+Variable_name Value
+innodb_ft_user_stopword_table
+select * from information_schema.global_variables where variable_name='innodb_ft_user_stopword_table';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_USER_STOPWORD_TABLE
+select * from information_schema.session_variables where variable_name='innodb_ft_user_stopword_table';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_FT_USER_STOPWORD_TABLE
+set session innodb_ft_user_stopword_table='Salmon';
+ERROR 42000: Variable 'innodb_ft_user_stopword_table' can't be set to the value of 'Salmon'
+set @@session.innodb_ft_user_stopword_table='Salmon';
+ERROR 42000: Variable 'innodb_ft_user_stopword_table' can't be set to the value of 'Salmon'
+set global innodb_ft_user_stopword_table=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_user_stopword_table'
+set global innodb_ft_user_stopword_table=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_ft_user_stopword_table'
+set global innodb_ft_user_stopword_table='Salmon';
+ERROR 42000: Variable 'innodb_ft_user_stopword_table' can't be set to the value of 'Salmon'
+SET @@session.innodb_ft_user_stopword_table=@start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_io_capacity_max_basic.result b/mysql-test/suite/sys_vars/r/innodb_io_capacity_max_basic.result
new file mode 100644
index 00000000000..f22d11e1b62
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_io_capacity_max_basic.result
@@ -0,0 +1,96 @@
+SET @start_innodb_max_capacity = @@global.innodb_io_capacity_max;
+SELECT @start_innodb_max_capacity;
+@start_innodb_max_capacity
+2000
+SET @start_innodb_capacity = @@global.innodb_io_capacity;
+SELECT @start_innodb_capacity;
+@start_innodb_capacity
+200
+Valid value 100 or more
+select @@global.innodb_io_capacity_max > 99;
+@@global.innodb_io_capacity_max > 99
+1
+select @@global.innodb_io_capacity_max;
+@@global.innodb_io_capacity_max
+2000
+select @@session.innodb_io_capacity_max;
+ERROR HY000: Variable 'innodb_io_capacity_max' is a GLOBAL variable
+show global variables like 'innodb_io_capacity_max';
+Variable_name Value
+innodb_io_capacity_max 2000
+show session variables like 'innodb_io_capacity_max';
+Variable_name Value
+innodb_io_capacity_max 2000
+select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IO_CAPACITY_MAX 2000
+select * from information_schema.session_variables where variable_name='innodb_io_capacity_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IO_CAPACITY_MAX 2000
+set global innodb_io_capacity_max=@start_innodb_capacity + 1;
+select @@global.innodb_io_capacity_max;
+@@global.innodb_io_capacity_max
+201
+select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IO_CAPACITY_MAX 201
+select * from information_schema.session_variables where variable_name='innodb_io_capacity_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IO_CAPACITY_MAX 201
+set session innodb_io_capacity_max=444;
+ERROR HY000: Variable 'innodb_io_capacity_max' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_io_capacity_max=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_io_capacity_max'
+set global innodb_io_capacity_max=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_io_capacity_max'
+set global innodb_io_capacity_max="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_io_capacity_max'
+set global innodb_io_capacity_max=1000;
+set global innodb_io_capacity=500;
+set global innodb_io_capacity_max=400;
+Warnings:
+Warning 1210 Setting innodb_io_capacity_max 400 lower than innodb_io_capacity 500.
+Warning 1210 Setting innodb_io_capacity to 400
+select @@global.innodb_io_capacity_max;
+@@global.innodb_io_capacity_max
+400
+select @@global.innodb_io_capacity;
+@@global.innodb_io_capacity
+400
+select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IO_CAPACITY_MAX 400
+select * from information_schema.global_variables where variable_name='innodb_io_capacity';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IO_CAPACITY 400
+set global innodb_io_capacity_max=1000;
+set global innodb_io_capacity=500;
+set global innodb_io_capacity=1400;
+Warnings:
+Warning 1210 Setting innodb_io_capacity to 1400 higher than innodb_io_capacity_max 1000
+Warning 1210 Setting innodb_max_io_capacity to 2800
+select @@global.innodb_io_capacity_max;
+@@global.innodb_io_capacity_max
+2800
+select @@global.innodb_io_capacity;
+@@global.innodb_io_capacity
+1400
+select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IO_CAPACITY_MAX 2800
+select * from information_schema.global_variables where variable_name='innodb_io_capacity';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_IO_CAPACITY 1400
+set global innodb_io_capacity=100;
+set global innodb_io_capacity_max=100;
+select @@global.innodb_io_capacity_max;
+@@global.innodb_io_capacity_max
+100
+SET @@global.innodb_io_capacity_max = @start_innodb_max_capacity;
+SELECT @@global.innodb_io_capacity_max;
+@@global.innodb_io_capacity_max
+2000
+SET @@global.innodb_io_capacity = @start_innodb_capacity;
+SELECT @@global.innodb_io_capacity;
+@@global.innodb_io_capacity
+200
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_arch_dir_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_arch_dir_basic.result
new file mode 100644
index 00000000000..bead0303520
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_log_arch_dir_basic.result
@@ -0,0 +1,38 @@
+SELECT @@GLOBAL.innodb_log_arch_dir;
+@@GLOBAL.innodb_log_arch_dir
+./
+NULL Expected
+SET @@GLOBAL.innodb_log_arch_dir=1;
+ERROR HY000: Variable 'innodb_log_arch_dir' is a read only variable
+Expected error 'Read only variable'
+SELECT @@GLOBAL.innodb_log_arch_dir;
+@@GLOBAL.innodb_log_arch_dir
+./
+NULL Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_log_arch_dir';
+VARIABLE_VALUE
+./
+empty string Expected
+SELECT @@innodb_log_arch_dir;
+@@innodb_log_arch_dir
+./
+NULL Expected
+SELECT @@innodb_log_arch_dir;
+@@innodb_log_arch_dir
+./
+NULL Expected
+SELECT @@local.innodb_log_arch_dir;
+ERROR HY000: Variable 'innodb_log_arch_dir' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@SESSION.innodb_log_arch_dir;
+ERROR HY000: Variable 'innodb_log_arch_dir' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@GLOBAL.innodb_log_arch_dir;
+@@GLOBAL.innodb_log_arch_dir
+./
+NULL Expected
+SELECT innodb_log_arch_dir = @@SESSION.innodb_log_arch_dir;
+ERROR 42S22: Unknown column 'innodb_log_arch_dir' in 'field list'
+Expected error Unknown column 'innodb_log_arch_dir' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_arch_expire_sec_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_arch_expire_sec_basic.result
new file mode 100644
index 00000000000..97bff097252
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_log_arch_expire_sec_basic.result
@@ -0,0 +1,38 @@
+SELECT @@GLOBAL.innodb_log_arch_expire_sec INTO @save;
+SELECT @@GLOBAL.innodb_log_arch_expire_sec;
+@@GLOBAL.innodb_log_arch_expire_sec
+0
+0 Expected
+SET @@GLOBAL.innodb_log_arch_expire_sec=1;
+SELECT @@GLOBAL.innodb_log_arch_expire_sec;
+@@GLOBAL.innodb_log_arch_expire_sec
+1
+1 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_log_arch_expire_sec';
+VARIABLE_VALUE
+1
+1 Expected
+SELECT @@innodb_log_arch_expire_sec;
+@@innodb_log_arch_expire_sec
+1
+1 Expected
+SELECT @@innodb_log_arch_expire_sec;
+@@innodb_log_arch_expire_sec
+1
+1 Expected
+SELECT @@local.innodb_log_arch_expire_sec;
+ERROR HY000: Variable 'innodb_log_arch_expire_sec' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@SESSION.innodb_log_arch_expire_sec;
+ERROR HY000: Variable 'innodb_log_arch_expire_sec' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@GLOBAL.innodb_log_arch_expire_sec;
+@@GLOBAL.innodb_log_arch_expire_sec
+1
+1 Expected
+SELECT innodb_log_arch_expire_sec = @@SESSION.innodb_log_arch_expire_sec;
+ERROR 42S22: Unknown column 'innodb_log_arch_expire_sec' in 'field list'
+Expected error Unknown column 'innodb_log_arch_expire_sec' in 'field list'
+SET @@GLOBAL.innodb_log_arch_expire_sec = @save;
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_archive_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_archive_basic.result
new file mode 100644
index 00000000000..bb9b53482fa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_log_archive_basic.result
@@ -0,0 +1,38 @@
+SELECT @@GLOBAL.innodb_log_archive;
+@@GLOBAL.innodb_log_archive
+0
+0 Expected
+SET @save_innodb_log_archive = @@GLOBAL.innodb_log_archive;
+SET @@GLOBAL.innodb_log_archive=1;
+SELECT @@GLOBAL.innodb_log_archive;
+@@GLOBAL.innodb_log_archive
+1
+1 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_log_archive';
+VARIABLE_VALUE
+ON
+ON Expected
+SET @@GLOBAL.innodb_log_archive = @save_innodb_log_archive;
+SELECT @@innodb_log_archive;
+@@innodb_log_archive
+0
+0 Expected
+SELECT @@innodb_log_archive;
+@@innodb_log_archive
+0
+0 Expected
+SELECT @@local.innodb_log_archive;
+ERROR HY000: Variable 'innodb_log_archive' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@SESSION.innodb_log_archive;
+ERROR HY000: Variable 'innodb_log_archive' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT @@GLOBAL.innodb_log_archive;
+@@GLOBAL.innodb_log_archive
+0
+0 Expected
+SELECT innodb_log_archive = @@SESSION.innodb_log_archive;
+ERROR 42S22: Unknown column 'innodb_log_archive' in 'field list'
+Expected error Unknown column 'innodb_log_archive' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_checksum_algorithm_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_checksum_algorithm_basic.result
new file mode 100644
index 00000000000..cb03046c84d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_log_checksum_algorithm_basic.result
@@ -0,0 +1,47 @@
+SET @orig = @@global.innodb_log_checksum_algorithm;
+SELECT @orig;
+@orig
+innodb
+SET GLOBAL innodb_log_checksum_algorithm = 'crc32';
+SELECT @@global.innodb_log_checksum_algorithm;
+@@global.innodb_log_checksum_algorithm
+crc32
+SET GLOBAL innodb_log_checksum_algorithm = 'strict_crc32';
+SELECT @@global.innodb_log_checksum_algorithm;
+@@global.innodb_log_checksum_algorithm
+strict_crc32
+SET GLOBAL innodb_log_checksum_algorithm = 'innodb';
+SELECT @@global.innodb_log_checksum_algorithm;
+@@global.innodb_log_checksum_algorithm
+innodb
+SET GLOBAL innodb_log_checksum_algorithm = 'strict_innodb';
+SELECT @@global.innodb_log_checksum_algorithm;
+@@global.innodb_log_checksum_algorithm
+strict_innodb
+SET GLOBAL innodb_log_checksum_algorithm = 'none';
+SELECT @@global.innodb_log_checksum_algorithm;
+@@global.innodb_log_checksum_algorithm
+none
+SET GLOBAL innodb_log_checksum_algorithm = 'strict_none';
+SELECT @@global.innodb_log_checksum_algorithm;
+@@global.innodb_log_checksum_algorithm
+strict_none
+SET GLOBAL innodb_log_checksum_algorithm = '';
+ERROR 42000: Variable 'innodb_log_checksum_algorithm' can't be set to the value of ''
+SELECT @@global.innodb_log_checksum_algorithm;
+@@global.innodb_log_checksum_algorithm
+strict_none
+SET GLOBAL innodb_log_checksum_algorithm = 'foobar';
+ERROR 42000: Variable 'innodb_log_checksum_algorithm' can't be set to the value of 'foobar'
+SELECT @@global.innodb_log_checksum_algorithm;
+@@global.innodb_log_checksum_algorithm
+strict_none
+SET GLOBAL innodb_log_checksum_algorithm = 123;
+ERROR 42000: Variable 'innodb_log_checksum_algorithm' can't be set to the value of '123'
+SELECT @@global.innodb_log_checksum_algorithm;
+@@global.innodb_log_checksum_algorithm
+strict_none
+SET GLOBAL innodb_log_checksum_algorithm = @orig;
+SELECT @@global.innodb_log_checksum_algorithm;
+@@global.innodb_log_checksum_algorithm
+innodb
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_compressed_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_compressed_pages_basic.result
new file mode 100644
index 00000000000..8cb8d900b59
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_log_compressed_pages_basic.result
@@ -0,0 +1,69 @@
+SET @start_global_value = @@global.innodb_log_compressed_pages;
+SELECT @start_global_value;
+@start_global_value
+1
+'#---------------------BS_STVARS_028_01----------------------#'
+SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages);
+COUNT(@@GLOBAL.innodb_log_compressed_pages)
+1
+1 Expected
+'#---------------------BS_STVARS_028_02----------------------#'
+SET @@global.innodb_log_compressed_pages = 0;
+SELECT @@global.innodb_log_compressed_pages;
+@@global.innodb_log_compressed_pages
+0
+SET @@global.innodb_log_compressed_pages ='On' ;
+SELECT @@global.innodb_log_compressed_pages;
+@@global.innodb_log_compressed_pages
+1
+SET @@global.innodb_log_compressed_pages ='Off' ;
+SELECT @@global.innodb_log_compressed_pages;
+@@global.innodb_log_compressed_pages
+0
+SET @@global.innodb_log_compressed_pages = 1;
+SELECT @@global.innodb_log_compressed_pages;
+@@global.innodb_log_compressed_pages
+1
+'#---------------------BS_STVARS_028_03----------------------#'
+SELECT IF(@@GLOBAL.innodb_log_compressed_pages,'ON','OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_log_compressed_pages';
+IF(@@GLOBAL.innodb_log_compressed_pages,'ON','OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages);
+COUNT(@@GLOBAL.innodb_log_compressed_pages)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_log_compressed_pages';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_028_04----------------------#'
+SELECT @@innodb_log_compressed_pages = @@GLOBAL.innodb_log_compressed_pages;
+@@innodb_log_compressed_pages = @@GLOBAL.innodb_log_compressed_pages
+1
+1 Expected
+'#---------------------BS_STVARS_028_05----------------------#'
+SELECT COUNT(@@innodb_log_compressed_pages);
+COUNT(@@innodb_log_compressed_pages)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_log_compressed_pages);
+ERROR HY000: Variable 'innodb_log_compressed_pages' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_log_compressed_pages);
+ERROR HY000: Variable 'innodb_log_compressed_pages' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages);
+COUNT(@@GLOBAL.innodb_log_compressed_pages)
+1
+1 Expected
+SELECT innodb_log_compressed_pages = @@SESSION.innodb_log_compressed_pages;
+ERROR 42S22: Unknown column 'innodb_log_compressed_pages' in 'field list'
+SET @@global.innodb_log_compressed_pages = @start_global_value;
+SELECT @@global.innodb_log_compressed_pages;
+@@global.innodb_log_compressed_pages
+1
diff --git a/mysql-test/suite/sys_vars/r/innodb_lru_scan_depth_basic.result b/mysql-test/suite/sys_vars/r/innodb_lru_scan_depth_basic.result
new file mode 100644
index 00000000000..80b0e3440a3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_lru_scan_depth_basic.result
@@ -0,0 +1,69 @@
+SET @start_global_value = @@global.innodb_lru_scan_depth;
+SELECT @start_global_value;
+@start_global_value
+100
+Valid value 100 or more
+select @@global.innodb_lru_scan_depth >= 100;
+@@global.innodb_lru_scan_depth >= 100
+1
+select @@global.innodb_lru_scan_depth;
+@@global.innodb_lru_scan_depth
+100
+select @@session.innodb_lru_scan_depth;
+ERROR HY000: Variable 'innodb_lru_scan_depth' is a GLOBAL variable
+show global variables like 'innodb_lru_scan_depth';
+Variable_name Value
+innodb_lru_scan_depth 100
+show session variables like 'innodb_lru_scan_depth';
+Variable_name Value
+innodb_lru_scan_depth 100
+select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LRU_SCAN_DEPTH 100
+select * from information_schema.session_variables where variable_name='innodb_lru_scan_depth';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LRU_SCAN_DEPTH 100
+set global innodb_lru_scan_depth=325;
+select @@global.innodb_lru_scan_depth;
+@@global.innodb_lru_scan_depth
+325
+select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LRU_SCAN_DEPTH 325
+select * from information_schema.session_variables where variable_name='innodb_lru_scan_depth';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LRU_SCAN_DEPTH 325
+set session innodb_lru_scan_depth=444;
+ERROR HY000: Variable 'innodb_lru_scan_depth' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_lru_scan_depth=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_lru_scan_depth'
+set global innodb_lru_scan_depth=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_lru_scan_depth'
+set global innodb_lru_scan_depth="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_lru_scan_depth'
+set global innodb_lru_scan_depth=7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_lru_scan_depth value: '7'
+select @@global.innodb_lru_scan_depth;
+@@global.innodb_lru_scan_depth
+100
+select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LRU_SCAN_DEPTH 100
+set global innodb_lru_scan_depth=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_lru_scan_depth value: '-7'
+select @@global.innodb_lru_scan_depth;
+@@global.innodb_lru_scan_depth
+100
+select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_LRU_SCAN_DEPTH 100
+set global innodb_lru_scan_depth=100;
+select @@global.innodb_lru_scan_depth;
+@@global.innodb_lru_scan_depth
+100
+SET @@global.innodb_lru_scan_depth = @start_global_value;
+SELECT @@global.innodb_lru_scan_depth;
+@@global.innodb_lru_scan_depth
+100
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 eff72613102..d705624eb53 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
@@ -4,58 +4,64 @@ SELECT @global_start_value;
75
'#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_max_dirty_pages_pct = 0;
-SET @@global.innodb_max_dirty_pages_pct = DEFAULT;
+Warnings:
+Warning 1292 Truncated incorrect innodb_max_dirty_pages_pct value: '0'
+SET @@global.innodb_max_dirty_pages_pct = @global_start_value;
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-75
+75.000000
'#---------------------FN_DYNVARS_046_02-------------------------#'
SET innodb_max_dirty_pages_pct = 1;
ERROR HY000: Variable 'innodb_max_dirty_pages_pct' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@innodb_max_dirty_pages_pct;
@@innodb_max_dirty_pages_pct
-75
+75.000000
SELECT local.innodb_max_dirty_pages_pct;
ERROR 42S02: Unknown table 'local' in field list
SET global innodb_max_dirty_pages_pct = 0;
+Warnings:
+Warning 1292 Truncated incorrect innodb_max_dirty_pages_pct value: '0'
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-0
+0.001000
'#--------------------FN_DYNVARS_046_03------------------------#'
SET @@global.innodb_max_dirty_pages_pct = 0;
+Warnings:
+Warning 1292 Truncated incorrect innodb_max_dirty_pages_pct value: '0'
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-0
+0.001000
SET @@global.innodb_max_dirty_pages_pct = 1;
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-1
+1.000000
SET @@global.innodb_max_dirty_pages_pct = 99;
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-99
+99.000000
'#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@global.innodb_max_dirty_pages_pct = -1;
Warnings:
Warning 1292 Truncated incorrect innodb_max_dirty_pages_pct value: '-1'
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-0
+0.001000
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
-0
+0.001000
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
-0
+0.001000
SET @@global.innodb_max_dirty_pages_pct = 1001;
Warnings:
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
+99.999000
'#----------------------FN_DYNVARS_046_05------------------------#'
SELECT @@global.innodb_max_dirty_pages_pct =
VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -65,32 +71,34 @@ VARIABLE_VALUE
1
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-99
+99.999000
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct';
VARIABLE_VALUE
-99
+99.999000
'#---------------------FN_DYNVARS_046_06-------------------------#'
SET @@global.innodb_max_dirty_pages_pct = OFF;
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
+99.999000
SET @@global.innodb_max_dirty_pages_pct = ON;
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
+99.999000
'#---------------------FN_DYNVARS_046_07----------------------#'
SET @@global.innodb_max_dirty_pages_pct = TRUE;
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-1
+1.000000
SET @@global.innodb_max_dirty_pages_pct = FALSE;
+Warnings:
+Warning 1292 Truncated incorrect innodb_max_dirty_pages_pct value: '0'
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-0
+0.001000
SET @@global.innodb_max_dirty_pages_pct = @global_start_value;
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-75
+75.000000
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
index 55de5adbc33..05aa3e5fd89 100644
--- a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
+++ b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
@@ -5,13 +5,13 @@ SET @@global.innodb_max_dirty_pages_pct = 80;
'connection con1'
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-80
+80.000000
SET @@global.innodb_max_dirty_pages_pct = 70;
'connect (con2,localhost,root,,,,)'
'connection con2'
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
-70
+70.000000
'connection default'
'disconnect con2'
'disconnect con1'
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_lwm_basic.result b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_lwm_basic.result
new file mode 100644
index 00000000000..676ec103664
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_lwm_basic.result
@@ -0,0 +1,109 @@
+SET @pct_lwm_start_value = @@global.innodb_max_dirty_pages_pct_lwm;
+SELECT @pct_lwm_start_value;
+@pct_lwm_start_value
+0.001
+SET @pct_start_value = @@global.innodb_max_dirty_pages_pct;
+SELECT @pct_start_value;
+@pct_start_value
+75
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_max_dirty_pages_pct_lwm = 0;
+SET @@global.innodb_max_dirty_pages_pct_lwm = @pct_lwm_start_value;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+0.001000
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_max_dirty_pages_pct_lwm = 1;
+ERROR HY000: Variable 'innodb_max_dirty_pages_pct_lwm' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_max_dirty_pages_pct_lwm;
+@@innodb_max_dirty_pages_pct_lwm
+0.001000
+SELECT local.innodb_max_dirty_pages_pct_lwm;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_max_dirty_pages_pct_lwm = 0;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+0.000000
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_max_dirty_pages_pct_lwm = 0;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+0.000000
+SET @@global.innodb_max_dirty_pages_pct_lwm = @pct_start_value;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+75.000000
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_max_dirty_pages_pct_lwm = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_max_dirty_pages_pct_lwm value: '-1'
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+0.000000
+SET @@global.innodb_max_dirty_pages_pct_lwm = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_max_dirty_pages_pct_lwm'
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+0.000000
+SET @@global.innodb_max_dirty_pages_pct_lwm = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_max_dirty_pages_pct_lwm'
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+0.000000
+SET @@global.innodb_max_dirty_pages_pct_lwm = @pct_start_value + 1;
+Warnings:
+Warning 1210 innodb_max_dirty_pages_pct_lwm cannot be set higher than innodb_max_dirty_pages_pct.
+Warning 1210 Setting innodb_max_dirty_page_pct_lwm to 75.000000
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+75.000000
+SET @@global.innodb_max_dirty_pages_pct_lwm = 100;
+Warnings:
+Warning 1292 Truncated incorrect innodb_max_dirty_pages_pct_lwm value: '100'
+Warning 1210 innodb_max_dirty_pages_pct_lwm cannot be set higher than innodb_max_dirty_pages_pct.
+Warning 1210 Setting innodb_max_dirty_page_pct_lwm to 75.000000
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+75.000000
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_max_dirty_pages_pct_lwm =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct_lwm';
+@@global.innodb_max_dirty_pages_pct_lwm =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+75.000000
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct_lwm';
+VARIABLE_VALUE
+75.000000
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_max_dirty_pages_pct_lwm = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_max_dirty_pages_pct_lwm'
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+75.000000
+SET @@global.innodb_max_dirty_pages_pct_lwm = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_max_dirty_pages_pct_lwm'
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+75.000000
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_max_dirty_pages_pct_lwm = TRUE;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+1.000000
+SET @@global.innodb_max_dirty_pages_pct_lwm = FALSE;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+0.000000
+SET @@global.innodb_max_dirty_pages_pct = @pct_start_value;
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+75.000000
+SET @@global.innodb_max_dirty_pages_pct_lwm = @pct_lwm_start_value;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+0.001000
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result
new file mode 100644
index 00000000000..ae42d16c2ee
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result
@@ -0,0 +1,43 @@
+SELECT @@GLOBAL.innodb_max_purge_lag_delay;
+@@GLOBAL.innodb_max_purge_lag_delay
+0
+0 Expected
+SET @@GLOBAL.innodb_max_purge_lag_delay=1;
+SELECT COUNT(@@GLOBAL.innodb_max_purge_lag_delay);
+COUNT(@@GLOBAL.innodb_max_purge_lag_delay)
+1
+1 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_purge_lag_delay';
+VARIABLE_VALUE
+1
+1 Expected
+SELECT @@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay;
+@@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay
+1
+1 Expected
+SELECT COUNT(@@innodb_max_purge_lag_delay);
+COUNT(@@innodb_max_purge_lag_delay)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_max_purge_lag_delay);
+ERROR HY000: Variable 'innodb_max_purge_lag_delay' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_max_purge_lag_delay);
+ERROR HY000: Variable 'innodb_max_purge_lag_delay' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT innodb_max_purge_lag_delay = @@SESSION.innodb_max_purge_lag_delay;
+ERROR 42S22: Unknown column 'innodb_max_purge_lag_delay' in 'field list'
+set global innodb_max_purge_lag_delay = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_max_purge_lag_delay value: '-1'
+set global innodb_max_purge_lag_delay = 1000000;
+set global innodb_max_purge_lag_delay = 10000000;
+set global innodb_max_purge_lag_delay = 100000000;
+Warnings:
+Warning 1292 Truncated incorrect innodb_max_purge_lag_delay value: '100000000'
+set global innodb_max_purge_lag_delay = 100000001;
+Warnings:
+Warning 1292 Truncated incorrect innodb_max_purge_lag_delay value: '100000001'
+set global innodb_max_purge_lag_delay = 0;
diff --git a/mysql-test/suite/sys_vars/r/innodb_merge_sort_block_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_merge_sort_block_size_basic.result
deleted file mode 100644
index 90c2954e43d..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_merge_sort_block_size_basic.result
+++ /dev/null
@@ -1,24 +0,0 @@
-SELECT @@global.innodb_merge_sort_block_size;
-@@global.innodb_merge_sort_block_size
-1048576
-SELECT @@session.innodb_merge_sort_block_size;
-@@session.innodb_merge_sort_block_size
-1048576
-SET @old_global=@@global.innodb_merge_sort_block_size;
-SET @old_session=@@session.innodb_merge_sort_block_size;
-SET @@global.innodb_merge_sort_block_size = 2*1024*1024;
-SET @@session.innodb_merge_sort_block_size = 4*1024*1024;
-SELECT @@global.innodb_merge_sort_block_size;
-@@global.innodb_merge_sort_block_size
-2097152
-SELECT @@session.innodb_merge_sort_block_size;
-@@session.innodb_merge_sort_block_size
-4194304
-SET @@global.innodb_merge_sort_block_size = 1024*1024*1024+1;
-Warnings:
-Warning 1292 Truncated incorrect innodb_merge_sort_block_size value: '1073741825'
-SELECT @@global.innodb_merge_sort_block_size;
-@@global.innodb_merge_sort_block_size
-1073741824
-SET @@global.innodb_merge_sort_block_size=@old_global;
-SET @@session.innodb_merge_sort_block_size=@old_session;
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
new file mode 100644
index 00000000000..8c0af874228
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
@@ -0,0 +1,582 @@
+set global innodb_monitor_disable = All;
+select name, status from information_schema.innodb_metrics;
+name status
+metadata_table_handles_opened disabled
+metadata_table_handles_closed disabled
+metadata_table_reference_count disabled
+metadata_mem_pool_size disabled
+lock_deadlocks disabled
+lock_timeouts disabled
+lock_rec_lock_waits disabled
+lock_table_lock_waits disabled
+lock_rec_lock_requests disabled
+lock_rec_lock_created disabled
+lock_rec_lock_removed disabled
+lock_rec_locks disabled
+lock_table_lock_created disabled
+lock_table_lock_removed disabled
+lock_table_locks disabled
+lock_row_lock_current_waits disabled
+lock_row_lock_time disabled
+lock_row_lock_time_max disabled
+lock_row_lock_waits disabled
+lock_row_lock_time_avg disabled
+buffer_pool_size disabled
+buffer_pool_reads disabled
+buffer_pool_read_requests disabled
+buffer_pool_write_requests disabled
+buffer_pool_wait_free disabled
+buffer_pool_read_ahead disabled
+buffer_pool_read_ahead_evicted disabled
+buffer_pool_pages_total disabled
+buffer_pool_pages_misc disabled
+buffer_pool_pages_data disabled
+buffer_pool_bytes_data disabled
+buffer_pool_pages_dirty disabled
+buffer_pool_bytes_dirty disabled
+buffer_pool_pages_free disabled
+buffer_pages_created disabled
+buffer_pages_written disabled
+buffer_pages_read disabled
+buffer_data_reads disabled
+buffer_data_written disabled
+buffer_flush_batch_scanned disabled
+buffer_flush_batch_num_scan disabled
+buffer_flush_batch_scanned_per_call disabled
+buffer_flush_batch_rescan disabled
+buffer_flush_batch_total_pages disabled
+buffer_flush_batches disabled
+buffer_flush_batch_pages disabled
+buffer_flush_neighbor_total_pages disabled
+buffer_flush_neighbor disabled
+buffer_flush_neighbor_pages disabled
+buffer_flush_n_to_flush_requested disabled
+buffer_flush_avg_page_rate disabled
+buffer_flush_lsn_avg_rate disabled
+buffer_flush_pct_for_dirty disabled
+buffer_flush_pct_for_lsn disabled
+buffer_flush_sync_waits disabled
+buffer_flush_adaptive_total_pages disabled
+buffer_flush_adaptive disabled
+buffer_flush_adaptive_pages disabled
+buffer_flush_sync_total_pages disabled
+buffer_flush_sync disabled
+buffer_flush_sync_pages disabled
+buffer_flush_background_total_pages disabled
+buffer_flush_background disabled
+buffer_flush_background_pages disabled
+buffer_LRU_batch_scanned disabled
+buffer_LRU_batch_num_scan disabled
+buffer_LRU_batch_scanned_per_call disabled
+buffer_LRU_batch_total_pages disabled
+buffer_LRU_batches disabled
+buffer_LRU_batch_pages disabled
+buffer_LRU_single_flush_scanned disabled
+buffer_LRU_single_flush_num_scan disabled
+buffer_LRU_single_flush_scanned_per_call disabled
+buffer_LRU_single_flush_failure_count disabled
+buffer_LRU_get_free_search disabled
+buffer_LRU_search_scanned disabled
+buffer_LRU_search_num_scan disabled
+buffer_LRU_search_scanned_per_call disabled
+buffer_LRU_unzip_search_scanned disabled
+buffer_LRU_unzip_search_num_scan disabled
+buffer_LRU_unzip_search_scanned_per_call disabled
+buffer_page_read_index_leaf disabled
+buffer_page_read_index_non_leaf disabled
+buffer_page_read_index_ibuf_leaf disabled
+buffer_page_read_index_ibuf_non_leaf disabled
+buffer_page_read_undo_log disabled
+buffer_page_read_index_inode disabled
+buffer_page_read_ibuf_free_list disabled
+buffer_page_read_ibuf_bitmap disabled
+buffer_page_read_system_page disabled
+buffer_page_read_trx_system disabled
+buffer_page_read_fsp_hdr disabled
+buffer_page_read_xdes disabled
+buffer_page_read_blob disabled
+buffer_page_read_zblob disabled
+buffer_page_read_zblob2 disabled
+buffer_page_read_other disabled
+buffer_page_written_index_leaf disabled
+buffer_page_written_index_non_leaf disabled
+buffer_page_written_index_ibuf_leaf disabled
+buffer_page_written_index_ibuf_non_leaf disabled
+buffer_page_written_undo_log disabled
+buffer_page_written_index_inode disabled
+buffer_page_written_ibuf_free_list disabled
+buffer_page_written_ibuf_bitmap disabled
+buffer_page_written_system_page disabled
+buffer_page_written_trx_system disabled
+buffer_page_written_fsp_hdr disabled
+buffer_page_written_xdes disabled
+buffer_page_written_blob disabled
+buffer_page_written_zblob disabled
+buffer_page_written_zblob2 disabled
+buffer_page_written_other disabled
+os_data_reads disabled
+os_data_writes disabled
+os_data_fsyncs disabled
+os_pending_reads disabled
+os_pending_writes disabled
+os_log_bytes_written disabled
+os_log_fsyncs disabled
+os_log_pending_fsyncs disabled
+os_log_pending_writes disabled
+trx_rw_commits disabled
+trx_ro_commits disabled
+trx_nl_ro_commits disabled
+trx_commits_insert_update disabled
+trx_rollbacks disabled
+trx_rollbacks_savepoint disabled
+trx_rollback_active disabled
+trx_active_transactions disabled
+trx_rseg_history_len disabled
+trx_undo_slots_used disabled
+trx_undo_slots_cached disabled
+trx_rseg_current_size disabled
+purge_del_mark_records disabled
+purge_upd_exist_or_extern_records disabled
+purge_invoked disabled
+purge_undo_log_pages disabled
+purge_dml_delay_usec disabled
+purge_stop_count disabled
+purge_resume_count disabled
+log_checkpoints disabled
+log_lsn_last_flush disabled
+log_lsn_last_checkpoint disabled
+log_lsn_current disabled
+log_lsn_checkpoint_age disabled
+log_lsn_buf_pool_oldest disabled
+log_max_modified_age_async disabled
+log_max_modified_age_sync disabled
+log_pending_log_writes disabled
+log_pending_checkpoint_writes disabled
+log_num_log_io disabled
+log_waits disabled
+log_write_requests disabled
+log_writes disabled
+compress_pages_compressed disabled
+compress_pages_decompressed disabled
+compression_pad_increments disabled
+compression_pad_decrements disabled
+index_page_splits disabled
+index_page_merge_attempts disabled
+index_page_merge_successful disabled
+index_page_reorg_attempts disabled
+index_page_reorg_successful disabled
+index_page_discards disabled
+adaptive_hash_searches disabled
+adaptive_hash_searches_btree disabled
+adaptive_hash_pages_added disabled
+adaptive_hash_pages_removed disabled
+adaptive_hash_rows_added disabled
+adaptive_hash_rows_removed disabled
+adaptive_hash_rows_deleted_no_hash_entry disabled
+adaptive_hash_rows_updated disabled
+file_num_open_files disabled
+ibuf_merges_insert disabled
+ibuf_merges_delete_mark disabled
+ibuf_merges_delete disabled
+ibuf_merges_discard_insert disabled
+ibuf_merges_discard_delete_mark disabled
+ibuf_merges_discard_delete disabled
+ibuf_merges disabled
+ibuf_size disabled
+innodb_master_thread_sleeps disabled
+innodb_activity_count disabled
+innodb_master_active_loops disabled
+innodb_master_idle_loops disabled
+innodb_background_drop_table_usec disabled
+innodb_ibuf_merge_usec disabled
+innodb_log_flush_usec disabled
+innodb_mem_validate_usec disabled
+innodb_master_purge_usec disabled
+innodb_dict_lru_usec disabled
+innodb_checkpoint_usec disabled
+innodb_dblwr_writes disabled
+innodb_dblwr_pages_written disabled
+innodb_page_size disabled
+innodb_rwlock_s_spin_waits disabled
+innodb_rwlock_x_spin_waits disabled
+innodb_rwlock_s_spin_rounds disabled
+innodb_rwlock_x_spin_rounds disabled
+innodb_rwlock_s_os_waits disabled
+innodb_rwlock_x_os_waits disabled
+dml_reads disabled
+dml_inserts disabled
+dml_deletes disabled
+dml_updates disabled
+dml_system_reads disabled
+dml_system_inserts disabled
+dml_system_deletes disabled
+dml_system_updates disabled
+ddl_background_drop_indexes disabled
+ddl_background_drop_tables disabled
+ddl_online_create_index disabled
+ddl_pending_alter_table disabled
+icp_attempts disabled
+icp_no_match disabled
+icp_out_of_range disabled
+icp_match disabled
+set global innodb_monitor_enable = all;
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_enable = aaa;
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa'
+set global innodb_monitor_disable = All;
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_reset_all = all;
+select name from information_schema.innodb_metrics where count!=0;
+name
+set global innodb_monitor_enable = "%lock%";
+select name from information_schema.innodb_metrics
+where status != IF(name like "%lock%", 'enabled', 'disabled');
+name
+set global innodb_monitor_disable = "%lock%";
+select name, status from information_schema.innodb_metrics
+where name like "%lock%";
+name status
+lock_deadlocks disabled
+lock_timeouts disabled
+lock_rec_lock_waits disabled
+lock_table_lock_waits disabled
+lock_rec_lock_requests disabled
+lock_rec_lock_created disabled
+lock_rec_lock_removed disabled
+lock_rec_locks disabled
+lock_table_lock_created disabled
+lock_table_lock_removed disabled
+lock_table_locks disabled
+lock_row_lock_current_waits disabled
+lock_row_lock_time disabled
+lock_row_lock_time_max disabled
+lock_row_lock_waits disabled
+lock_row_lock_time_avg disabled
+innodb_rwlock_s_spin_waits disabled
+innodb_rwlock_x_spin_waits disabled
+innodb_rwlock_s_spin_rounds disabled
+innodb_rwlock_x_spin_rounds disabled
+innodb_rwlock_s_os_waits disabled
+innodb_rwlock_x_os_waits disabled
+set global innodb_monitor_enable = "%lock*";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
+set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_disable="%%%%%";
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_enable="%";
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_disable="%_%";
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_enable="log%%%%";
+select name from information_schema.innodb_metrics
+where status != IF(name like "log%", 'enabled', 'disabled');
+name
+set global innodb_monitor_enable="os_%a_fs_ncs";
+set global innodb_monitor_enable="os%pending%";
+select name, status from information_schema.innodb_metrics
+where name like "os%";
+name status
+os_data_reads disabled
+os_data_writes disabled
+os_data_fsyncs enabled
+os_pending_reads enabled
+os_pending_writes enabled
+os_log_bytes_written disabled
+os_log_fsyncs disabled
+os_log_pending_fsyncs enabled
+os_log_pending_writes enabled
+set global innodb_monitor_enable="";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
+set global innodb_monitor_enable="_";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_'
+SET global innodb_monitor_disable = module_metadata;
+SET global innodb_monitor_reset_all = module_metadata;
+set global innodb_monitor_enable = metadata_table_handles_opened;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
+set global innodb_monitor_reset = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
+set global innodb_monitor_disable = metadata_table_handles_opened;
+set global innodb_monitor_reset = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = metadata_table_handles_opened;
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb stats_persistent=0;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
+set global innodb_monitor_enable = metadata_table_handles_closed;
+create index idx on monitor_test(col);
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_closed";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled
+metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_disable = module_metadata;
+set global innodb_monitor_reset = module_metadata;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_reset_all = module_metadata;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
+metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = module_trx;
+begin;
+insert into monitor_test values(9);
+commit;
+begin;
+insert into monitor_test values(9);
+rollback;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "trx_rollbacks" or name like "trx_active_transactions";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+trx_rollbacks 1 NULL 1 1 NULL 1 enabled
+trx_active_transactions 1 0 0 1 0 0 enabled
+set global innodb_monitor_disable = module_trx;
+set global innodb_monitor_enable = module_dml;
+insert into monitor_test values(9);
+update monitor_test set col = 10 where col = 9;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 4 NULL 4 4 NULL 4 enabled
+dml_inserts 1 NULL 1 1 NULL 1 enabled
+dml_deletes 0 NULL 0 0 NULL 0 enabled
+dml_updates 2 NULL 2 2 NULL 2 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 6 NULL 6 6 NULL 6 enabled
+dml_inserts 1 NULL 1 1 NULL 1 enabled
+dml_deletes 2 NULL 2 2 NULL 2 enabled
+dml_updates 2 NULL 2 2 NULL 2 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_reset = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 6 NULL 6 0 NULL 0 enabled
+dml_inserts 1 NULL 1 0 NULL 0 enabled
+dml_deletes 2 NULL 2 0 NULL 0 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 enabled
+dml_inserts 3 NULL 3 2 NULL 2 enabled
+dml_deletes 4 NULL 4 2 NULL 2 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_reset_all = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 enabled
+dml_inserts 3 NULL 3 2 NULL 2 enabled
+dml_deletes 4 NULL 4 2 NULL 2 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_disable = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 disabled
+dml_inserts 3 NULL 3 2 NULL 2 disabled
+dml_deletes 4 NULL 4 2 NULL 2 disabled
+dml_updates 2 NULL 2 0 NULL 0 disabled
+dml_system_reads 0 NULL 0 0 NULL 0 disabled
+dml_system_inserts 0 NULL 0 0 NULL 0 disabled
+dml_system_deletes 0 NULL 0 0 NULL 0 disabled
+dml_system_updates 0 NULL 0 0 NULL 0 disabled
+set global innodb_monitor_reset_all = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads NULL NULL 0 NULL NULL 0 disabled
+dml_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_updates NULL NULL 0 NULL NULL 0 disabled
+dml_system_reads NULL NULL 0 NULL NULL 0 disabled
+dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_system_updates NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = dml_inserts;
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads NULL NULL 0 NULL NULL 0 disabled
+dml_inserts 2 NULL 2 2 NULL 2 enabled
+dml_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_updates NULL NULL 0 NULL NULL 0 disabled
+dml_system_reads NULL NULL 0 NULL NULL 0 disabled
+dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_system_updates NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_disable = module_dml;
+drop table monitor_test;
+set global innodb_monitor_enable = file_num_open_files;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "file_num_open_files";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+file_num_open_files # # # # # # enabled
+set global innodb_monitor_disable = file_num_open_files;
+set global innodb_monitor_enable = "icp%";
+create table monitor_test(a char(3), b int, c char(2),
+primary key (a(1), c(1)), key(b)) engine = innodb;
+insert into monitor_test values("13", 2, "aa");
+select a from monitor_test where b < 1 for update;
+a
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+name count
+icp_attempts 1
+icp_no_match 0
+icp_out_of_range 1
+icp_match 0
+select a from monitor_test where b < 3 for update;
+a
+13
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+name count
+icp_attempts 2
+icp_no_match 0
+icp_out_of_range 1
+icp_match 1
+drop table monitor_test;
+set global innodb_monitor_disable = All;
+set global innodb_monitor_reset_all = all;
+set global innodb_monitor_enable = default;
+set global innodb_monitor_disable = default;
+set global innodb_monitor_reset = default;
+set global innodb_monitor_reset_all = default;
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
new file mode 100644
index 00000000000..8c0af874228
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
@@ -0,0 +1,582 @@
+set global innodb_monitor_disable = All;
+select name, status from information_schema.innodb_metrics;
+name status
+metadata_table_handles_opened disabled
+metadata_table_handles_closed disabled
+metadata_table_reference_count disabled
+metadata_mem_pool_size disabled
+lock_deadlocks disabled
+lock_timeouts disabled
+lock_rec_lock_waits disabled
+lock_table_lock_waits disabled
+lock_rec_lock_requests disabled
+lock_rec_lock_created disabled
+lock_rec_lock_removed disabled
+lock_rec_locks disabled
+lock_table_lock_created disabled
+lock_table_lock_removed disabled
+lock_table_locks disabled
+lock_row_lock_current_waits disabled
+lock_row_lock_time disabled
+lock_row_lock_time_max disabled
+lock_row_lock_waits disabled
+lock_row_lock_time_avg disabled
+buffer_pool_size disabled
+buffer_pool_reads disabled
+buffer_pool_read_requests disabled
+buffer_pool_write_requests disabled
+buffer_pool_wait_free disabled
+buffer_pool_read_ahead disabled
+buffer_pool_read_ahead_evicted disabled
+buffer_pool_pages_total disabled
+buffer_pool_pages_misc disabled
+buffer_pool_pages_data disabled
+buffer_pool_bytes_data disabled
+buffer_pool_pages_dirty disabled
+buffer_pool_bytes_dirty disabled
+buffer_pool_pages_free disabled
+buffer_pages_created disabled
+buffer_pages_written disabled
+buffer_pages_read disabled
+buffer_data_reads disabled
+buffer_data_written disabled
+buffer_flush_batch_scanned disabled
+buffer_flush_batch_num_scan disabled
+buffer_flush_batch_scanned_per_call disabled
+buffer_flush_batch_rescan disabled
+buffer_flush_batch_total_pages disabled
+buffer_flush_batches disabled
+buffer_flush_batch_pages disabled
+buffer_flush_neighbor_total_pages disabled
+buffer_flush_neighbor disabled
+buffer_flush_neighbor_pages disabled
+buffer_flush_n_to_flush_requested disabled
+buffer_flush_avg_page_rate disabled
+buffer_flush_lsn_avg_rate disabled
+buffer_flush_pct_for_dirty disabled
+buffer_flush_pct_for_lsn disabled
+buffer_flush_sync_waits disabled
+buffer_flush_adaptive_total_pages disabled
+buffer_flush_adaptive disabled
+buffer_flush_adaptive_pages disabled
+buffer_flush_sync_total_pages disabled
+buffer_flush_sync disabled
+buffer_flush_sync_pages disabled
+buffer_flush_background_total_pages disabled
+buffer_flush_background disabled
+buffer_flush_background_pages disabled
+buffer_LRU_batch_scanned disabled
+buffer_LRU_batch_num_scan disabled
+buffer_LRU_batch_scanned_per_call disabled
+buffer_LRU_batch_total_pages disabled
+buffer_LRU_batches disabled
+buffer_LRU_batch_pages disabled
+buffer_LRU_single_flush_scanned disabled
+buffer_LRU_single_flush_num_scan disabled
+buffer_LRU_single_flush_scanned_per_call disabled
+buffer_LRU_single_flush_failure_count disabled
+buffer_LRU_get_free_search disabled
+buffer_LRU_search_scanned disabled
+buffer_LRU_search_num_scan disabled
+buffer_LRU_search_scanned_per_call disabled
+buffer_LRU_unzip_search_scanned disabled
+buffer_LRU_unzip_search_num_scan disabled
+buffer_LRU_unzip_search_scanned_per_call disabled
+buffer_page_read_index_leaf disabled
+buffer_page_read_index_non_leaf disabled
+buffer_page_read_index_ibuf_leaf disabled
+buffer_page_read_index_ibuf_non_leaf disabled
+buffer_page_read_undo_log disabled
+buffer_page_read_index_inode disabled
+buffer_page_read_ibuf_free_list disabled
+buffer_page_read_ibuf_bitmap disabled
+buffer_page_read_system_page disabled
+buffer_page_read_trx_system disabled
+buffer_page_read_fsp_hdr disabled
+buffer_page_read_xdes disabled
+buffer_page_read_blob disabled
+buffer_page_read_zblob disabled
+buffer_page_read_zblob2 disabled
+buffer_page_read_other disabled
+buffer_page_written_index_leaf disabled
+buffer_page_written_index_non_leaf disabled
+buffer_page_written_index_ibuf_leaf disabled
+buffer_page_written_index_ibuf_non_leaf disabled
+buffer_page_written_undo_log disabled
+buffer_page_written_index_inode disabled
+buffer_page_written_ibuf_free_list disabled
+buffer_page_written_ibuf_bitmap disabled
+buffer_page_written_system_page disabled
+buffer_page_written_trx_system disabled
+buffer_page_written_fsp_hdr disabled
+buffer_page_written_xdes disabled
+buffer_page_written_blob disabled
+buffer_page_written_zblob disabled
+buffer_page_written_zblob2 disabled
+buffer_page_written_other disabled
+os_data_reads disabled
+os_data_writes disabled
+os_data_fsyncs disabled
+os_pending_reads disabled
+os_pending_writes disabled
+os_log_bytes_written disabled
+os_log_fsyncs disabled
+os_log_pending_fsyncs disabled
+os_log_pending_writes disabled
+trx_rw_commits disabled
+trx_ro_commits disabled
+trx_nl_ro_commits disabled
+trx_commits_insert_update disabled
+trx_rollbacks disabled
+trx_rollbacks_savepoint disabled
+trx_rollback_active disabled
+trx_active_transactions disabled
+trx_rseg_history_len disabled
+trx_undo_slots_used disabled
+trx_undo_slots_cached disabled
+trx_rseg_current_size disabled
+purge_del_mark_records disabled
+purge_upd_exist_or_extern_records disabled
+purge_invoked disabled
+purge_undo_log_pages disabled
+purge_dml_delay_usec disabled
+purge_stop_count disabled
+purge_resume_count disabled
+log_checkpoints disabled
+log_lsn_last_flush disabled
+log_lsn_last_checkpoint disabled
+log_lsn_current disabled
+log_lsn_checkpoint_age disabled
+log_lsn_buf_pool_oldest disabled
+log_max_modified_age_async disabled
+log_max_modified_age_sync disabled
+log_pending_log_writes disabled
+log_pending_checkpoint_writes disabled
+log_num_log_io disabled
+log_waits disabled
+log_write_requests disabled
+log_writes disabled
+compress_pages_compressed disabled
+compress_pages_decompressed disabled
+compression_pad_increments disabled
+compression_pad_decrements disabled
+index_page_splits disabled
+index_page_merge_attempts disabled
+index_page_merge_successful disabled
+index_page_reorg_attempts disabled
+index_page_reorg_successful disabled
+index_page_discards disabled
+adaptive_hash_searches disabled
+adaptive_hash_searches_btree disabled
+adaptive_hash_pages_added disabled
+adaptive_hash_pages_removed disabled
+adaptive_hash_rows_added disabled
+adaptive_hash_rows_removed disabled
+adaptive_hash_rows_deleted_no_hash_entry disabled
+adaptive_hash_rows_updated disabled
+file_num_open_files disabled
+ibuf_merges_insert disabled
+ibuf_merges_delete_mark disabled
+ibuf_merges_delete disabled
+ibuf_merges_discard_insert disabled
+ibuf_merges_discard_delete_mark disabled
+ibuf_merges_discard_delete disabled
+ibuf_merges disabled
+ibuf_size disabled
+innodb_master_thread_sleeps disabled
+innodb_activity_count disabled
+innodb_master_active_loops disabled
+innodb_master_idle_loops disabled
+innodb_background_drop_table_usec disabled
+innodb_ibuf_merge_usec disabled
+innodb_log_flush_usec disabled
+innodb_mem_validate_usec disabled
+innodb_master_purge_usec disabled
+innodb_dict_lru_usec disabled
+innodb_checkpoint_usec disabled
+innodb_dblwr_writes disabled
+innodb_dblwr_pages_written disabled
+innodb_page_size disabled
+innodb_rwlock_s_spin_waits disabled
+innodb_rwlock_x_spin_waits disabled
+innodb_rwlock_s_spin_rounds disabled
+innodb_rwlock_x_spin_rounds disabled
+innodb_rwlock_s_os_waits disabled
+innodb_rwlock_x_os_waits disabled
+dml_reads disabled
+dml_inserts disabled
+dml_deletes disabled
+dml_updates disabled
+dml_system_reads disabled
+dml_system_inserts disabled
+dml_system_deletes disabled
+dml_system_updates disabled
+ddl_background_drop_indexes disabled
+ddl_background_drop_tables disabled
+ddl_online_create_index disabled
+ddl_pending_alter_table disabled
+icp_attempts disabled
+icp_no_match disabled
+icp_out_of_range disabled
+icp_match disabled
+set global innodb_monitor_enable = all;
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_enable = aaa;
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa'
+set global innodb_monitor_disable = All;
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_reset_all = all;
+select name from information_schema.innodb_metrics where count!=0;
+name
+set global innodb_monitor_enable = "%lock%";
+select name from information_schema.innodb_metrics
+where status != IF(name like "%lock%", 'enabled', 'disabled');
+name
+set global innodb_monitor_disable = "%lock%";
+select name, status from information_schema.innodb_metrics
+where name like "%lock%";
+name status
+lock_deadlocks disabled
+lock_timeouts disabled
+lock_rec_lock_waits disabled
+lock_table_lock_waits disabled
+lock_rec_lock_requests disabled
+lock_rec_lock_created disabled
+lock_rec_lock_removed disabled
+lock_rec_locks disabled
+lock_table_lock_created disabled
+lock_table_lock_removed disabled
+lock_table_locks disabled
+lock_row_lock_current_waits disabled
+lock_row_lock_time disabled
+lock_row_lock_time_max disabled
+lock_row_lock_waits disabled
+lock_row_lock_time_avg disabled
+innodb_rwlock_s_spin_waits disabled
+innodb_rwlock_x_spin_waits disabled
+innodb_rwlock_s_spin_rounds disabled
+innodb_rwlock_x_spin_rounds disabled
+innodb_rwlock_s_os_waits disabled
+innodb_rwlock_x_os_waits disabled
+set global innodb_monitor_enable = "%lock*";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
+set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_disable="%%%%%";
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_enable="%";
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_disable="%_%";
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_enable="log%%%%";
+select name from information_schema.innodb_metrics
+where status != IF(name like "log%", 'enabled', 'disabled');
+name
+set global innodb_monitor_enable="os_%a_fs_ncs";
+set global innodb_monitor_enable="os%pending%";
+select name, status from information_schema.innodb_metrics
+where name like "os%";
+name status
+os_data_reads disabled
+os_data_writes disabled
+os_data_fsyncs enabled
+os_pending_reads enabled
+os_pending_writes enabled
+os_log_bytes_written disabled
+os_log_fsyncs disabled
+os_log_pending_fsyncs enabled
+os_log_pending_writes enabled
+set global innodb_monitor_enable="";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
+set global innodb_monitor_enable="_";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_'
+SET global innodb_monitor_disable = module_metadata;
+SET global innodb_monitor_reset_all = module_metadata;
+set global innodb_monitor_enable = metadata_table_handles_opened;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
+set global innodb_monitor_reset = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
+set global innodb_monitor_disable = metadata_table_handles_opened;
+set global innodb_monitor_reset = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = metadata_table_handles_opened;
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb stats_persistent=0;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
+set global innodb_monitor_enable = metadata_table_handles_closed;
+create index idx on monitor_test(col);
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_closed";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled
+metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_disable = module_metadata;
+set global innodb_monitor_reset = module_metadata;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_reset_all = module_metadata;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
+metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = module_trx;
+begin;
+insert into monitor_test values(9);
+commit;
+begin;
+insert into monitor_test values(9);
+rollback;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "trx_rollbacks" or name like "trx_active_transactions";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+trx_rollbacks 1 NULL 1 1 NULL 1 enabled
+trx_active_transactions 1 0 0 1 0 0 enabled
+set global innodb_monitor_disable = module_trx;
+set global innodb_monitor_enable = module_dml;
+insert into monitor_test values(9);
+update monitor_test set col = 10 where col = 9;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 4 NULL 4 4 NULL 4 enabled
+dml_inserts 1 NULL 1 1 NULL 1 enabled
+dml_deletes 0 NULL 0 0 NULL 0 enabled
+dml_updates 2 NULL 2 2 NULL 2 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 6 NULL 6 6 NULL 6 enabled
+dml_inserts 1 NULL 1 1 NULL 1 enabled
+dml_deletes 2 NULL 2 2 NULL 2 enabled
+dml_updates 2 NULL 2 2 NULL 2 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_reset = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 6 NULL 6 0 NULL 0 enabled
+dml_inserts 1 NULL 1 0 NULL 0 enabled
+dml_deletes 2 NULL 2 0 NULL 0 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 enabled
+dml_inserts 3 NULL 3 2 NULL 2 enabled
+dml_deletes 4 NULL 4 2 NULL 2 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_reset_all = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 enabled
+dml_inserts 3 NULL 3 2 NULL 2 enabled
+dml_deletes 4 NULL 4 2 NULL 2 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_disable = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 disabled
+dml_inserts 3 NULL 3 2 NULL 2 disabled
+dml_deletes 4 NULL 4 2 NULL 2 disabled
+dml_updates 2 NULL 2 0 NULL 0 disabled
+dml_system_reads 0 NULL 0 0 NULL 0 disabled
+dml_system_inserts 0 NULL 0 0 NULL 0 disabled
+dml_system_deletes 0 NULL 0 0 NULL 0 disabled
+dml_system_updates 0 NULL 0 0 NULL 0 disabled
+set global innodb_monitor_reset_all = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads NULL NULL 0 NULL NULL 0 disabled
+dml_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_updates NULL NULL 0 NULL NULL 0 disabled
+dml_system_reads NULL NULL 0 NULL NULL 0 disabled
+dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_system_updates NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = dml_inserts;
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads NULL NULL 0 NULL NULL 0 disabled
+dml_inserts 2 NULL 2 2 NULL 2 enabled
+dml_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_updates NULL NULL 0 NULL NULL 0 disabled
+dml_system_reads NULL NULL 0 NULL NULL 0 disabled
+dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_system_updates NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_disable = module_dml;
+drop table monitor_test;
+set global innodb_monitor_enable = file_num_open_files;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "file_num_open_files";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+file_num_open_files # # # # # # enabled
+set global innodb_monitor_disable = file_num_open_files;
+set global innodb_monitor_enable = "icp%";
+create table monitor_test(a char(3), b int, c char(2),
+primary key (a(1), c(1)), key(b)) engine = innodb;
+insert into monitor_test values("13", 2, "aa");
+select a from monitor_test where b < 1 for update;
+a
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+name count
+icp_attempts 1
+icp_no_match 0
+icp_out_of_range 1
+icp_match 0
+select a from monitor_test where b < 3 for update;
+a
+13
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+name count
+icp_attempts 2
+icp_no_match 0
+icp_out_of_range 1
+icp_match 1
+drop table monitor_test;
+set global innodb_monitor_disable = All;
+set global innodb_monitor_reset_all = all;
+set global innodb_monitor_enable = default;
+set global innodb_monitor_disable = default;
+set global innodb_monitor_reset = default;
+set global innodb_monitor_reset_all = default;
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
new file mode 100644
index 00000000000..8c0af874228
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
@@ -0,0 +1,582 @@
+set global innodb_monitor_disable = All;
+select name, status from information_schema.innodb_metrics;
+name status
+metadata_table_handles_opened disabled
+metadata_table_handles_closed disabled
+metadata_table_reference_count disabled
+metadata_mem_pool_size disabled
+lock_deadlocks disabled
+lock_timeouts disabled
+lock_rec_lock_waits disabled
+lock_table_lock_waits disabled
+lock_rec_lock_requests disabled
+lock_rec_lock_created disabled
+lock_rec_lock_removed disabled
+lock_rec_locks disabled
+lock_table_lock_created disabled
+lock_table_lock_removed disabled
+lock_table_locks disabled
+lock_row_lock_current_waits disabled
+lock_row_lock_time disabled
+lock_row_lock_time_max disabled
+lock_row_lock_waits disabled
+lock_row_lock_time_avg disabled
+buffer_pool_size disabled
+buffer_pool_reads disabled
+buffer_pool_read_requests disabled
+buffer_pool_write_requests disabled
+buffer_pool_wait_free disabled
+buffer_pool_read_ahead disabled
+buffer_pool_read_ahead_evicted disabled
+buffer_pool_pages_total disabled
+buffer_pool_pages_misc disabled
+buffer_pool_pages_data disabled
+buffer_pool_bytes_data disabled
+buffer_pool_pages_dirty disabled
+buffer_pool_bytes_dirty disabled
+buffer_pool_pages_free disabled
+buffer_pages_created disabled
+buffer_pages_written disabled
+buffer_pages_read disabled
+buffer_data_reads disabled
+buffer_data_written disabled
+buffer_flush_batch_scanned disabled
+buffer_flush_batch_num_scan disabled
+buffer_flush_batch_scanned_per_call disabled
+buffer_flush_batch_rescan disabled
+buffer_flush_batch_total_pages disabled
+buffer_flush_batches disabled
+buffer_flush_batch_pages disabled
+buffer_flush_neighbor_total_pages disabled
+buffer_flush_neighbor disabled
+buffer_flush_neighbor_pages disabled
+buffer_flush_n_to_flush_requested disabled
+buffer_flush_avg_page_rate disabled
+buffer_flush_lsn_avg_rate disabled
+buffer_flush_pct_for_dirty disabled
+buffer_flush_pct_for_lsn disabled
+buffer_flush_sync_waits disabled
+buffer_flush_adaptive_total_pages disabled
+buffer_flush_adaptive disabled
+buffer_flush_adaptive_pages disabled
+buffer_flush_sync_total_pages disabled
+buffer_flush_sync disabled
+buffer_flush_sync_pages disabled
+buffer_flush_background_total_pages disabled
+buffer_flush_background disabled
+buffer_flush_background_pages disabled
+buffer_LRU_batch_scanned disabled
+buffer_LRU_batch_num_scan disabled
+buffer_LRU_batch_scanned_per_call disabled
+buffer_LRU_batch_total_pages disabled
+buffer_LRU_batches disabled
+buffer_LRU_batch_pages disabled
+buffer_LRU_single_flush_scanned disabled
+buffer_LRU_single_flush_num_scan disabled
+buffer_LRU_single_flush_scanned_per_call disabled
+buffer_LRU_single_flush_failure_count disabled
+buffer_LRU_get_free_search disabled
+buffer_LRU_search_scanned disabled
+buffer_LRU_search_num_scan disabled
+buffer_LRU_search_scanned_per_call disabled
+buffer_LRU_unzip_search_scanned disabled
+buffer_LRU_unzip_search_num_scan disabled
+buffer_LRU_unzip_search_scanned_per_call disabled
+buffer_page_read_index_leaf disabled
+buffer_page_read_index_non_leaf disabled
+buffer_page_read_index_ibuf_leaf disabled
+buffer_page_read_index_ibuf_non_leaf disabled
+buffer_page_read_undo_log disabled
+buffer_page_read_index_inode disabled
+buffer_page_read_ibuf_free_list disabled
+buffer_page_read_ibuf_bitmap disabled
+buffer_page_read_system_page disabled
+buffer_page_read_trx_system disabled
+buffer_page_read_fsp_hdr disabled
+buffer_page_read_xdes disabled
+buffer_page_read_blob disabled
+buffer_page_read_zblob disabled
+buffer_page_read_zblob2 disabled
+buffer_page_read_other disabled
+buffer_page_written_index_leaf disabled
+buffer_page_written_index_non_leaf disabled
+buffer_page_written_index_ibuf_leaf disabled
+buffer_page_written_index_ibuf_non_leaf disabled
+buffer_page_written_undo_log disabled
+buffer_page_written_index_inode disabled
+buffer_page_written_ibuf_free_list disabled
+buffer_page_written_ibuf_bitmap disabled
+buffer_page_written_system_page disabled
+buffer_page_written_trx_system disabled
+buffer_page_written_fsp_hdr disabled
+buffer_page_written_xdes disabled
+buffer_page_written_blob disabled
+buffer_page_written_zblob disabled
+buffer_page_written_zblob2 disabled
+buffer_page_written_other disabled
+os_data_reads disabled
+os_data_writes disabled
+os_data_fsyncs disabled
+os_pending_reads disabled
+os_pending_writes disabled
+os_log_bytes_written disabled
+os_log_fsyncs disabled
+os_log_pending_fsyncs disabled
+os_log_pending_writes disabled
+trx_rw_commits disabled
+trx_ro_commits disabled
+trx_nl_ro_commits disabled
+trx_commits_insert_update disabled
+trx_rollbacks disabled
+trx_rollbacks_savepoint disabled
+trx_rollback_active disabled
+trx_active_transactions disabled
+trx_rseg_history_len disabled
+trx_undo_slots_used disabled
+trx_undo_slots_cached disabled
+trx_rseg_current_size disabled
+purge_del_mark_records disabled
+purge_upd_exist_or_extern_records disabled
+purge_invoked disabled
+purge_undo_log_pages disabled
+purge_dml_delay_usec disabled
+purge_stop_count disabled
+purge_resume_count disabled
+log_checkpoints disabled
+log_lsn_last_flush disabled
+log_lsn_last_checkpoint disabled
+log_lsn_current disabled
+log_lsn_checkpoint_age disabled
+log_lsn_buf_pool_oldest disabled
+log_max_modified_age_async disabled
+log_max_modified_age_sync disabled
+log_pending_log_writes disabled
+log_pending_checkpoint_writes disabled
+log_num_log_io disabled
+log_waits disabled
+log_write_requests disabled
+log_writes disabled
+compress_pages_compressed disabled
+compress_pages_decompressed disabled
+compression_pad_increments disabled
+compression_pad_decrements disabled
+index_page_splits disabled
+index_page_merge_attempts disabled
+index_page_merge_successful disabled
+index_page_reorg_attempts disabled
+index_page_reorg_successful disabled
+index_page_discards disabled
+adaptive_hash_searches disabled
+adaptive_hash_searches_btree disabled
+adaptive_hash_pages_added disabled
+adaptive_hash_pages_removed disabled
+adaptive_hash_rows_added disabled
+adaptive_hash_rows_removed disabled
+adaptive_hash_rows_deleted_no_hash_entry disabled
+adaptive_hash_rows_updated disabled
+file_num_open_files disabled
+ibuf_merges_insert disabled
+ibuf_merges_delete_mark disabled
+ibuf_merges_delete disabled
+ibuf_merges_discard_insert disabled
+ibuf_merges_discard_delete_mark disabled
+ibuf_merges_discard_delete disabled
+ibuf_merges disabled
+ibuf_size disabled
+innodb_master_thread_sleeps disabled
+innodb_activity_count disabled
+innodb_master_active_loops disabled
+innodb_master_idle_loops disabled
+innodb_background_drop_table_usec disabled
+innodb_ibuf_merge_usec disabled
+innodb_log_flush_usec disabled
+innodb_mem_validate_usec disabled
+innodb_master_purge_usec disabled
+innodb_dict_lru_usec disabled
+innodb_checkpoint_usec disabled
+innodb_dblwr_writes disabled
+innodb_dblwr_pages_written disabled
+innodb_page_size disabled
+innodb_rwlock_s_spin_waits disabled
+innodb_rwlock_x_spin_waits disabled
+innodb_rwlock_s_spin_rounds disabled
+innodb_rwlock_x_spin_rounds disabled
+innodb_rwlock_s_os_waits disabled
+innodb_rwlock_x_os_waits disabled
+dml_reads disabled
+dml_inserts disabled
+dml_deletes disabled
+dml_updates disabled
+dml_system_reads disabled
+dml_system_inserts disabled
+dml_system_deletes disabled
+dml_system_updates disabled
+ddl_background_drop_indexes disabled
+ddl_background_drop_tables disabled
+ddl_online_create_index disabled
+ddl_pending_alter_table disabled
+icp_attempts disabled
+icp_no_match disabled
+icp_out_of_range disabled
+icp_match disabled
+set global innodb_monitor_enable = all;
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_enable = aaa;
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa'
+set global innodb_monitor_disable = All;
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_reset_all = all;
+select name from information_schema.innodb_metrics where count!=0;
+name
+set global innodb_monitor_enable = "%lock%";
+select name from information_schema.innodb_metrics
+where status != IF(name like "%lock%", 'enabled', 'disabled');
+name
+set global innodb_monitor_disable = "%lock%";
+select name, status from information_schema.innodb_metrics
+where name like "%lock%";
+name status
+lock_deadlocks disabled
+lock_timeouts disabled
+lock_rec_lock_waits disabled
+lock_table_lock_waits disabled
+lock_rec_lock_requests disabled
+lock_rec_lock_created disabled
+lock_rec_lock_removed disabled
+lock_rec_locks disabled
+lock_table_lock_created disabled
+lock_table_lock_removed disabled
+lock_table_locks disabled
+lock_row_lock_current_waits disabled
+lock_row_lock_time disabled
+lock_row_lock_time_max disabled
+lock_row_lock_waits disabled
+lock_row_lock_time_avg disabled
+innodb_rwlock_s_spin_waits disabled
+innodb_rwlock_x_spin_waits disabled
+innodb_rwlock_s_spin_rounds disabled
+innodb_rwlock_x_spin_rounds disabled
+innodb_rwlock_s_os_waits disabled
+innodb_rwlock_x_os_waits disabled
+set global innodb_monitor_enable = "%lock*";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
+set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_disable="%%%%%";
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_enable="%";
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_disable="%_%";
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_enable="log%%%%";
+select name from information_schema.innodb_metrics
+where status != IF(name like "log%", 'enabled', 'disabled');
+name
+set global innodb_monitor_enable="os_%a_fs_ncs";
+set global innodb_monitor_enable="os%pending%";
+select name, status from information_schema.innodb_metrics
+where name like "os%";
+name status
+os_data_reads disabled
+os_data_writes disabled
+os_data_fsyncs enabled
+os_pending_reads enabled
+os_pending_writes enabled
+os_log_bytes_written disabled
+os_log_fsyncs disabled
+os_log_pending_fsyncs enabled
+os_log_pending_writes enabled
+set global innodb_monitor_enable="";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
+set global innodb_monitor_enable="_";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_'
+SET global innodb_monitor_disable = module_metadata;
+SET global innodb_monitor_reset_all = module_metadata;
+set global innodb_monitor_enable = metadata_table_handles_opened;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
+set global innodb_monitor_reset = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
+set global innodb_monitor_disable = metadata_table_handles_opened;
+set global innodb_monitor_reset = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = metadata_table_handles_opened;
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb stats_persistent=0;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
+set global innodb_monitor_enable = metadata_table_handles_closed;
+create index idx on monitor_test(col);
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_closed";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled
+metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_disable = module_metadata;
+set global innodb_monitor_reset = module_metadata;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_reset_all = module_metadata;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
+metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = module_trx;
+begin;
+insert into monitor_test values(9);
+commit;
+begin;
+insert into monitor_test values(9);
+rollback;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "trx_rollbacks" or name like "trx_active_transactions";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+trx_rollbacks 1 NULL 1 1 NULL 1 enabled
+trx_active_transactions 1 0 0 1 0 0 enabled
+set global innodb_monitor_disable = module_trx;
+set global innodb_monitor_enable = module_dml;
+insert into monitor_test values(9);
+update monitor_test set col = 10 where col = 9;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 4 NULL 4 4 NULL 4 enabled
+dml_inserts 1 NULL 1 1 NULL 1 enabled
+dml_deletes 0 NULL 0 0 NULL 0 enabled
+dml_updates 2 NULL 2 2 NULL 2 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 6 NULL 6 6 NULL 6 enabled
+dml_inserts 1 NULL 1 1 NULL 1 enabled
+dml_deletes 2 NULL 2 2 NULL 2 enabled
+dml_updates 2 NULL 2 2 NULL 2 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_reset = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 6 NULL 6 0 NULL 0 enabled
+dml_inserts 1 NULL 1 0 NULL 0 enabled
+dml_deletes 2 NULL 2 0 NULL 0 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 enabled
+dml_inserts 3 NULL 3 2 NULL 2 enabled
+dml_deletes 4 NULL 4 2 NULL 2 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_reset_all = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 enabled
+dml_inserts 3 NULL 3 2 NULL 2 enabled
+dml_deletes 4 NULL 4 2 NULL 2 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_disable = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 disabled
+dml_inserts 3 NULL 3 2 NULL 2 disabled
+dml_deletes 4 NULL 4 2 NULL 2 disabled
+dml_updates 2 NULL 2 0 NULL 0 disabled
+dml_system_reads 0 NULL 0 0 NULL 0 disabled
+dml_system_inserts 0 NULL 0 0 NULL 0 disabled
+dml_system_deletes 0 NULL 0 0 NULL 0 disabled
+dml_system_updates 0 NULL 0 0 NULL 0 disabled
+set global innodb_monitor_reset_all = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads NULL NULL 0 NULL NULL 0 disabled
+dml_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_updates NULL NULL 0 NULL NULL 0 disabled
+dml_system_reads NULL NULL 0 NULL NULL 0 disabled
+dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_system_updates NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = dml_inserts;
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads NULL NULL 0 NULL NULL 0 disabled
+dml_inserts 2 NULL 2 2 NULL 2 enabled
+dml_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_updates NULL NULL 0 NULL NULL 0 disabled
+dml_system_reads NULL NULL 0 NULL NULL 0 disabled
+dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_system_updates NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_disable = module_dml;
+drop table monitor_test;
+set global innodb_monitor_enable = file_num_open_files;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "file_num_open_files";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+file_num_open_files # # # # # # enabled
+set global innodb_monitor_disable = file_num_open_files;
+set global innodb_monitor_enable = "icp%";
+create table monitor_test(a char(3), b int, c char(2),
+primary key (a(1), c(1)), key(b)) engine = innodb;
+insert into monitor_test values("13", 2, "aa");
+select a from monitor_test where b < 1 for update;
+a
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+name count
+icp_attempts 1
+icp_no_match 0
+icp_out_of_range 1
+icp_match 0
+select a from monitor_test where b < 3 for update;
+a
+13
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+name count
+icp_attempts 2
+icp_no_match 0
+icp_out_of_range 1
+icp_match 1
+drop table monitor_test;
+set global innodb_monitor_disable = All;
+set global innodb_monitor_reset_all = all;
+set global innodb_monitor_enable = default;
+set global innodb_monitor_disable = default;
+set global innodb_monitor_reset = default;
+set global innodb_monitor_reset_all = default;
diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
new file mode 100644
index 00000000000..8c0af874228
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
@@ -0,0 +1,582 @@
+set global innodb_monitor_disable = All;
+select name, status from information_schema.innodb_metrics;
+name status
+metadata_table_handles_opened disabled
+metadata_table_handles_closed disabled
+metadata_table_reference_count disabled
+metadata_mem_pool_size disabled
+lock_deadlocks disabled
+lock_timeouts disabled
+lock_rec_lock_waits disabled
+lock_table_lock_waits disabled
+lock_rec_lock_requests disabled
+lock_rec_lock_created disabled
+lock_rec_lock_removed disabled
+lock_rec_locks disabled
+lock_table_lock_created disabled
+lock_table_lock_removed disabled
+lock_table_locks disabled
+lock_row_lock_current_waits disabled
+lock_row_lock_time disabled
+lock_row_lock_time_max disabled
+lock_row_lock_waits disabled
+lock_row_lock_time_avg disabled
+buffer_pool_size disabled
+buffer_pool_reads disabled
+buffer_pool_read_requests disabled
+buffer_pool_write_requests disabled
+buffer_pool_wait_free disabled
+buffer_pool_read_ahead disabled
+buffer_pool_read_ahead_evicted disabled
+buffer_pool_pages_total disabled
+buffer_pool_pages_misc disabled
+buffer_pool_pages_data disabled
+buffer_pool_bytes_data disabled
+buffer_pool_pages_dirty disabled
+buffer_pool_bytes_dirty disabled
+buffer_pool_pages_free disabled
+buffer_pages_created disabled
+buffer_pages_written disabled
+buffer_pages_read disabled
+buffer_data_reads disabled
+buffer_data_written disabled
+buffer_flush_batch_scanned disabled
+buffer_flush_batch_num_scan disabled
+buffer_flush_batch_scanned_per_call disabled
+buffer_flush_batch_rescan disabled
+buffer_flush_batch_total_pages disabled
+buffer_flush_batches disabled
+buffer_flush_batch_pages disabled
+buffer_flush_neighbor_total_pages disabled
+buffer_flush_neighbor disabled
+buffer_flush_neighbor_pages disabled
+buffer_flush_n_to_flush_requested disabled
+buffer_flush_avg_page_rate disabled
+buffer_flush_lsn_avg_rate disabled
+buffer_flush_pct_for_dirty disabled
+buffer_flush_pct_for_lsn disabled
+buffer_flush_sync_waits disabled
+buffer_flush_adaptive_total_pages disabled
+buffer_flush_adaptive disabled
+buffer_flush_adaptive_pages disabled
+buffer_flush_sync_total_pages disabled
+buffer_flush_sync disabled
+buffer_flush_sync_pages disabled
+buffer_flush_background_total_pages disabled
+buffer_flush_background disabled
+buffer_flush_background_pages disabled
+buffer_LRU_batch_scanned disabled
+buffer_LRU_batch_num_scan disabled
+buffer_LRU_batch_scanned_per_call disabled
+buffer_LRU_batch_total_pages disabled
+buffer_LRU_batches disabled
+buffer_LRU_batch_pages disabled
+buffer_LRU_single_flush_scanned disabled
+buffer_LRU_single_flush_num_scan disabled
+buffer_LRU_single_flush_scanned_per_call disabled
+buffer_LRU_single_flush_failure_count disabled
+buffer_LRU_get_free_search disabled
+buffer_LRU_search_scanned disabled
+buffer_LRU_search_num_scan disabled
+buffer_LRU_search_scanned_per_call disabled
+buffer_LRU_unzip_search_scanned disabled
+buffer_LRU_unzip_search_num_scan disabled
+buffer_LRU_unzip_search_scanned_per_call disabled
+buffer_page_read_index_leaf disabled
+buffer_page_read_index_non_leaf disabled
+buffer_page_read_index_ibuf_leaf disabled
+buffer_page_read_index_ibuf_non_leaf disabled
+buffer_page_read_undo_log disabled
+buffer_page_read_index_inode disabled
+buffer_page_read_ibuf_free_list disabled
+buffer_page_read_ibuf_bitmap disabled
+buffer_page_read_system_page disabled
+buffer_page_read_trx_system disabled
+buffer_page_read_fsp_hdr disabled
+buffer_page_read_xdes disabled
+buffer_page_read_blob disabled
+buffer_page_read_zblob disabled
+buffer_page_read_zblob2 disabled
+buffer_page_read_other disabled
+buffer_page_written_index_leaf disabled
+buffer_page_written_index_non_leaf disabled
+buffer_page_written_index_ibuf_leaf disabled
+buffer_page_written_index_ibuf_non_leaf disabled
+buffer_page_written_undo_log disabled
+buffer_page_written_index_inode disabled
+buffer_page_written_ibuf_free_list disabled
+buffer_page_written_ibuf_bitmap disabled
+buffer_page_written_system_page disabled
+buffer_page_written_trx_system disabled
+buffer_page_written_fsp_hdr disabled
+buffer_page_written_xdes disabled
+buffer_page_written_blob disabled
+buffer_page_written_zblob disabled
+buffer_page_written_zblob2 disabled
+buffer_page_written_other disabled
+os_data_reads disabled
+os_data_writes disabled
+os_data_fsyncs disabled
+os_pending_reads disabled
+os_pending_writes disabled
+os_log_bytes_written disabled
+os_log_fsyncs disabled
+os_log_pending_fsyncs disabled
+os_log_pending_writes disabled
+trx_rw_commits disabled
+trx_ro_commits disabled
+trx_nl_ro_commits disabled
+trx_commits_insert_update disabled
+trx_rollbacks disabled
+trx_rollbacks_savepoint disabled
+trx_rollback_active disabled
+trx_active_transactions disabled
+trx_rseg_history_len disabled
+trx_undo_slots_used disabled
+trx_undo_slots_cached disabled
+trx_rseg_current_size disabled
+purge_del_mark_records disabled
+purge_upd_exist_or_extern_records disabled
+purge_invoked disabled
+purge_undo_log_pages disabled
+purge_dml_delay_usec disabled
+purge_stop_count disabled
+purge_resume_count disabled
+log_checkpoints disabled
+log_lsn_last_flush disabled
+log_lsn_last_checkpoint disabled
+log_lsn_current disabled
+log_lsn_checkpoint_age disabled
+log_lsn_buf_pool_oldest disabled
+log_max_modified_age_async disabled
+log_max_modified_age_sync disabled
+log_pending_log_writes disabled
+log_pending_checkpoint_writes disabled
+log_num_log_io disabled
+log_waits disabled
+log_write_requests disabled
+log_writes disabled
+compress_pages_compressed disabled
+compress_pages_decompressed disabled
+compression_pad_increments disabled
+compression_pad_decrements disabled
+index_page_splits disabled
+index_page_merge_attempts disabled
+index_page_merge_successful disabled
+index_page_reorg_attempts disabled
+index_page_reorg_successful disabled
+index_page_discards disabled
+adaptive_hash_searches disabled
+adaptive_hash_searches_btree disabled
+adaptive_hash_pages_added disabled
+adaptive_hash_pages_removed disabled
+adaptive_hash_rows_added disabled
+adaptive_hash_rows_removed disabled
+adaptive_hash_rows_deleted_no_hash_entry disabled
+adaptive_hash_rows_updated disabled
+file_num_open_files disabled
+ibuf_merges_insert disabled
+ibuf_merges_delete_mark disabled
+ibuf_merges_delete disabled
+ibuf_merges_discard_insert disabled
+ibuf_merges_discard_delete_mark disabled
+ibuf_merges_discard_delete disabled
+ibuf_merges disabled
+ibuf_size disabled
+innodb_master_thread_sleeps disabled
+innodb_activity_count disabled
+innodb_master_active_loops disabled
+innodb_master_idle_loops disabled
+innodb_background_drop_table_usec disabled
+innodb_ibuf_merge_usec disabled
+innodb_log_flush_usec disabled
+innodb_mem_validate_usec disabled
+innodb_master_purge_usec disabled
+innodb_dict_lru_usec disabled
+innodb_checkpoint_usec disabled
+innodb_dblwr_writes disabled
+innodb_dblwr_pages_written disabled
+innodb_page_size disabled
+innodb_rwlock_s_spin_waits disabled
+innodb_rwlock_x_spin_waits disabled
+innodb_rwlock_s_spin_rounds disabled
+innodb_rwlock_x_spin_rounds disabled
+innodb_rwlock_s_os_waits disabled
+innodb_rwlock_x_os_waits disabled
+dml_reads disabled
+dml_inserts disabled
+dml_deletes disabled
+dml_updates disabled
+dml_system_reads disabled
+dml_system_inserts disabled
+dml_system_deletes disabled
+dml_system_updates disabled
+ddl_background_drop_indexes disabled
+ddl_background_drop_tables disabled
+ddl_online_create_index disabled
+ddl_pending_alter_table disabled
+icp_attempts disabled
+icp_no_match disabled
+icp_out_of_range disabled
+icp_match disabled
+set global innodb_monitor_enable = all;
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_enable = aaa;
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of 'aaa'
+set global innodb_monitor_disable = All;
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_reset_all = all;
+select name from information_schema.innodb_metrics where count!=0;
+name
+set global innodb_monitor_enable = "%lock%";
+select name from information_schema.innodb_metrics
+where status != IF(name like "%lock%", 'enabled', 'disabled');
+name
+set global innodb_monitor_disable = "%lock%";
+select name, status from information_schema.innodb_metrics
+where name like "%lock%";
+name status
+lock_deadlocks disabled
+lock_timeouts disabled
+lock_rec_lock_waits disabled
+lock_table_lock_waits disabled
+lock_rec_lock_requests disabled
+lock_rec_lock_created disabled
+lock_rec_lock_removed disabled
+lock_rec_locks disabled
+lock_table_lock_created disabled
+lock_table_lock_removed disabled
+lock_table_locks disabled
+lock_row_lock_current_waits disabled
+lock_row_lock_time disabled
+lock_row_lock_time_max disabled
+lock_row_lock_waits disabled
+lock_row_lock_time_avg disabled
+innodb_rwlock_s_spin_waits disabled
+innodb_rwlock_x_spin_waits disabled
+innodb_rwlock_s_spin_rounds disabled
+innodb_rwlock_x_spin_rounds disabled
+innodb_rwlock_s_os_waits disabled
+innodb_rwlock_x_os_waits disabled
+set global innodb_monitor_enable = "%lock*";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '%lock*'
+set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_disable="%%%%%";
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_enable="%";
+select name from information_schema.innodb_metrics where status!='enabled';
+name
+set global innodb_monitor_disable="%_%";
+select name from information_schema.innodb_metrics where status!='disabled';
+name
+set global innodb_monitor_enable="log%%%%";
+select name from information_schema.innodb_metrics
+where status != IF(name like "log%", 'enabled', 'disabled');
+name
+set global innodb_monitor_enable="os_%a_fs_ncs";
+set global innodb_monitor_enable="os%pending%";
+select name, status from information_schema.innodb_metrics
+where name like "os%";
+name status
+os_data_reads disabled
+os_data_writes disabled
+os_data_fsyncs enabled
+os_pending_reads enabled
+os_pending_writes enabled
+os_log_bytes_written disabled
+os_log_fsyncs disabled
+os_log_pending_fsyncs enabled
+os_log_pending_writes enabled
+set global innodb_monitor_enable="";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
+set global innodb_monitor_enable="_";
+ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of '_'
+SET global innodb_monitor_disable = module_metadata;
+SET global innodb_monitor_reset_all = module_metadata;
+set global innodb_monitor_enable = metadata_table_handles_opened;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
+set global innodb_monitor_reset = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 NULL NULL 0 enabled
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 1 NULL 1 enabled
+set global innodb_monitor_disable = metadata_table_handles_opened;
+set global innodb_monitor_reset = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = metadata_table_handles_opened;
+drop table monitor_test;
+create table monitor_test(col int) engine = innodb stats_persistent=0;
+select * from monitor_test;
+col
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 1 NULL 1 1 NULL 1 enabled
+set global innodb_monitor_enable = metadata_table_handles_closed;
+create index idx on monitor_test(col);
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_closed";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 2 NULL 2 enabled
+metadata_table_handles_closed 1 NULL 1 1 NULL 1 enabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_disable = module_metadata;
+set global innodb_monitor_reset = module_metadata;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened 2 NULL 2 NULL NULL 0 disabled
+metadata_table_handles_closed 1 NULL 1 NULL NULL 0 disabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_reset_all = module_metadata;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+metadata_table_handles_opened NULL NULL 0 NULL NULL 0 disabled
+metadata_table_handles_closed NULL NULL 0 NULL NULL 0 disabled
+metadata_table_reference_count NULL NULL 0 NULL NULL 0 disabled
+metadata_mem_pool_size NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = module_trx;
+begin;
+insert into monitor_test values(9);
+commit;
+begin;
+insert into monitor_test values(9);
+rollback;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "trx_rollbacks" or name like "trx_active_transactions";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+trx_rollbacks 1 NULL 1 1 NULL 1 enabled
+trx_active_transactions 1 0 0 1 0 0 enabled
+set global innodb_monitor_disable = module_trx;
+set global innodb_monitor_enable = module_dml;
+insert into monitor_test values(9);
+update monitor_test set col = 10 where col = 9;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 4 NULL 4 4 NULL 4 enabled
+dml_inserts 1 NULL 1 1 NULL 1 enabled
+dml_deletes 0 NULL 0 0 NULL 0 enabled
+dml_updates 2 NULL 2 2 NULL 2 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 6 NULL 6 6 NULL 6 enabled
+dml_inserts 1 NULL 1 1 NULL 1 enabled
+dml_deletes 2 NULL 2 2 NULL 2 enabled
+dml_updates 2 NULL 2 2 NULL 2 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_reset = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 6 NULL 6 0 NULL 0 enabled
+dml_inserts 1 NULL 1 0 NULL 0 enabled
+dml_deletes 2 NULL 2 0 NULL 0 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 enabled
+dml_inserts 3 NULL 3 2 NULL 2 enabled
+dml_deletes 4 NULL 4 2 NULL 2 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_reset_all = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 enabled
+dml_inserts 3 NULL 3 2 NULL 2 enabled
+dml_deletes 4 NULL 4 2 NULL 2 enabled
+dml_updates 2 NULL 2 0 NULL 0 enabled
+dml_system_reads 0 NULL 0 0 NULL 0 enabled
+dml_system_inserts 0 NULL 0 0 NULL 0 enabled
+dml_system_deletes 0 NULL 0 0 NULL 0 enabled
+dml_system_updates 0 NULL 0 0 NULL 0 enabled
+set global innodb_monitor_disable = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads 8 NULL 8 2 NULL 2 disabled
+dml_inserts 3 NULL 3 2 NULL 2 disabled
+dml_deletes 4 NULL 4 2 NULL 2 disabled
+dml_updates 2 NULL 2 0 NULL 0 disabled
+dml_system_reads 0 NULL 0 0 NULL 0 disabled
+dml_system_inserts 0 NULL 0 0 NULL 0 disabled
+dml_system_deletes 0 NULL 0 0 NULL 0 disabled
+dml_system_updates 0 NULL 0 0 NULL 0 disabled
+set global innodb_monitor_reset_all = module_dml;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads NULL NULL 0 NULL NULL 0 disabled
+dml_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_updates NULL NULL 0 NULL NULL 0 disabled
+dml_system_reads NULL NULL 0 NULL NULL 0 disabled
+dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_system_updates NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_enable = dml_inserts;
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+delete from monitor_test;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+dml_reads NULL NULL 0 NULL NULL 0 disabled
+dml_inserts 2 NULL 2 2 NULL 2 enabled
+dml_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_updates NULL NULL 0 NULL NULL 0 disabled
+dml_system_reads NULL NULL 0 NULL NULL 0 disabled
+dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
+dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
+dml_system_updates NULL NULL 0 NULL NULL 0 disabled
+set global innodb_monitor_disable = module_dml;
+drop table monitor_test;
+set global innodb_monitor_enable = file_num_open_files;
+select name, max_count, min_count, count,
+max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "file_num_open_files";
+name max_count min_count count max_count_reset min_count_reset count_reset status
+file_num_open_files # # # # # # enabled
+set global innodb_monitor_disable = file_num_open_files;
+set global innodb_monitor_enable = "icp%";
+create table monitor_test(a char(3), b int, c char(2),
+primary key (a(1), c(1)), key(b)) engine = innodb;
+insert into monitor_test values("13", 2, "aa");
+select a from monitor_test where b < 1 for update;
+a
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+name count
+icp_attempts 1
+icp_no_match 0
+icp_out_of_range 1
+icp_match 0
+select a from monitor_test where b < 3 for update;
+a
+13
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+name count
+icp_attempts 2
+icp_no_match 0
+icp_out_of_range 1
+icp_match 1
+drop table monitor_test;
+set global innodb_monitor_disable = All;
+set global innodb_monitor_reset_all = all;
+set global innodb_monitor_enable = default;
+set global innodb_monitor_disable = default;
+set global innodb_monitor_reset = default;
+set global innodb_monitor_reset_all = default;
diff --git a/mysql-test/suite/sys_vars/r/innodb_old_blocks_time_basic.result b/mysql-test/suite/sys_vars/r/innodb_old_blocks_time_basic.result
index a285cc14a01..add91e56039 100644
--- a/mysql-test/suite/sys_vars/r/innodb_old_blocks_time_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_old_blocks_time_basic.result
@@ -1,28 +1,28 @@
SET @start_global_value = @@global.innodb_old_blocks_time;
SELECT @start_global_value;
@start_global_value
-0
+1000
Valid values are zero or above
select @@global.innodb_old_blocks_time >=0;
@@global.innodb_old_blocks_time >=0
1
select @@global.innodb_old_blocks_time;
@@global.innodb_old_blocks_time
-0
+1000
select @@session.innodb_old_blocks_time;
ERROR HY000: Variable 'innodb_old_blocks_time' is a GLOBAL variable
show global variables like 'innodb_old_blocks_time';
Variable_name Value
-innodb_old_blocks_time 0
+innodb_old_blocks_time 1000
show session variables like 'innodb_old_blocks_time';
Variable_name Value
-innodb_old_blocks_time 0
+innodb_old_blocks_time 1000
select * from information_schema.global_variables where variable_name='innodb_old_blocks_time';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_OLD_BLOCKS_TIME 0
+INNODB_OLD_BLOCKS_TIME 1000
select * from information_schema.session_variables where variable_name='innodb_old_blocks_time';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_OLD_BLOCKS_TIME 0
+INNODB_OLD_BLOCKS_TIME 1000
set global innodb_old_blocks_time=10;
select @@global.innodb_old_blocks_time;
@@global.innodb_old_blocks_time
@@ -53,4 +53,4 @@ INNODB_OLD_BLOCKS_TIME 0
SET @@global.innodb_old_blocks_time = @start_global_value;
SELECT @@global.innodb_old_blocks_time;
@@global.innodb_old_blocks_time
-0
+1000
diff --git a/mysql-test/suite/sys_vars/r/innodb_online_alter_log_max_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_online_alter_log_max_size_basic.result
new file mode 100644
index 00000000000..99f315eb1f9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_online_alter_log_max_size_basic.result
@@ -0,0 +1,64 @@
+SET @start_global_value = @@global.innodb_online_alter_log_max_size;
+SELECT @start_global_value;
+@start_global_value
+134217728
+select @@global.innodb_online_alter_log_max_size >= 524288;
+@@global.innodb_online_alter_log_max_size >= 524288
+1
+select @@global.innodb_online_alter_log_max_size;
+@@global.innodb_online_alter_log_max_size
+134217728
+select @@session.innodb_online_alter_log_max_size;
+ERROR HY000: Variable 'innodb_online_alter_log_max_size' is a GLOBAL variable
+show global variables like 'innodb_online_alter_log_max_size';
+Variable_name Value
+innodb_online_alter_log_max_size 134217728
+show session variables like 'innodb_online_alter_log_max_size';
+Variable_name Value
+innodb_online_alter_log_max_size 134217728
+select * from information_schema.global_variables where variable_name='innodb_online_alter_log_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ONLINE_ALTER_LOG_MAX_SIZE 134217728
+select * from information_schema.session_variables where variable_name='innodb_online_alter_log_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ONLINE_ALTER_LOG_MAX_SIZE 134217728
+set global innodb_online_alter_log_max_size=1048576;
+select @@global.innodb_online_alter_log_max_size;
+@@global.innodb_online_alter_log_max_size
+1048576
+select * from information_schema.global_variables where variable_name='innodb_online_alter_log_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ONLINE_ALTER_LOG_MAX_SIZE 1048576
+select * from information_schema.session_variables where variable_name='innodb_online_alter_log_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ONLINE_ALTER_LOG_MAX_SIZE 1048576
+set @@global.innodb_online_alter_log_max_size=524288;
+select @@global.innodb_online_alter_log_max_size;
+@@global.innodb_online_alter_log_max_size
+524288
+select * from information_schema.global_variables where variable_name='innodb_online_alter_log_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ONLINE_ALTER_LOG_MAX_SIZE 524288
+select * from information_schema.session_variables where variable_name='innodb_online_alter_log_max_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_ONLINE_ALTER_LOG_MAX_SIZE 524288
+set session innodb_online_alter_log_max_size='some';
+ERROR HY000: Variable 'innodb_online_alter_log_max_size' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_online_alter_log_max_size='some';
+ERROR HY000: Variable 'innodb_online_alter_log_max_size' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_online_alter_log_max_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_online_alter_log_max_size'
+set global innodb_online_alter_log_max_size='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_online_alter_log_max_size'
+set global innodb_online_alter_log_max_size=-2;
+Warnings:
+Warning 1292 Truncated incorrect innodb_online_alter_log_max_size value: '-2'
+set global innodb_online_alter_log_max_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_online_alter_log_max_size'
+set global innodb_online_alter_log_max_size=2;
+Warnings:
+Warning 1292 Truncated incorrect innodb_online_alter_log_max_size value: '2'
+SET @@global.innodb_online_alter_log_max_size = @start_global_value;
+SELECT @@global.innodb_online_alter_log_max_size;
+@@global.innodb_online_alter_log_max_size
+134217728
diff --git a/mysql-test/suite/sys_vars/r/innodb_optimize_fulltext_only_basic.result b/mysql-test/suite/sys_vars/r/innodb_optimize_fulltext_only_basic.result
new file mode 100644
index 00000000000..a6355430f43
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_optimize_fulltext_only_basic.result
@@ -0,0 +1,92 @@
+SET @start_global_value = @@global.innodb_optimize_fulltext_only;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_optimize_fulltext_only in (0, 1);
+@@global.innodb_optimize_fulltext_only in (0, 1)
+1
+select @@global.innodb_optimize_fulltext_only;
+@@global.innodb_optimize_fulltext_only
+0
+select @@session.innodb_optimize_fulltext_only;
+ERROR HY000: Variable 'innodb_optimize_fulltext_only' is a GLOBAL variable
+show global variables like 'innodb_optimize_fulltext_only';
+Variable_name Value
+innodb_optimize_fulltext_only OFF
+show session variables like 'innodb_optimize_fulltext_only';
+Variable_name Value
+innodb_optimize_fulltext_only OFF
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY OFF
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY OFF
+set global innodb_optimize_fulltext_only='ON';
+select @@global.innodb_optimize_fulltext_only;
+@@global.innodb_optimize_fulltext_only
+1
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY ON
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY ON
+set @@global.innodb_optimize_fulltext_only=0;
+select @@global.innodb_optimize_fulltext_only;
+@@global.innodb_optimize_fulltext_only
+0
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY OFF
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY OFF
+set global innodb_optimize_fulltext_only=1;
+select @@global.innodb_optimize_fulltext_only;
+@@global.innodb_optimize_fulltext_only
+1
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY ON
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY ON
+set @@global.innodb_optimize_fulltext_only='OFF';
+select @@global.innodb_optimize_fulltext_only;
+@@global.innodb_optimize_fulltext_only
+0
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY OFF
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY OFF
+set session innodb_optimize_fulltext_only='OFF';
+ERROR HY000: Variable 'innodb_optimize_fulltext_only' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_optimize_fulltext_only='ON';
+ERROR HY000: Variable 'innodb_optimize_fulltext_only' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_optimize_fulltext_only=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_optimize_fulltext_only'
+set global innodb_optimize_fulltext_only=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_optimize_fulltext_only'
+set global innodb_optimize_fulltext_only=2;
+ERROR 42000: Variable 'innodb_optimize_fulltext_only' can't be set to the value of '2'
+set global innodb_optimize_fulltext_only=-3;
+ERROR 42000: Variable 'innodb_optimize_fulltext_only' can't be set to the value of '-3'
+select @@global.innodb_optimize_fulltext_only;
+@@global.innodb_optimize_fulltext_only
+0
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY OFF
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_OPTIMIZE_FULLTEXT_ONLY OFF
+set global innodb_optimize_fulltext_only='AUTO';
+ERROR 42000: Variable 'innodb_optimize_fulltext_only' can't be set to the value of 'AUTO'
+SET @@global.innodb_optimize_fulltext_only = @start_global_value;
+SELECT @@global.innodb_optimize_fulltext_only;
+@@global.innodb_optimize_fulltext_only
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_page_hash_locks_basic.result b/mysql-test/suite/sys_vars/r/innodb_page_hash_locks_basic.result
new file mode 100644
index 00000000000..e8915387aad
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_page_hash_locks_basic.result
@@ -0,0 +1,24 @@
+select @@global.innodb_page_hash_locks between 1 and 1024;
+@@global.innodb_page_hash_locks between 1 and 1024
+1
+select @@global.innodb_page_hash_locks;
+@@global.innodb_page_hash_locks
+16
+select @@session.innodb_page_hash_locks;
+ERROR HY000: Variable 'innodb_page_hash_locks' is a GLOBAL variable
+show global variables like 'innodb_page_hash_locks';
+Variable_name Value
+innodb_page_hash_locks 16
+show session variables like 'innodb_page_hash_locks';
+Variable_name Value
+innodb_page_hash_locks 16
+select * from information_schema.global_variables where variable_name='innodb_page_hash_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PAGE_HASH_LOCKS 16
+select * from information_schema.session_variables where variable_name='innodb_page_hash_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PAGE_HASH_LOCKS 16
+set global innodb_page_hash_locks=1;
+ERROR HY000: Variable 'innodb_page_hash_locks' is a read only variable
+set @@session.innodb_page_hash_locks='some';
+ERROR HY000: Variable 'innodb_page_hash_locks' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_persistent_stats_root_page_basic.result b/mysql-test/suite/sys_vars/r/innodb_persistent_stats_root_page_basic.result
deleted file mode 100644
index 38347ef8c68..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_persistent_stats_root_page_basic.result
+++ /dev/null
@@ -1,24 +0,0 @@
-SELECT @@global.innodb_persistent_stats_root_page;
-@@global.innodb_persistent_stats_root_page
-0
-SELECT COUNT(@@global.innodb_persistent_stats_root_page);
-COUNT(@@global.innodb_persistent_stats_root_page)
-1
-SET @@global.innodb_persistent_stats_root_page=100;
-ERROR HY000: Variable 'innodb_persistent_stats_root_page' is a read only variable
-SELECT @@global.innodb_persistent_stats_root_page = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_persistent_stats_root_page';
-@@global.innodb_persistent_stats_root_page = VARIABLE_VALUE
-1
-SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_persistent_stats_root_page';
-COUNT(*)
-1
-SELECT @@innodb_persistent_stats_root_page = @@global.innodb_persistent_stats_root_page;
-@@innodb_persistent_stats_root_page = @@global.innodb_persistent_stats_root_page
-1
-SELECT COUNT(@@local.innodb_persistent_stats_root_page);
-ERROR HY000: Variable 'innodb_persistent_stats_root_page' is a GLOBAL variable
-SELECT COUNT(@@session.innodb_persistent_stats_root_page);
-ERROR HY000: Variable 'innodb_persistent_stats_root_page' is a GLOBAL variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_print_all_deadlocks_basic.result b/mysql-test/suite/sys_vars/r/innodb_print_all_deadlocks_basic.result
index 1bd078dfd7e..6b940503c59 100644
--- a/mysql-test/suite/sys_vars/r/innodb_print_all_deadlocks_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_print_all_deadlocks_basic.result
@@ -1,22 +1,104 @@
-SELECT @@innodb_print_all_deadlocks;
-@@innodb_print_all_deadlocks
+SET @start_global_value = @@global.innodb_print_all_deadlocks;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+SELECT @@global.innodb_print_all_deadlocks in (0, 1);
+@@global.innodb_print_all_deadlocks in (0, 1)
+1
+SELECT @@global.innodb_print_all_deadlocks;
+@@global.innodb_print_all_deadlocks
+0
+SELECT @@session.innodb_print_all_deadlocks;
+ERROR HY000: Variable 'innodb_print_all_deadlocks' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_print_all_deadlocks';
+Variable_name Value
+innodb_print_all_deadlocks OFF
+SHOW session variables LIKE 'innodb_print_all_deadlocks';
+Variable_name Value
+innodb_print_all_deadlocks OFF
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS OFF
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS OFF
+SET global innodb_print_all_deadlocks='OFF';
+SELECT @@global.innodb_print_all_deadlocks;
+@@global.innodb_print_all_deadlocks
+0
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS OFF
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS OFF
+SET @@global.innodb_print_all_deadlocks=1;
+SELECT @@global.innodb_print_all_deadlocks;
+@@global.innodb_print_all_deadlocks
+1
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS ON
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS ON
+SET global innodb_print_all_deadlocks=0;
+SELECT @@global.innodb_print_all_deadlocks;
+@@global.innodb_print_all_deadlocks
+0
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS OFF
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS OFF
+SET @@global.innodb_print_all_deadlocks='ON';
+SELECT @@global.innodb_print_all_deadlocks;
+@@global.innodb_print_all_deadlocks
+1
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS ON
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS ON
+SET session innodb_print_all_deadlocks='OFF';
+ERROR HY000: Variable 'innodb_print_all_deadlocks' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.innodb_print_all_deadlocks='ON';
+ERROR HY000: Variable 'innodb_print_all_deadlocks' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_print_all_deadlocks=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_print_all_deadlocks'
+SET global innodb_print_all_deadlocks=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_print_all_deadlocks'
+SET global innodb_print_all_deadlocks=2;
+ERROR 42000: Variable 'innodb_print_all_deadlocks' can't be set to the value of '2'
+SET global innodb_print_all_deadlocks=-3;
+ERROR 42000: Variable 'innodb_print_all_deadlocks' can't be set to the value of '-3'
+SELECT @@global.innodb_print_all_deadlocks;
+@@global.innodb_print_all_deadlocks
+1
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS ON
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_PRINT_ALL_DEADLOCKS ON
+SET global innodb_print_all_deadlocks='AUTO';
+ERROR 42000: Variable 'innodb_print_all_deadlocks' can't be set to the value of 'AUTO'
+SET @@global.innodb_print_all_deadlocks = @start_global_value;
+SELECT @@global.innodb_print_all_deadlocks;
+@@global.innodb_print_all_deadlocks
0
-SET GLOBAL innodb_print_all_deadlocks=1;
-CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB;
-INSERT INTO t1 VALUES (123);
-CREATE TABLE t2 (c2 INT, PRIMARY KEY (c2)) ENGINE=INNODB;
-INSERT INTO t2 VALUES (456);
-BEGIN;
-SELECT * FROM t1 FOR UPDATE;
-c1
-123
-BEGIN;
-SELECT * FROM t2 FOR UPDATE;
-c2
-456
-SELECT * FROM t2 FOR UPDATE;
-SELECT * FROM t1 FOR UPDATE;
-ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
-DROP TABLE t2;
-DROP TABLE t1;
-SET GLOBAL innodb_print_all_deadlocks=default;
diff --git a/mysql-test/suite/sys_vars/r/innodb_priority_cleaner_basic.result b/mysql-test/suite/sys_vars/r/innodb_priority_cleaner_basic.result
new file mode 100644
index 00000000000..ae5e12ee64a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_priority_cleaner_basic.result
@@ -0,0 +1,31 @@
+SET @start_value = @@GLOBAL.innodb_priority_cleaner;
+SELECT @@GLOBAL.innodb_priority_cleaner;
+@@GLOBAL.innodb_priority_cleaner
+0
+SELECT @@SESSION.innodb_priority_cleaner;
+ERROR HY000: Variable 'innodb_priority_cleaner' is a GLOBAL variable
+SET GLOBAL innodb_priority_cleaner='OFF';
+SELECT @@GLOBAL.innodb_priority_cleaner;
+@@GLOBAL.innodb_priority_cleaner
+0
+SET GLOBAL innodb_priority_cleaner='ON';
+SELECT @@GLOBAL.innodb_priority_cleaner;
+@@GLOBAL.innodb_priority_cleaner
+1
+SET GLOBAL innodb_priority_cleaner=0;
+SELECT @@GLOBAL.innodb_priority_cleaner;
+@@GLOBAL.innodb_priority_cleaner
+0
+SET GLOBAL innodb_priority_cleaner=1;
+SELECT @@GLOBAL.innodb_priority_cleaner;
+@@GLOBAL.innodb_priority_cleaner
+1
+SET GLOBAL innodb_priority_cleaner=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_priority_cleaner'
+SET GLOBAL innodb_priority_cleaner=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_priority_cleaner'
+SET GLOBAL innodb_priority_cleaner=2;
+ERROR 42000: Variable 'innodb_priority_cleaner' can't be set to the value of '2'
+SET GLOBAL innodb_priority_cleaner='foo';
+ERROR 42000: Variable 'innodb_priority_cleaner' can't be set to the value of 'foo'
+SET GLOBAL innodb_priority_cleaner = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_priority_io_basic.result b/mysql-test/suite/sys_vars/r/innodb_priority_io_basic.result
new file mode 100644
index 00000000000..70ccb5e4cf4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_priority_io_basic.result
@@ -0,0 +1,31 @@
+SET @start_value = @@GLOBAL.innodb_priority_io;
+SELECT @@GLOBAL.innodb_priority_io;
+@@GLOBAL.innodb_priority_io
+0
+SELECT @@SESSION.innodb_priority_io;
+ERROR HY000: Variable 'innodb_priority_io' is a GLOBAL variable
+SET GLOBAL innodb_priority_io='OFF';
+SELECT @@GLOBAL.innodb_priority_io;
+@@GLOBAL.innodb_priority_io
+0
+SET GLOBAL innodb_priority_io='ON';
+SELECT @@GLOBAL.innodb_priority_io;
+@@GLOBAL.innodb_priority_io
+1
+SET GLOBAL innodb_priority_io=0;
+SELECT @@GLOBAL.innodb_priority_io;
+@@GLOBAL.innodb_priority_io
+0
+SET GLOBAL innodb_priority_io=1;
+SELECT @@GLOBAL.innodb_priority_io;
+@@GLOBAL.innodb_priority_io
+1
+SET GLOBAL innodb_priority_io=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_priority_io'
+SET GLOBAL innodb_priority_io=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_priority_io'
+SET GLOBAL innodb_priority_io=2;
+ERROR 42000: Variable 'innodb_priority_io' can't be set to the value of '2'
+SET GLOBAL innodb_priority_io='foo';
+ERROR 42000: Variable 'innodb_priority_io' can't be set to the value of 'foo'
+SET GLOBAL innodb_priority_io = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_priority_master_basic.result b/mysql-test/suite/sys_vars/r/innodb_priority_master_basic.result
new file mode 100644
index 00000000000..d26ead2ff7e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_priority_master_basic.result
@@ -0,0 +1,31 @@
+SET @start_value = @@GLOBAL.innodb_priority_master;
+SELECT @@GLOBAL.innodb_priority_master;
+@@GLOBAL.innodb_priority_master
+0
+SELECT @@SESSION.innodb_priority_master;
+ERROR HY000: Variable 'innodb_priority_master' is a GLOBAL variable
+SET GLOBAL innodb_priority_master='OFF';
+SELECT @@GLOBAL.innodb_priority_master;
+@@GLOBAL.innodb_priority_master
+0
+SET GLOBAL innodb_priority_master='ON';
+SELECT @@GLOBAL.innodb_priority_master;
+@@GLOBAL.innodb_priority_master
+1
+SET GLOBAL innodb_priority_master=0;
+SELECT @@GLOBAL.innodb_priority_master;
+@@GLOBAL.innodb_priority_master
+0
+SET GLOBAL innodb_priority_master=1;
+SELECT @@GLOBAL.innodb_priority_master;
+@@GLOBAL.innodb_priority_master
+1
+SET GLOBAL innodb_priority_master=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_priority_master'
+SET GLOBAL innodb_priority_master=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_priority_master'
+SET GLOBAL innodb_priority_master=2;
+ERROR 42000: Variable 'innodb_priority_master' can't be set to the value of '2'
+SET GLOBAL innodb_priority_master='foo';
+ERROR 42000: Variable 'innodb_priority_master' can't be set to the value of 'foo'
+SET GLOBAL innodb_priority_master = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_priority_purge_basic.result b/mysql-test/suite/sys_vars/r/innodb_priority_purge_basic.result
new file mode 100644
index 00000000000..57153ebf82a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_priority_purge_basic.result
@@ -0,0 +1,31 @@
+SET @start_value = @@GLOBAL.innodb_priority_purge;
+SELECT @@GLOBAL.innodb_priority_purge;
+@@GLOBAL.innodb_priority_purge
+0
+SELECT @@SESSION.innodb_priority_purge;
+ERROR HY000: Variable 'innodb_priority_purge' is a GLOBAL variable
+SET GLOBAL innodb_priority_purge='OFF';
+SELECT @@GLOBAL.innodb_priority_purge;
+@@GLOBAL.innodb_priority_purge
+0
+SET GLOBAL innodb_priority_purge='ON';
+SELECT @@GLOBAL.innodb_priority_purge;
+@@GLOBAL.innodb_priority_purge
+1
+SET GLOBAL innodb_priority_purge=0;
+SELECT @@GLOBAL.innodb_priority_purge;
+@@GLOBAL.innodb_priority_purge
+0
+SET GLOBAL innodb_priority_purge=1;
+SELECT @@GLOBAL.innodb_priority_purge;
+@@GLOBAL.innodb_priority_purge
+1
+SET GLOBAL innodb_priority_purge=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_priority_purge'
+SET GLOBAL innodb_priority_purge=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_priority_purge'
+SET GLOBAL innodb_priority_purge=2;
+ERROR 42000: Variable 'innodb_priority_purge' can't be set to the value of '2'
+SET GLOBAL innodb_priority_purge='foo';
+ERROR 42000: Variable 'innodb_priority_purge' can't be set to the value of 'foo'
+SET GLOBAL innodb_priority_purge = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_batch_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_batch_size_basic.result
index 1ff36237907..8f81df74d5b 100644
--- a/mysql-test/suite/sys_vars/r/innodb_purge_batch_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_purge_batch_size_basic.result
@@ -1,19 +1,19 @@
SET @global_start_value = @@global.innodb_purge_batch_size;
SELECT @global_start_value;
@global_start_value
-20
+300
'#--------------------FN_DYNVARS_046_01------------------------#'
SET @@global.innodb_purge_batch_size = 1;
SET @@global.innodb_purge_batch_size = DEFAULT;
SELECT @@global.innodb_purge_batch_size;
@@global.innodb_purge_batch_size
-20
+300
'#---------------------FN_DYNVARS_046_02-------------------------#'
SET innodb_purge_batch_size = 1;
ERROR HY000: Variable 'innodb_purge_batch_size' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@innodb_purge_batch_size;
@@innodb_purge_batch_size
-20
+300
SELECT local.innodb_purge_batch_size;
ERROR 42S02: Unknown table 'local' in field list
SET global innodb_purge_batch_size = 1;
@@ -95,4 +95,4 @@ SELECT @@global.innodb_purge_batch_size;
SET @@global.innodb_purge_batch_size = @global_start_value;
SELECT @@global.innodb_purge_batch_size;
@@global.innodb_purge_batch_size
-20
+300
diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_run_now_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_run_now_basic.result
new file mode 100644
index 00000000000..41204422767
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_purge_run_now_basic.result
@@ -0,0 +1,27 @@
+SELECT name, count
+FROM information_schema.innodb_metrics
+WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+name count
+purge_stop_count 0
+purge_resume_count 0
+SET @orig = @@global.innodb_purge_run_now;
+SELECT @orig;
+@orig
+0
+SET GLOBAL innodb_purge_stop_now = ON;
+SELECT name, count
+FROM information_schema.innodb_metrics
+WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+name count
+purge_stop_count 1
+purge_resume_count 0
+SET GLOBAL innodb_purge_run_now = ON;
+SELECT @@global.innodb_purge_run_now;
+@@global.innodb_purge_run_now
+0
+SELECT name, count
+FROM information_schema.innodb_metrics
+WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+name count
+purge_stop_count 1
+purge_resume_count 1
diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_stop_now_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_stop_now_basic.result
new file mode 100644
index 00000000000..41204422767
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_purge_stop_now_basic.result
@@ -0,0 +1,27 @@
+SELECT name, count
+FROM information_schema.innodb_metrics
+WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+name count
+purge_stop_count 0
+purge_resume_count 0
+SET @orig = @@global.innodb_purge_run_now;
+SELECT @orig;
+@orig
+0
+SET GLOBAL innodb_purge_stop_now = ON;
+SELECT name, count
+FROM information_schema.innodb_metrics
+WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+name count
+purge_stop_count 1
+purge_resume_count 0
+SET GLOBAL innodb_purge_run_now = ON;
+SELECT @@global.innodb_purge_run_now;
+@@global.innodb_purge_run_now
+0
+SELECT name, count
+FROM information_schema.innodb_metrics
+WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+name count
+purge_stop_count 1
+purge_resume_count 1
diff --git a/mysql-test/suite/sys_vars/r/innodb_read_only_basic.result b/mysql-test/suite/sys_vars/r/innodb_read_only_basic.result
new file mode 100644
index 00000000000..a97f1ddc698
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_read_only_basic.result
@@ -0,0 +1,22 @@
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_read_only;
+@@global.innodb_read_only
+0
+select @@session.innodb_read_only;
+ERROR HY000: Variable 'innodb_read_only' is a GLOBAL variable
+show global variables like 'innodb_read_only';
+Variable_name Value
+innodb_read_only OFF
+show session variables like 'innodb_read_only';
+Variable_name Value
+innodb_read_only OFF
+select * from information_schema.global_variables where variable_name='innodb_read_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_READ_ONLY OFF
+select * from information_schema.session_variables where variable_name='innodb_read_only';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_READ_ONLY OFF
+set global innodb_read_only=1;
+ERROR HY000: Variable 'innodb_read_only' is a read only variable
+set session innodb_read_only=1;
+ERROR HY000: Variable 'innodb_read_only' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result
new file mode 100644
index 00000000000..20e2b78e640
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result
@@ -0,0 +1,26 @@
+#
+# Basic test for innodb_saved_page_number_debug.
+#
+SELECT @@global.innodb_saved_page_number_debug;
+@@global.innodb_saved_page_number_debug
+0
+set global innodb_saved_page_number_debug = 10;
+SELECT @@global.innodb_saved_page_number_debug;
+@@global.innodb_saved_page_number_debug
+10
+set global innodb_saved_page_number_debug = 100;
+set global innodb_saved_page_number_debug = dummy;
+ERROR 42000: Incorrect argument type to variable 'innodb_saved_page_number_debug'
+set innodb_saved_page_number_debug = ON;
+ERROR HY000: Variable 'innodb_saved_page_number_debug' is a GLOBAL variable and should be set with SET GLOBAL
+# An example usage.
+create table t1 (f1 int primary key) engine = innodb;
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+drop table t1;
+set global innodb_saved_page_number_debug = 0;
+SELECT @@global.innodb_saved_page_number_debug;
+@@global.innodb_saved_page_number_debug
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result b/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result
new file mode 100644
index 00000000000..1183fb27732
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result
@@ -0,0 +1,30 @@
+SET @start_value = @@GLOBAL.innodb_sched_priority_cleaner;
+SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+@@GLOBAL.innodb_sched_priority_cleaner
+19
+SELECT @@SESSION.innodb_sched_priority_cleaner;
+ERROR HY000: Variable 'innodb_sched_priority_cleaner' is a GLOBAL variable
+SET GLOBAL innodb_sched_priority_cleaner=19;
+SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+@@GLOBAL.innodb_sched_priority_cleaner
+19
+SET GLOBAL innodb_sched_priority_cleaner=5;
+SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+@@GLOBAL.innodb_sched_priority_cleaner
+5
+SET GLOBAL innodb_sched_priority_cleaner=0;
+SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+@@GLOBAL.innodb_sched_priority_cleaner
+0
+SET GLOBAL innodb_sched_priority_cleaner=-1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_sched_priority_cleaner value: '-1'
+SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+@@GLOBAL.innodb_sched_priority_cleaner
+0
+SET GLOBAL innodb_sched_priority_cleaner=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_cleaner'
+SET GLOBAL innodb_sched_priority_cleaner=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_cleaner'
+SET GLOBAL innodb_sched_priority_cleaner='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_cleaner'
diff --git a/mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result b/mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result
new file mode 100644
index 00000000000..5fd7705bfaf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_sched_priority_io_basic.result
@@ -0,0 +1,30 @@
+SET @start_value = @@GLOBAL.innodb_sched_priority_io;
+SELECT @@GLOBAL.innodb_sched_priority_io;
+@@GLOBAL.innodb_sched_priority_io
+19
+SELECT @@SESSION.innodb_sched_priority_io;
+ERROR HY000: Variable 'innodb_sched_priority_io' is a GLOBAL variable
+SET GLOBAL innodb_sched_priority_io=19;
+SELECT @@GLOBAL.innodb_sched_priority_io;
+@@GLOBAL.innodb_sched_priority_io
+19
+SET GLOBAL innodb_sched_priority_io=5;
+SELECT @@GLOBAL.innodb_sched_priority_io;
+@@GLOBAL.innodb_sched_priority_io
+5
+SET GLOBAL innodb_sched_priority_io=0;
+SELECT @@GLOBAL.innodb_sched_priority_io;
+@@GLOBAL.innodb_sched_priority_io
+0
+SET GLOBAL innodb_sched_priority_io=-1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_sched_priority_io value: '-1'
+SELECT @@GLOBAL.innodb_sched_priority_io;
+@@GLOBAL.innodb_sched_priority_io
+0
+SET GLOBAL innodb_sched_priority_io=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_io'
+SET GLOBAL innodb_sched_priority_io=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_io'
+SET GLOBAL innodb_sched_priority_io='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_io'
diff --git a/mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result b/mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result
new file mode 100644
index 00000000000..caa72f58369
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_sched_priority_master_basic.result
@@ -0,0 +1,30 @@
+SET @start_value = @@GLOBAL.innodb_sched_priority_master;
+SELECT @@GLOBAL.innodb_sched_priority_master;
+@@GLOBAL.innodb_sched_priority_master
+19
+SELECT @@SESSION.innodb_sched_priority_master;
+ERROR HY000: Variable 'innodb_sched_priority_master' is a GLOBAL variable
+SET GLOBAL innodb_sched_priority_master=19;
+SELECT @@GLOBAL.innodb_sched_priority_master;
+@@GLOBAL.innodb_sched_priority_master
+19
+SET GLOBAL innodb_sched_priority_master=5;
+SELECT @@GLOBAL.innodb_sched_priority_master;
+@@GLOBAL.innodb_sched_priority_master
+5
+SET GLOBAL innodb_sched_priority_master=0;
+SELECT @@GLOBAL.innodb_sched_priority_master;
+@@GLOBAL.innodb_sched_priority_master
+0
+SET GLOBAL innodb_sched_priority_master=-1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_sched_priority_master value: '-1'
+SELECT @@GLOBAL.innodb_sched_priority_master;
+@@GLOBAL.innodb_sched_priority_master
+0
+SET GLOBAL innodb_sched_priority_master=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_master'
+SET GLOBAL innodb_sched_priority_master=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_master'
+SET GLOBAL innodb_sched_priority_master='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_master'
diff --git a/mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result b/mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result
new file mode 100644
index 00000000000..e3b9c627214
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_sched_priority_purge_basic.result
@@ -0,0 +1,30 @@
+SET @start_value = @@GLOBAL.innodb_sched_priority_purge;
+SELECT @@GLOBAL.innodb_sched_priority_purge;
+@@GLOBAL.innodb_sched_priority_purge
+19
+SELECT @@SESSION.innodb_sched_priority_purge;
+ERROR HY000: Variable 'innodb_sched_priority_purge' is a GLOBAL variable
+SET GLOBAL innodb_sched_priority_purge=19;
+SELECT @@GLOBAL.innodb_sched_priority_purge;
+@@GLOBAL.innodb_sched_priority_purge
+19
+SET GLOBAL innodb_sched_priority_purge=5;
+SELECT @@GLOBAL.innodb_sched_priority_purge;
+@@GLOBAL.innodb_sched_priority_purge
+5
+SET GLOBAL innodb_sched_priority_purge=0;
+SELECT @@GLOBAL.innodb_sched_priority_purge;
+@@GLOBAL.innodb_sched_priority_purge
+0
+SET GLOBAL innodb_sched_priority_purge=-1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_sched_priority_purge value: '-1'
+SELECT @@GLOBAL.innodb_sched_priority_purge;
+@@GLOBAL.innodb_sched_priority_purge
+0
+SET GLOBAL innodb_sched_priority_purge=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_purge'
+SET GLOBAL innodb_sched_priority_purge=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_purge'
+SET GLOBAL innodb_sched_priority_purge='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_sched_priority_purge'
diff --git a/mysql-test/suite/sys_vars/r/innodb_sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_sort_buffer_size_basic.result
new file mode 100644
index 00000000000..2eb0eba1598
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_sort_buffer_size_basic.result
@@ -0,0 +1,21 @@
+select @@global.innodb_sort_buffer_size;
+@@global.innodb_sort_buffer_size
+1048576
+select @@session.innodb_sort_buffer_size;
+ERROR HY000: Variable 'innodb_sort_buffer_size' is a GLOBAL variable
+show global variables like 'innodb_sort_buffer_size';
+Variable_name Value
+innodb_sort_buffer_size 1048576
+show session variables like 'innodb_sort_buffer_size';
+Variable_name Value
+innodb_sort_buffer_size 1048576
+select * from information_schema.global_variables where variable_name='innodb_sort_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_SORT_BUFFER_SIZE 1048576
+select * from information_schema.session_variables where variable_name='innodb_sort_buffer_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_SORT_BUFFER_SIZE 1048576
+set global innodb_sort_buffer_size=1;
+ERROR HY000: Variable 'innodb_sort_buffer_size' is a read only variable
+set session innodb_sort_buffer_size=1;
+ERROR HY000: Variable 'innodb_sort_buffer_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_auto_recalc_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_auto_recalc_basic.result
new file mode 100644
index 00000000000..dd4970cbdb0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_stats_auto_recalc_basic.result
@@ -0,0 +1,24 @@
+SELECT @@innodb_stats_auto_recalc;
+@@innodb_stats_auto_recalc
+1
+SET GLOBAL innodb_stats_auto_recalc=ON;
+SELECT @@innodb_stats_auto_recalc;
+@@innodb_stats_auto_recalc
+1
+SET GLOBAL innodb_stats_auto_recalc=OFF;
+SELECT @@innodb_stats_auto_recalc;
+@@innodb_stats_auto_recalc
+0
+SET GLOBAL innodb_stats_auto_recalc=1;
+SELECT @@innodb_stats_auto_recalc;
+@@innodb_stats_auto_recalc
+1
+SET GLOBAL innodb_stats_auto_recalc=0;
+SELECT @@innodb_stats_auto_recalc;
+@@innodb_stats_auto_recalc
+0
+SET GLOBAL innodb_stats_auto_recalc=123;
+ERROR 42000: Variable 'innodb_stats_auto_recalc' can't be set to the value of '123'
+SET GLOBAL innodb_stats_auto_recalc='foo';
+ERROR 42000: Variable 'innodb_stats_auto_recalc' can't be set to the value of 'foo'
+SET GLOBAL innodb_stats_auto_recalc=default;
diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result
index 852ef8a353d..19e4a8a67d2 100644
--- a/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result
@@ -1,28 +1,28 @@
SET @start_global_value = @@global.innodb_stats_on_metadata;
SELECT @start_global_value;
@start_global_value
-1
+0
Valid values are 'ON' and 'OFF'
select @@global.innodb_stats_on_metadata in (0, 1);
@@global.innodb_stats_on_metadata in (0, 1)
1
select @@global.innodb_stats_on_metadata;
@@global.innodb_stats_on_metadata
-1
+0
select @@session.innodb_stats_on_metadata;
ERROR HY000: Variable 'innodb_stats_on_metadata' is a GLOBAL variable
show global variables like 'innodb_stats_on_metadata';
Variable_name Value
-innodb_stats_on_metadata ON
+innodb_stats_on_metadata OFF
show session variables like 'innodb_stats_on_metadata';
Variable_name Value
-innodb_stats_on_metadata ON
+innodb_stats_on_metadata OFF
select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_STATS_ON_METADATA ON
+INNODB_STATS_ON_METADATA OFF
select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_STATS_ON_METADATA ON
+INNODB_STATS_ON_METADATA OFF
set global innodb_stats_on_metadata='OFF';
select @@global.innodb_stats_on_metadata;
@@global.innodb_stats_on_metadata
@@ -89,4 +89,4 @@ ERROR 42000: Variable 'innodb_stats_on_metadata' can't be set to the value of 'A
SET @@global.innodb_stats_on_metadata = @start_global_value;
SELECT @@global.innodb_stats_on_metadata;
@@global.innodb_stats_on_metadata
-1
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_persistent_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_persistent_basic.result
new file mode 100644
index 00000000000..1cbdd16afdf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_stats_persistent_basic.result
@@ -0,0 +1,24 @@
+SELECT @@innodb_stats_persistent;
+@@innodb_stats_persistent
+0
+SET GLOBAL innodb_stats_persistent=ON;
+SELECT @@innodb_stats_persistent;
+@@innodb_stats_persistent
+1
+SET GLOBAL innodb_stats_persistent=OFF;
+SELECT @@innodb_stats_persistent;
+@@innodb_stats_persistent
+0
+SET GLOBAL innodb_stats_persistent=1;
+SELECT @@innodb_stats_persistent;
+@@innodb_stats_persistent
+1
+SET GLOBAL innodb_stats_persistent=0;
+SELECT @@innodb_stats_persistent;
+@@innodb_stats_persistent
+0
+SET GLOBAL innodb_stats_persistent=123;
+ERROR 42000: Variable 'innodb_stats_persistent' can't be set to the value of '123'
+SET GLOBAL innodb_stats_persistent='foo';
+ERROR 42000: Variable 'innodb_stats_persistent' can't be set to the value of 'foo'
+SET GLOBAL innodb_stats_persistent=off;
diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_persistent_sample_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_persistent_sample_pages_basic.result
new file mode 100644
index 00000000000..d2e848621dd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_stats_persistent_sample_pages_basic.result
@@ -0,0 +1,61 @@
+SET @start_global_value = @@global.innodb_stats_persistent_sample_pages;
+SELECT @start_global_value;
+@start_global_value
+20
+Valid values are zero or above
+SELECT @@global.innodb_stats_persistent_sample_pages >=0;
+@@global.innodb_stats_persistent_sample_pages >=0
+1
+SELECT @@global.innodb_stats_persistent_sample_pages;
+@@global.innodb_stats_persistent_sample_pages
+20
+SELECT @@session.innodb_stats_persistent_sample_pages;
+ERROR HY000: Variable 'innodb_stats_persistent_sample_pages' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_stats_persistent_sample_pages';
+Variable_name Value
+innodb_stats_persistent_sample_pages 20
+SHOW session variables LIKE 'innodb_stats_persistent_sample_pages';
+Variable_name Value
+innodb_stats_persistent_sample_pages 20
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_persistent_sample_pages';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_PERSISTENT_SAMPLE_PAGES 20
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_persistent_sample_pages';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_PERSISTENT_SAMPLE_PAGES 20
+SET global innodb_stats_persistent_sample_pages=10;
+SELECT @@global.innodb_stats_persistent_sample_pages;
+@@global.innodb_stats_persistent_sample_pages
+10
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_persistent_sample_pages';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_PERSISTENT_SAMPLE_PAGES 10
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_persistent_sample_pages';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_PERSISTENT_SAMPLE_PAGES 10
+SET session innodb_stats_persistent_sample_pages=1;
+ERROR HY000: Variable 'innodb_stats_persistent_sample_pages' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_stats_persistent_sample_pages=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_persistent_sample_pages'
+SET global innodb_stats_persistent_sample_pages=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_persistent_sample_pages'
+SET global innodb_stats_persistent_sample_pages="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_persistent_sample_pages'
+SET global innodb_stats_persistent_sample_pages=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_stats_persistent_sample_p value: '-7'
+SELECT @@global.innodb_stats_persistent_sample_pages;
+@@global.innodb_stats_persistent_sample_pages
+1
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_persistent_sample_pages';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_PERSISTENT_SAMPLE_PAGES 1
+SET @@global.innodb_stats_persistent_sample_pages = @start_global_value;
+SELECT @@global.innodb_stats_persistent_sample_pages;
+@@global.innodb_stats_persistent_sample_pages
+20
diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result
index 153ae95a4fe..e490773b63a 100644
--- a/mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result
@@ -24,6 +24,8 @@ select * from information_schema.session_variables where variable_name='innodb_s
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_SAMPLE_PAGES 8
set global innodb_stats_sample_pages=10;
+Warnings:
+Warning 131 Using innodb_stats_sample_pages is deprecated and the variable may be removed in future releases. Please use innodb_stats_transient_sample_pages instead.
select @@global.innodb_stats_sample_pages;
@@global.innodb_stats_sample_pages
10
@@ -44,6 +46,7 @@ ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
set global innodb_stats_sample_pages=-7;
Warnings:
Warning 1292 Truncated incorrect innodb_stats_sample_pages value: '-7'
+Warning 131 Using innodb_stats_sample_pages is deprecated and the variable may be removed in future releases. Please use innodb_stats_transient_sample_pages instead.
select @@global.innodb_stats_sample_pages;
@@global.innodb_stats_sample_pages
1
@@ -51,6 +54,8 @@ select * from information_schema.global_variables where variable_name='innodb_st
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_SAMPLE_PAGES 1
SET @@global.innodb_stats_sample_pages = @start_global_value;
+Warnings:
+Warning 131 Using innodb_stats_sample_pages is deprecated and the variable may be removed in future releases. Please use innodb_stats_transient_sample_pages instead.
SELECT @@global.innodb_stats_sample_pages;
@@global.innodb_stats_sample_pages
8
diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_transient_sample_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_transient_sample_pages_basic.result
new file mode 100644
index 00000000000..4c60dd5a697
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_stats_transient_sample_pages_basic.result
@@ -0,0 +1,61 @@
+SET @start_global_value = @@global.innodb_stats_transient_sample_pages;
+SELECT @start_global_value;
+@start_global_value
+8
+Valid values are zero or above
+SELECT @@global.innodb_stats_transient_sample_pages >=0;
+@@global.innodb_stats_transient_sample_pages >=0
+1
+SELECT @@global.innodb_stats_transient_sample_pages;
+@@global.innodb_stats_transient_sample_pages
+8
+SELECT @@session.innodb_stats_transient_sample_pages;
+ERROR HY000: Variable 'innodb_stats_transient_sample_pages' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_stats_transient_sample_pages';
+Variable_name Value
+innodb_stats_transient_sample_pages 8
+SHOW session variables LIKE 'innodb_stats_transient_sample_pages';
+Variable_name Value
+innodb_stats_transient_sample_pages 8
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_transient_sample_pages';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_TRANSIENT_SAMPLE_PAGES 8
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_transient_sample_pages';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_TRANSIENT_SAMPLE_PAGES 8
+SET global innodb_stats_transient_sample_pages=10;
+SELECT @@global.innodb_stats_transient_sample_pages;
+@@global.innodb_stats_transient_sample_pages
+10
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_transient_sample_pages';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_TRANSIENT_SAMPLE_PAGES 10
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_transient_sample_pages';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_TRANSIENT_SAMPLE_PAGES 10
+SET session innodb_stats_transient_sample_pages=1;
+ERROR HY000: Variable 'innodb_stats_transient_sample_pages' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_stats_transient_sample_pages=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_transient_sample_pages'
+SET global innodb_stats_transient_sample_pages=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_transient_sample_pages'
+SET global innodb_stats_transient_sample_pages="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_transient_sample_pages'
+SET global innodb_stats_transient_sample_pages=-7;
+Warnings:
+Warning 1292 Truncated incorrect innodb_stats_transient_sample_pa value: '-7'
+SELECT @@global.innodb_stats_transient_sample_pages;
+@@global.innodb_stats_transient_sample_pages
+1
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_transient_sample_pages';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATS_TRANSIENT_SAMPLE_PAGES 1
+SET @@global.innodb_stats_transient_sample_pages = @start_global_value;
+SELECT @@global.innodb_stats_transient_sample_pages;
+@@global.innodb_stats_transient_sample_pages
+8
diff --git a/mysql-test/suite/sys_vars/r/innodb_status_output_basic.result b/mysql-test/suite/sys_vars/r/innodb_status_output_basic.result
new file mode 100644
index 00000000000..35731a2334b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_status_output_basic.result
@@ -0,0 +1,102 @@
+SET @start_global_value = @@global.innodb_status_output;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_status_output in (0, 1);
+@@global.innodb_status_output in (0, 1)
+1
+select @@global.innodb_status_output;
+@@global.innodb_status_output
+0
+select @@session.innodb_status_output;
+ERROR HY000: Variable 'innodb_status_output' is a GLOBAL variable
+show global variables like 'innodb_status_output';
+Variable_name Value
+innodb_status_output OFF
+show session variables like 'innodb_status_output';
+Variable_name Value
+innodb_status_output OFF
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT OFF
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT OFF
+set global innodb_status_output='OFF';
+select @@global.innodb_status_output;
+@@global.innodb_status_output
+0
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT OFF
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT OFF
+set @@global.innodb_status_output=1;
+select @@global.innodb_status_output;
+@@global.innodb_status_output
+1
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT ON
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT ON
+set global innodb_status_output=0;
+select @@global.innodb_status_output;
+@@global.innodb_status_output
+0
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT OFF
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT OFF
+set @@global.innodb_status_output='ON';
+select @@global.innodb_status_output;
+@@global.innodb_status_output
+1
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT ON
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT ON
+set session innodb_status_output='OFF';
+ERROR HY000: Variable 'innodb_status_output' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_status_output='ON';
+ERROR HY000: Variable 'innodb_status_output' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_status_output=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_status_output'
+set global innodb_status_output=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_status_output'
+set global innodb_status_output=2;
+ERROR 42000: Variable 'innodb_status_output' can't be set to the value of '2'
+set global innodb_status_output=-3;
+ERROR 42000: Variable 'innodb_status_output' can't be set to the value of '-3'
+select @@global.innodb_status_output;
+@@global.innodb_status_output
+1
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT ON
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT ON
+set global innodb_status_output=DEFAULT;
+select @@global.innodb_status_output;
+@@global.innodb_status_output
+0
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT OFF
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT OFF
+set global innodb_status_output='AUTO';
+ERROR 42000: Variable 'innodb_status_output' can't be set to the value of 'AUTO'
+SET @@global.innodb_status_output = @start_global_value;
+SELECT @@global.innodb_status_output;
+@@global.innodb_status_output
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_status_output_locks_basic.result b/mysql-test/suite/sys_vars/r/innodb_status_output_locks_basic.result
new file mode 100644
index 00000000000..6fc741a7975
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_status_output_locks_basic.result
@@ -0,0 +1,102 @@
+SET @start_global_value = @@global.innodb_status_output_locks;
+SELECT @start_global_value;
+@start_global_value
+0
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_status_output_locks in (0, 1);
+@@global.innodb_status_output_locks in (0, 1)
+1
+select @@global.innodb_status_output_locks;
+@@global.innodb_status_output_locks
+0
+select @@session.innodb_status_output_locks;
+ERROR HY000: Variable 'innodb_status_output_locks' is a GLOBAL variable
+show global variables like 'innodb_status_output_locks';
+Variable_name Value
+innodb_status_output_locks OFF
+show session variables like 'innodb_status_output_locks';
+Variable_name Value
+innodb_status_output_locks OFF
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS OFF
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS OFF
+set global innodb_status_output_locks='OFF';
+select @@global.innodb_status_output_locks;
+@@global.innodb_status_output_locks
+0
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS OFF
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS OFF
+set @@global.innodb_status_output_locks=1;
+select @@global.innodb_status_output_locks;
+@@global.innodb_status_output_locks
+1
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS ON
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS ON
+set global innodb_status_output_locks=0;
+select @@global.innodb_status_output_locks;
+@@global.innodb_status_output_locks
+0
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS OFF
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS OFF
+set @@global.innodb_status_output_locks='ON';
+select @@global.innodb_status_output_locks;
+@@global.innodb_status_output_locks
+1
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS ON
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS ON
+set session innodb_status_output_locks='OFF';
+ERROR HY000: Variable 'innodb_status_output_locks' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_status_output_locks='ON';
+ERROR HY000: Variable 'innodb_status_output_locks' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_status_output_locks=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_status_output_locks'
+set global innodb_status_output_locks=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_status_output_locks'
+set global innodb_status_output_locks=2;
+ERROR 42000: Variable 'innodb_status_output_locks' can't be set to the value of '2'
+set global innodb_status_output_locks=-3;
+ERROR 42000: Variable 'innodb_status_output_locks' can't be set to the value of '-3'
+select @@global.innodb_status_output_locks;
+@@global.innodb_status_output_locks
+1
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS ON
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS ON
+set global innodb_status_output_locks=DEFAULT;
+select @@global.innodb_status_output_locks;
+@@global.innodb_status_output_locks
+0
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS OFF
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_STATUS_OUTPUT_LOCKS OFF
+set global innodb_status_output_locks='AUTO';
+ERROR 42000: Variable 'innodb_status_output_locks' can't be set to the value of 'AUTO'
+SET @@global.innodb_status_output_locks = @start_global_value;
+SELECT @@global.innodb_status_output_locks;
+@@global.innodb_status_output_locks
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_sync_array_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_sync_array_size_basic.result
new file mode 100644
index 00000000000..526dd7d8350
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_sync_array_size_basic.result
@@ -0,0 +1,30 @@
+Valid values are between 0 and 1024
+SELECT @@global.innodb_sync_array_size between 0 and 1024;
+@@global.innodb_sync_array_size between 0 and 1024
+1
+SELECT @@global.innodb_sync_array_size;
+@@global.innodb_sync_array_size
+1
+SELECT @@session.innodb_sync_array_size;
+ERROR HY000: Variable 'innodb_sync_array_size' is a GLOBAL variable
+SHOW GLOBAL variables LIKE 'innodb_sync_array_size';
+Variable_name Value
+innodb_sync_array_size 1
+SHOW SESSION variables LIKE 'innodb_sync_array_size';
+Variable_name Value
+innodb_sync_array_size 1
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_sync_array_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_SYNC_ARRAY_SIZE 1
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_sync_array_size';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_SYNC_ARRAY_SIZE 1
+SET GLOBAL innodb_sync_array_size=10;
+ERROR HY000: Variable 'innodb_sync_array_size' is a read only variable
+SET SESSION innodb_sync_array_size=10;
+ERROR HY000: Variable 'innodb_sync_array_size' is a read only variable
+SELECT @@global.innodb_sync_array_size;
+@@global.innodb_sync_array_size
+1
diff --git a/mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result b/mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result
new file mode 100644
index 00000000000..be10c93b56b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_tmpdir_basic.result
@@ -0,0 +1,35 @@
+SET @start_global_value = @@global.innodb_tmpdir;
+SELECT @start_global_value;
+@start_global_value
+NULL
+select @@session.innodb_tmpdir;
+@@session.innodb_tmpdir
+NULL
+show global variables like 'innodb_tmpdir';
+Variable_name Value
+innodb_tmpdir
+show session variables like 'innodb_tmpdir';
+Variable_name Value
+innodb_tmpdir
+select * from information_schema.global_variables where variable_name='innodb_tmpdir';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_TMPDIR
+select * from information_schema.session_variables where variable_name='innodb_tmpdir';
+VARIABLE_NAME VARIABLE_VALUE
+INNODB_TMPDIR
+set global innodb_tmpdir=@@global.tmpdir;
+set session innodb_tmpdir=@@global.tmpdir;
+set global innodb_tmpdir=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_tmpdir'
+set global innodb_tmpdir=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_tmpdir'
+set global innodb_tmpdir=repeat('a',1000);
+ERROR 42000: Variable 'innodb_tmpdir' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+show warnings;
+Level Code Message
+Warning 1210 Path length should not exceed 512 bytes
+Error 1231 Variable 'innodb_tmpdir' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+SET @@global.innodb_tmpdir = @start_global_value;
+SELECT @@global.innodb_tmpdir;
+@@global.innodb_tmpdir
+NULL
diff --git a/mysql-test/suite/sys_vars/r/innodb_undo_directory_basic.result b/mysql-test/suite/sys_vars/r/innodb_undo_directory_basic.result
new file mode 100644
index 00000000000..e7d7cef67c7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_undo_directory_basic.result
@@ -0,0 +1,48 @@
+SELECT @@GLOBAL.innodb_undo_directory;
+@@GLOBAL.innodb_undo_directory
+.
+. Expected
+SET @@GLOBAL.innodb_undo_directory="/tmp";
+ERROR HY000: Variable 'innodb_undo_directory' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_undo_directory);
+COUNT(@@GLOBAL.innodb_undo_directory)
+1
+1 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_directory';
+VARIABLE_VALUE
+.
+. Expected
+SELECT COUNT(@@GLOBAL.innodb_undo_directory);
+COUNT(@@GLOBAL.innodb_undo_directory)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_directory';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+SELECT @@innodb_undo_directory = @@GLOBAL.innodb_undo_directory;
+@@innodb_undo_directory = @@GLOBAL.innodb_undo_directory
+1
+1 Expected
+SELECT COUNT(@@innodb_undo_directory);
+COUNT(@@innodb_undo_directory)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_undo_directory);
+ERROR HY000: Variable 'innodb_undo_directory' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_undo_directory);
+ERROR HY000: Variable 'innodb_undo_directory' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_undo_directory);
+COUNT(@@GLOBAL.innodb_undo_directory)
+1
+1 Expected
+SELECT innodb_undo_directory = @@SESSION.innodb_undo_directory;
+ERROR 42S22: Unknown column 'innodb_undo_directory' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_undo_logs_basic.result b/mysql-test/suite/sys_vars/r/innodb_undo_logs_basic.result
new file mode 100644
index 00000000000..1310d7151fd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_undo_logs_basic.result
@@ -0,0 +1,68 @@
+SELECT @@GLOBAL.innodb_undo_logs;
+@@GLOBAL.innodb_undo_logs
+128
+128 Expected
+SET @@GLOBAL.innodb_undo_logs=128;
+SELECT COUNT(@@GLOBAL.innodb_undo_logs);
+COUNT(@@GLOBAL.innodb_undo_logs)
+1
+1 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_logs';
+VARIABLE_VALUE
+128
+128 Expected
+SELECT @@innodb_undo_logs = @@GLOBAL.innodb_undo_logs;
+@@innodb_undo_logs = @@GLOBAL.innodb_undo_logs
+1
+1 Expected
+SELECT COUNT(@@innodb_undo_logs);
+COUNT(@@innodb_undo_logs)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_undo_logs);
+ERROR HY000: Variable 'innodb_undo_logs' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_undo_logs);
+ERROR HY000: Variable 'innodb_undo_logs' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT innodb_undo_logs = @@SESSION.innodb_undo_logs;
+ERROR 42S22: Unknown column 'innodb_undo_logs' in 'field list'
+Begin bug 13604034
+select @@innodb_undo_logs;
+@@innodb_undo_logs
+128
+128 Expected
+set global innodb_undo_logs = 129;
+Warnings:
+Warning 1292 Truncated incorrect innodb_undo_logs value: '129'
+select @@innodb_undo_logs;
+@@innodb_undo_logs
+128
+128 Expected
+set global innodb_undo_logs = 0;
+Warnings:
+Warning 1292 Truncated incorrect innodb_undo_logs value: '0'
+select @@innodb_undo_logs;
+@@innodb_undo_logs
+1
+1 Expected
+set global innodb_undo_logs = -1;
+Warnings:
+Warning 1292 Truncated incorrect innodb_undo_logs value: '-1'
+select @@innodb_undo_logs;
+@@innodb_undo_logs
+1
+1 Expected
+set global innodb_undo_logs = 50;
+select @@innodb_undo_logs;
+@@innodb_undo_logs
+50
+50 Expected
+set global innodb_undo_logs = default;
+select @@innodb_undo_logs;
+@@innodb_undo_logs
+128
+128 Expected
+End bug 13604034
diff --git a/mysql-test/suite/sys_vars/r/innodb_undo_tablespaces_basic.result b/mysql-test/suite/sys_vars/r/innodb_undo_tablespaces_basic.result
new file mode 100644
index 00000000000..6130484ad86
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_undo_tablespaces_basic.result
@@ -0,0 +1,38 @@
+SELECT @@GLOBAL.innodb_undo_tablespaces;
+@@GLOBAL.innodb_undo_tablespaces
+0
+0 Expected
+SET @@GLOBAL.innodb_undo_tablespaces=128;
+ERROR HY000: Variable 'innodb_undo_tablespaces' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_undo_tablespaces);
+COUNT(@@GLOBAL.innodb_undo_tablespaces)
+1
+1 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_tablespaces';
+VARIABLE_VALUE
+0
+0 Expected
+SELECT @@innodb_undo_tablespaces = @@GLOBAL.innodb_undo_tablespaces;
+@@innodb_undo_tablespaces = @@GLOBAL.innodb_undo_tablespaces
+1
+1 Expected
+SELECT COUNT(@@innodb_undo_tablespaces);
+COUNT(@@innodb_undo_tablespaces)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_undo_tablespaces);
+ERROR HY000: Variable 'innodb_undo_tablespaces' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_undo_tablespaces);
+ERROR HY000: Variable 'innodb_undo_tablespaces' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_undo_tablespaces);
+COUNT(@@GLOBAL.innodb_undo_tablespaces)
+1
+1 Expected
+SELECT innodb_undo_tablespaces = @@SESSION.innodb_undo_tablespaces;
+ERROR 42S22: Unknown column 'innodb_undo_tablespaces' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result b/mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result
new file mode 100644
index 00000000000..52ebfc98cdc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result
@@ -0,0 +1,114 @@
+SET @start_value = @@global.key_cache_file_hash_size;
+SELECT @start_value;
+@start_value
+512
+'#--------------------FN_DYNVARS_056_01------------------------#'
+SET @@global.key_cache_file_hash_size = DEFAULT;
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+512
+'#---------------------FN_DYNVARS_056_02-------------------------#'
+SET @@global.key_cache_file_hash_size = @start_value;
+SELECT @@global.key_cache_file_hash_size = 300;
+@@global.key_cache_file_hash_size = 300
+0
+'#--------------------FN_DYNVARS_056_03------------------------#'
+SET @@global.key_cache_file_hash_size = 128;
+SET @@global.key_cache_file_hash_size = 16384;
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+16384
+'#--------------------FN_DYNVARS_056_04-------------------------#'
+SET @@global.key_cache_file_hash_size = -1;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_file_hash_size value: '-1'
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+128
+SET @@global.key_cache_file_hash_size = 42949672951;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_file_hash_size value: '42949672951'
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+16384
+SET @@global.key_cache_file_hash_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'key_cache_file_hash_size'
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+16384
+SET @@global.key_cache_file_hash_size = -1024;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_file_hash_size value: '-1024'
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+128
+SET @@global.key_cache_file_hash_size = 99;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_file_hash_size value: '99'
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+128
+SET @@global.key_cache_file_hash_size = ON;
+ERROR 42000: Incorrect argument type to variable 'key_cache_file_hash_size'
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+128
+SET @@global.key_cache_file_hash_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'key_cache_file_hash_size'
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+128
+'#-------------------FN_DYNVARS_056_05----------------------------#'
+SET @@session.key_cache_file_hash_size = 0;
+ERROR HY000: Variable 'key_cache_file_hash_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.key_cache_file_hash_size;
+ERROR HY000: Variable 'key_cache_file_hash_size' is a GLOBAL variable
+'#----------------------FN_DYNVARS_056_06------------------------#'
+SELECT @@global.key_cache_file_hash_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='key_cache_file_hash_size';
+@@global.key_cache_file_hash_size = VARIABLE_VALUE
+1
+SELECT @@key_cache_file_hash_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='key_cache_file_hash_size';
+@@key_cache_file_hash_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_056_07----------------------#'
+SET @@global.key_cache_file_hash_size = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_file_hash_size value: '1'
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+128
+SET @@global.key_cache_file_hash_size = FALSE;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_file_hash_size value: '0'
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+128
+'#---------------------FN_DYNVARS_056_08----------------------#'
+SET @@global.key_cache_file_hash_size = 150;
+SELECT @@key_cache_file_hash_size = @@global.key_cache_file_hash_size;
+@@key_cache_file_hash_size = @@global.key_cache_file_hash_size
+1
+'#---------------------FN_DYNVARS_056_09----------------------#'
+SET key_cache_file_hash_size = 8000;
+ERROR HY000: Variable 'key_cache_file_hash_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_cache_file_hash_size;
+@@key_cache_file_hash_size
+150
+SET local.key_cache_file_hash_size = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key_cache_file_hash_size = 10' at line 1
+SELECT local.key_cache_file_hash_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.key_cache_file_hash_size = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key_cache_file_hash_size = 10' at line 1
+SELECT global.key_cache_file_hash_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT key_cache_file_hash_size = @@session.key_cache_file_hash_size;
+ERROR 42S22: Unknown column 'key_cache_file_hash_size' in 'field list'
+SET @@global.key_cache_file_hash_size = @start_value;
+SELECT @@global.key_cache_file_hash_size;
+@@global.key_cache_file_hash_size
+512
diff --git a/mysql-test/suite/sys_vars/r/last_gtid_basic.result b/mysql-test/suite/sys_vars/r/last_gtid_basic.result
new file mode 100644
index 00000000000..d39b6595f04
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/last_gtid_basic.result
@@ -0,0 +1,9 @@
+SELECT @@global.last_gtid;
+ERROR HY000: Variable 'last_gtid' is a SESSION variable
+SET GLOBAL last_gtid= 10;
+ERROR HY000: Variable 'last_gtid' is a read only variable
+SET SESSION last_gtid= 20;
+ERROR HY000: Variable 'last_gtid' is a read only variable
+SELECT @@session.last_gtid;
+@@session.last_gtid
+
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 e61436c0e47..ed03c3e6d94 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
@@ -1022,7 +1022,11 @@ SELECT @@lc_time_names;
@@lc_time_names
el_GR
SET @@lc_time_names = 110;
-ERROR HY000: Unknown locale: '110'
+SELECT @@lc_time_names;
+@@lc_time_names
+rm_CH
+SET @@lc_time_names = 111;
+ERROR HY000: Unknown locale: '111'
'#--------------------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/log_slow_verbosity_basic.result b/mysql-test/suite/sys_vars/r/log_slow_verbosity_basic.result
index 24b805d4d9c..a291e276e4b 100644
--- a/mysql-test/suite/sys_vars/r/log_slow_verbosity_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_slow_verbosity_basic.result
@@ -37,6 +37,22 @@ set session log_slow_verbosity=3;
select @@session.log_slow_verbosity;
@@session.log_slow_verbosity
innodb,query_plan
+set session log_slow_verbosity=4;
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+explain
+set session log_slow_verbosity=5;
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+innodb,explain
+set session log_slow_verbosity=6;
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+query_plan,explain
+set session log_slow_verbosity=7;
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+innodb,query_plan,explain
set session log_slow_verbosity='innodb';
select @@session.log_slow_verbosity;
@@session.log_slow_verbosity
@@ -49,6 +65,14 @@ set session log_slow_verbosity='innodb,query_plan';
select @@session.log_slow_verbosity;
@@session.log_slow_verbosity
innodb,query_plan
+set session log_slow_verbosity='explain';
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+explain
+set session log_slow_verbosity='innodb,query_plan,explain';
+select @@session.log_slow_verbosity;
+@@session.log_slow_verbosity
+innodb,query_plan,explain
set session log_slow_verbosity='';
select @@session.log_slow_verbosity;
@@session.log_slow_verbosity
@@ -59,6 +83,6 @@ set session log_slow_verbosity=1e1;
ERROR 42000: Incorrect argument type to variable 'log_slow_verbosity'
set session log_slow_verbosity="foo";
ERROR 42000: Variable 'log_slow_verbosity' can't be set to the value of 'foo'
-set session log_slow_verbosity=4;
-ERROR 42000: Variable 'log_slow_verbosity' can't be set to the value of '4'
+set session log_slow_verbosity=8;
+ERROR 42000: Variable 'log_slow_verbosity' can't be set to the value of '8'
SET @@global.log_slow_verbosity = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/max_connect_errors_basic.result b/mysql-test/suite/sys_vars/r/max_connect_errors_basic.result
index be1a58394b8..99bc0727ad8 100644
--- a/mysql-test/suite/sys_vars/r/max_connect_errors_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_connect_errors_basic.result
@@ -1,18 +1,18 @@
SET @start_value = @@global.max_connect_errors;
SELECT @start_value;
@start_value
-10
+100
'#--------------------FN_DYNVARS_073_01------------------------#'
SET @@global.max_connect_errors = 5000;
SET @@global.max_connect_errors = DEFAULT;
SELECT @@global.max_connect_errors;
@@global.max_connect_errors
-10
+100
'#---------------------FN_DYNVARS_073_02-------------------------#'
SET @@global.max_connect_errors = @start_value;
SELECT @@global.max_connect_errors = 10;
@@global.max_connect_errors = 10
-1
+0
'#--------------------FN_DYNVARS_073_03------------------------#'
SET @@global.max_connect_errors = 4096;
SELECT @@global.max_connect_errors;
@@ -131,4 +131,4 @@ ERROR 42S22: Unknown column 'max_connect_errors' in 'field list'
SET @@global.max_connect_errors = @start_value;
SELECT @@global.max_connect_errors;
@@global.max_connect_errors
-10
+100
diff --git a/mysql-test/suite/sys_vars/r/max_digest_length_basic.result b/mysql-test/suite/sys_vars/r/max_digest_length_basic.result
new file mode 100644
index 00000000000..1a733273614
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_digest_length_basic.result
@@ -0,0 +1,23 @@
+select @@global.max_digest_length;
+@@global.max_digest_length
+1024
+select @@session.max_digest_length;
+ERROR HY000: Variable 'max_digest_length' is a GLOBAL variable
+show global variables like 'max_digest_length';
+Variable_name Value
+max_digest_length 1024
+show session variables like 'max_digest_length';
+Variable_name Value
+max_digest_length 1024
+select * from information_schema.global_variables
+where variable_name='max_digest_length';
+VARIABLE_NAME VARIABLE_VALUE
+MAX_DIGEST_LENGTH 1024
+select * from information_schema.session_variables
+where variable_name='max_digest_length';
+VARIABLE_NAME VARIABLE_VALUE
+MAX_DIGEST_LENGTH 1024
+set global max_digest_length=1;
+ERROR HY000: Variable 'max_digest_length' is a read only variable
+set session max_digest_length=1;
+ERROR HY000: Variable 'max_digest_length' is a read only variable
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 d61e9dd20b0..6025e28ccaa 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
@@ -1,7 +1,7 @@
SET @start_value = @@global.max_relay_log_size;
SELECT @start_value;
@start_value
-0
+1073741824
'#--------------------FN_DYNVARS_082_01------------------------#'
SET @@global.max_relay_log_size = 5000;
Warnings:
@@ -9,7 +9,7 @@ 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
-0
+1073741824
'#---------------------FN_DYNVARS_082_02-------------------------#'
SET @@global.max_relay_log_size = @start_value;
SELECT @@global.max_relay_log_size = 1024;
@@ -17,15 +17,17 @@ SELECT @@global.max_relay_log_size = 1024;
0
'#--------------------FN_DYNVARS_082_03------------------------#'
SET @@global.max_relay_log_size = 0;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '0'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
-0
+4096
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
+4096
SET @@global.max_relay_log_size = 1073741824;
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
@@ -48,7 +50,7 @@ Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '-1'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
-0
+4096
SET @@global.max_relay_log_size = 100000000000;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '100000000000'
@@ -65,7 +67,7 @@ Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '-1024'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
-0
+4096
SET @@global.max_relay_log_size = 1073741825;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '1073741825'
@@ -90,9 +92,9 @@ SELECT @@global.max_relay_log_size;
1073741824
'#-------------------FN_DYNVARS_082_05----------------------------#'
SET @@session.max_relay_log_size = 4096;
-ERROR HY000: Variable 'max_relay_log_size' is a GLOBAL variable and should be set with SET GLOBAL
SELECT @@session.max_relay_log_size;
-ERROR HY000: Variable 'max_relay_log_size' is a GLOBAL variable
+@@session.max_relay_log_size
+4096
'#----------------------FN_DYNVARS_082_06------------------------#'
SELECT @@global.max_relay_log_size = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -110,11 +112,13 @@ Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '1'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
-0
+4096
SET @@global.max_relay_log_size = FALSE;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '0'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
-0
+4096
'#---------------------FN_DYNVARS_082_08----------------------#'
SET @@global.max_relay_log_size = 5000;
Warnings:
@@ -124,7 +128,8 @@ SELECT @@max_relay_log_size = @@global.max_relay_log_size;
1
'#---------------------FN_DYNVARS_082_09----------------------#'
SET max_relay_log_size = 6000;
-ERROR HY000: Variable 'max_relay_log_size' is a GLOBAL variable and should be set with SET GLOBAL
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '6000'
SELECT @@max_relay_log_size;
@@max_relay_log_size
4096
@@ -141,4 +146,4 @@ ERROR 42S22: Unknown column 'max_relay_log_size' in 'field list'
SET @@global.max_relay_log_size = @start_value;
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
-0
+1073741824
diff --git a/mysql-test/suite/sys_vars/r/metadata_locks_hash_instances_basic.result b/mysql-test/suite/sys_vars/r/metadata_locks_hash_instances_basic.result
new file mode 100644
index 00000000000..46e65fbc003
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/metadata_locks_hash_instances_basic.result
@@ -0,0 +1,51 @@
+####################################################################
+# Displaying default value #
+####################################################################
+SELECT @@GLOBAL.metadata_locks_hash_instances;
+@@GLOBAL.metadata_locks_hash_instances
+8
+####################################################################
+# Check that value cannot be set (this variable is settable only #
+# at start-up). #
+####################################################################
+SET @@GLOBAL.metadata_locks_hash_instances=1;
+ERROR HY000: Variable 'metadata_locks_hash_instances' is a read only variable
+SELECT @@GLOBAL.metadata_locks_hash_instances;
+@@GLOBAL.metadata_locks_hash_instances
+8
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#################################################################
+SELECT @@GLOBAL.metadata_locks_hash_instances = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='metadata_locks_hash_instances';
+@@GLOBAL.metadata_locks_hash_instances = VARIABLE_VALUE
+1
+SELECT @@GLOBAL.metadata_locks_hash_instances;
+@@GLOBAL.metadata_locks_hash_instances
+8
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='metadata_locks_hash_instances';
+VARIABLE_VALUE
+8
+######################################################################
+# Check if accessing variable with and without GLOBAL point to same #
+# variable #
+######################################################################
+SELECT @@metadata_locks_hash_instances = @@GLOBAL.metadata_locks_hash_instances;
+@@metadata_locks_hash_instances = @@GLOBAL.metadata_locks_hash_instances
+1
+######################################################################
+# Check if variable has only the GLOBAL scope #
+######################################################################
+SELECT @@metadata_locks_hash_instances;
+@@metadata_locks_hash_instances
+8
+SELECT @@GLOBAL.metadata_locks_hash_instances;
+@@GLOBAL.metadata_locks_hash_instances
+8
+SELECT @@local.metadata_locks_hash_instances;
+ERROR HY000: Variable 'metadata_locks_hash_instances' is a GLOBAL variable
+SELECT @@SESSION.metadata_locks_hash_instances;
+ERROR HY000: Variable 'metadata_locks_hash_instances' is a GLOBAL variable
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
index 85482be9ad4..932d06668fb 100644
--- 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
@@ -1,11 +1,11 @@
SET @start_global_value = @@global.myisam_sort_buffer_size ;
SELECT @start_global_value;
@start_global_value
-8388608
+134216704
SET @start_session_value = @@session.myisam_sort_buffer_size ;
SELECT @start_session_value;
@start_session_value
-8388608
+134216704
'#--------------------FN_DYNVARS_005_01-------------------------#'
SET @@global.myisam_sort_buffer_size = 100;
Warnings:
@@ -13,22 +13,22 @@ Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100'
SET @@global.myisam_sort_buffer_size = DEFAULT;
SELECT @@global.myisam_sort_buffer_size ;
@@global.myisam_sort_buffer_size
-8388608
+134216704
SET @@session.myisam_sort_buffer_size = 200;
Warnings:
Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '200'
SET @@session.myisam_sort_buffer_size = DEFAULT;
SELECT @@session.myisam_sort_buffer_size ;
@@session.myisam_sort_buffer_size
-8388608
+134216704
'#--------------------FN_DYNVARS_005_02-------------------------#'
SET @@global.myisam_sort_buffer_size = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size = 8388608;
-@@global.myisam_sort_buffer_size = 8388608
+SELECT @@global.myisam_sort_buffer_size = 134216704;
+@@global.myisam_sort_buffer_size = 134216704
1
SET @@session.myisam_sort_buffer_size = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size = 8388608;
-@@session.myisam_sort_buffer_size = 8388608
+SELECT @@session.myisam_sort_buffer_size = 134216704;
+@@session.myisam_sort_buffer_size = 134216704
1
'#--------------------FN_DYNVARS_005_03-------------------------#'
SET @@global.myisam_sort_buffer_size = 4;
@@ -187,8 +187,8 @@ 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
+134216704
SET @@session.myisam_sort_buffer_size = @start_session_value;
SELECT @@session.myisam_sort_buffer_size ;
@@session.myisam_sort_buffer_size
-8388608
+134216704
diff --git a/mysql-test/suite/sys_vars/r/old_mode_basic.result b/mysql-test/suite/sys_vars/r/old_mode_basic.result
index c9a650e7b15..052221d796e 100644
--- a/mysql-test/suite/sys_vars/r/old_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/old_mode_basic.result
@@ -111,10 +111,14 @@ SELECT @@global.old_mode;
@@global.old_mode
NO_PROGRESS_INFO
SET @@global.old_mode = 4;
-ERROR 42000: Variable 'old_mode' can't be set to the value of '4'
SELECT @@global.old_mode;
@@global.old_mode
-NO_PROGRESS_INFO
+ZERO_DATE_TIME_CAST
+SET @@global.old_mode = 8;
+ERROR 42000: Variable 'old_mode' can't be set to the value of '8'
+SELECT @@global.old_mode;
+@@global.old_mode
+ZERO_DATE_TIME_CAST
SET @@global.old_mode = 0.4;
ERROR 42000: Incorrect argument type to variable 'old_mode'
'#---------------------FN_DYNVARS_152_08----------------------#'
diff --git a/mysql-test/suite/sys_vars/r/optimizer_selectivity_sampling_limit_basic.result b/mysql-test/suite/sys_vars/r/optimizer_selectivity_sampling_limit_basic.result
new file mode 100644
index 00000000000..4df024b9cec
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/optimizer_selectivity_sampling_limit_basic.result
@@ -0,0 +1,141 @@
+SET @start_global_value = @@global.optimizer_selectivity_sampling_limit;
+SELECT @start_global_value;
+@start_global_value
+100
+SET @start_session_value = @@session.optimizer_selectivity_sampling_limit;
+SELECT @start_session_value;
+@start_session_value
+100
+'#--------------------FN_DYNVARS_115_01-------------------------#'
+SET @@global.optimizer_selectivity_sampling_limit = DEFAULT;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+@@global.optimizer_selectivity_sampling_limit
+100
+SET @@session.optimizer_selectivity_sampling_limit = DEFAULT;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+@@session.optimizer_selectivity_sampling_limit
+100
+'#--------------------FN_DYNVARS_115_02-------------------------#'
+SET @@global.optimizer_selectivity_sampling_limit = DEFAULT;
+SELECT @@global.optimizer_selectivity_sampling_limit = 100;
+@@global.optimizer_selectivity_sampling_limit = 100
+1
+SET @@session.optimizer_selectivity_sampling_limit = DEFAULT;
+SELECT @@session.optimizer_selectivity_sampling_limit = 100;
+@@session.optimizer_selectivity_sampling_limit = 100
+1
+'#--------------------FN_DYNVARS_115_03-------------------------#'
+SELECT @@global.optimizer_selectivity_sampling_limit;
+@@global.optimizer_selectivity_sampling_limit
+100
+SET @@global.optimizer_selectivity_sampling_limit = 9;
+Warnings:
+Warning 1292 Truncated incorrect optimizer_selectivity_sampling_l value: '9'
+SELECT @@global.optimizer_selectivity_sampling_limit;
+@@global.optimizer_selectivity_sampling_limit
+10
+SET @@global.optimizer_selectivity_sampling_limit = 10;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+@@global.optimizer_selectivity_sampling_limit
+10
+SET @@global.optimizer_selectivity_sampling_limit = 11;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+@@global.optimizer_selectivity_sampling_limit
+11
+SET @@global.optimizer_selectivity_sampling_limit = 7777;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+@@global.optimizer_selectivity_sampling_limit
+7777
+SET @@global.optimizer_selectivity_sampling_limit = 4294967294;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+@@global.optimizer_selectivity_sampling_limit
+4294967294
+SET @@global.optimizer_selectivity_sampling_limit = 4294967295;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+@@global.optimizer_selectivity_sampling_limit
+4294967295
+SET @@global.optimizer_selectivity_sampling_limit = 4294967296;
+Warnings:
+Warning 1292 Truncated incorrect optimizer_selectivity_sampling_l value: '4294967296'
+SELECT @@global.optimizer_selectivity_sampling_limit;
+@@global.optimizer_selectivity_sampling_limit
+4294967295
+'#--------------------FN_DYNVARS_115_04-------------------------#'
+SELECT @@session.optimizer_selectivity_sampling_limit;
+@@session.optimizer_selectivity_sampling_limit
+100
+SET @@session.optimizer_selectivity_sampling_limit = 9;
+Warnings:
+Warning 1292 Truncated incorrect optimizer_selectivity_sampling_l value: '9'
+SELECT @@session.optimizer_selectivity_sampling_limit;
+@@session.optimizer_selectivity_sampling_limit
+10
+SET @@session.optimizer_selectivity_sampling_limit = 10;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+@@session.optimizer_selectivity_sampling_limit
+10
+SET @@session.optimizer_selectivity_sampling_limit = 11;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+@@session.optimizer_selectivity_sampling_limit
+11
+SET @@session.optimizer_selectivity_sampling_limit = 7777;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+@@session.optimizer_selectivity_sampling_limit
+7777
+SET @@session.optimizer_selectivity_sampling_limit = 4294967294;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+@@session.optimizer_selectivity_sampling_limit
+4294967294
+SET @@session.optimizer_selectivity_sampling_limit = 4294967295;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+@@session.optimizer_selectivity_sampling_limit
+4294967295
+SET @@session.optimizer_selectivity_sampling_limit = 4294967296;
+Warnings:
+Warning 1292 Truncated incorrect optimizer_selectivity_sampling_l value: '4294967296'
+SELECT @@session.optimizer_selectivity_sampling_limit;
+@@session.optimizer_selectivity_sampling_limit
+4294967295
+'#------------------FN_DYNVARS_115_05-----------------------#'
+SET @@global.optimizer_selectivity_sampling_limit = ON;
+ERROR 42000: Incorrect argument type to variable 'optimizer_selectivity_sampling_limit'
+SET @@global.optimizer_selectivity_sampling_limit = OFF;
+ERROR 42000: Incorrect argument type to variable 'optimizer_selectivity_sampling_limit'
+SET @@session.optimizer_selectivity_sampling_limit = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'optimizer_selectivity_sampling_limit'
+SET @@session.optimizer_selectivity_sampling_limit = test;
+ERROR 42000: Incorrect argument type to variable 'optimizer_selectivity_sampling_limit'
+'#------------------FN_DYNVARS_115_06-----------------------#'
+SELECT @@global.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='optimizer_selectivity_sampling_limit';
+@@global.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_115_07-----------------------#'
+SELECT @@session.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='optimizer_selectivity_sampling_limit';
+@@session.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_115_08----------------------#'
+SET @@optimizer_selectivity_sampling_limit = 10;
+SET @@global.optimizer_selectivity_sampling_limit = 30;
+SELECT @@optimizer_selectivity_sampling_limit = @@global.optimizer_selectivity_sampling_limit;
+@@optimizer_selectivity_sampling_limit = @@global.optimizer_selectivity_sampling_limit
+0
+'#---------------------FN_DYNVARS_115_09----------------------#'
+SET @@optimizer_selectivity_sampling_limit = 20;
+SELECT @@optimizer_selectivity_sampling_limit = @@local.optimizer_selectivity_sampling_limit;
+@@optimizer_selectivity_sampling_limit = @@local.optimizer_selectivity_sampling_limit
+1
+SELECT @@local.optimizer_selectivity_sampling_limit = @@session.optimizer_selectivity_sampling_limit;
+@@local.optimizer_selectivity_sampling_limit = @@session.optimizer_selectivity_sampling_limit
+1
+SET @@global.optimizer_selectivity_sampling_limit = @start_global_value;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+@@global.optimizer_selectivity_sampling_limit
+100
+SET @@session.optimizer_selectivity_sampling_limit = @start_session_value;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+@@session.optimizer_selectivity_sampling_limit
+100
diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
index 509c0706ca3..141ab31ea82 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
@@ -1,61 +1,61 @@
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,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=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,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=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,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=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,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=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,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
set global optimizer_switch=10;
set session optimizer_switch=5;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
set global optimizer_switch="index_merge_sort_union=on";
set session optimizer_switch="index_merge=off";
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off
+index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off
+optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off
+optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off
+OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off
+OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=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,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off
set optimizer_switch = replace(@@optimizer_switch, '=off', '=on');
select @@optimizer_switch;
@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on
set global optimizer_switch=1.1;
ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
set global optimizer_switch=1e1;
@@ -67,4 +67,4 @@ 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,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on
diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown1.result b/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown1.result
deleted file mode 100644
index 7fb9e0aaaae..00000000000
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown1.result
+++ /dev/null
@@ -1,5 +0,0 @@
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown2.result b/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown2.result
deleted file mode 100644
index 9eb3a8f942d..00000000000
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown2.result
+++ /dev/null
@@ -1,5 +0,0 @@
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
-0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
diff --git a/mysql-test/suite/sys_vars/r/optimizer_use_condition_selectivity_basic.result b/mysql-test/suite/sys_vars/r/optimizer_use_condition_selectivity_basic.result
new file mode 100644
index 00000000000..a030bae3750
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/optimizer_use_condition_selectivity_basic.result
@@ -0,0 +1,141 @@
+SET @start_global_value = @@global.optimizer_use_condition_selectivity;
+SELECT @start_global_value;
+@start_global_value
+1
+SET @start_session_value = @@session.optimizer_use_condition_selectivity;
+SELECT @start_session_value;
+@start_session_value
+1
+'#--------------------FN_DYNVARS_115_01-------------------------#'
+SET @@global.optimizer_use_condition_selectivity = DEFAULT;
+SELECT @@global.optimizer_use_condition_selectivity;
+@@global.optimizer_use_condition_selectivity
+1
+SET @@session.optimizer_use_condition_selectivity = DEFAULT;
+SELECT @@session.optimizer_use_condition_selectivity;
+@@session.optimizer_use_condition_selectivity
+1
+'#--------------------FN_DYNVARS_115_02-------------------------#'
+SET @@global.optimizer_use_condition_selectivity = DEFAULT;
+SELECT @@global.optimizer_use_condition_selectivity = 1;
+@@global.optimizer_use_condition_selectivity = 1
+1
+SET @@session.optimizer_use_condition_selectivity = DEFAULT;
+SELECT @@session.optimizer_use_condition_selectivity = 1;
+@@session.optimizer_use_condition_selectivity = 1
+1
+'#--------------------FN_DYNVARS_115_03-------------------------#'
+SELECT @@global.optimizer_use_condition_selectivity;
+@@global.optimizer_use_condition_selectivity
+1
+SET @@global.optimizer_use_condition_selectivity = 0;
+Warnings:
+Warning 1292 Truncated incorrect optimizer_use_condition_selectiv value: '0'
+SELECT @@global.optimizer_use_condition_selectivity;
+@@global.optimizer_use_condition_selectivity
+1
+SET @@global.optimizer_use_condition_selectivity = 1;
+SELECT @@global.optimizer_use_condition_selectivity;
+@@global.optimizer_use_condition_selectivity
+1
+SET @@global.optimizer_use_condition_selectivity = 2;
+SELECT @@global.optimizer_use_condition_selectivity;
+@@global.optimizer_use_condition_selectivity
+2
+SET @@global.optimizer_use_condition_selectivity = 3;
+SELECT @@global.optimizer_use_condition_selectivity;
+@@global.optimizer_use_condition_selectivity
+3
+SET @@global.optimizer_use_condition_selectivity = 4;
+SELECT @@global.optimizer_use_condition_selectivity;
+@@global.optimizer_use_condition_selectivity
+4
+SET @@global.optimizer_use_condition_selectivity = 5;
+SELECT @@global.optimizer_use_condition_selectivity;
+@@global.optimizer_use_condition_selectivity
+5
+SET @@global.optimizer_use_condition_selectivity = 6;
+Warnings:
+Warning 1292 Truncated incorrect optimizer_use_condition_selectiv value: '6'
+SELECT @@global.optimizer_use_condition_selectivity;
+@@global.optimizer_use_condition_selectivity
+5
+'#--------------------FN_DYNVARS_115_04-------------------------#'
+SELECT @@session.optimizer_use_condition_selectivity;
+@@session.optimizer_use_condition_selectivity
+1
+SET @@session.optimizer_use_condition_selectivity = 0;
+Warnings:
+Warning 1292 Truncated incorrect optimizer_use_condition_selectiv value: '0'
+SELECT @@session.optimizer_use_condition_selectivity;
+@@session.optimizer_use_condition_selectivity
+1
+SET @@session.optimizer_use_condition_selectivity = 1;
+SELECT @@session.optimizer_use_condition_selectivity;
+@@session.optimizer_use_condition_selectivity
+1
+SET @@session.optimizer_use_condition_selectivity = 2;
+SELECT @@session.optimizer_use_condition_selectivity;
+@@session.optimizer_use_condition_selectivity
+2
+SET @@session.optimizer_use_condition_selectivity = 3;
+SELECT @@session.optimizer_use_condition_selectivity;
+@@session.optimizer_use_condition_selectivity
+3
+SET @@session.optimizer_use_condition_selectivity = 4;
+SELECT @@session.optimizer_use_condition_selectivity;
+@@session.optimizer_use_condition_selectivity
+4
+SET @@session.optimizer_use_condition_selectivity = 5;
+SELECT @@session.optimizer_use_condition_selectivity;
+@@session.optimizer_use_condition_selectivity
+5
+SET @@session.optimizer_use_condition_selectivity = 6;
+Warnings:
+Warning 1292 Truncated incorrect optimizer_use_condition_selectiv value: '6'
+SELECT @@session.optimizer_use_condition_selectivity;
+@@session.optimizer_use_condition_selectivity
+5
+'#------------------FN_DYNVARS_115_05-----------------------#'
+SET @@global.optimizer_use_condition_selectivity = ON;
+ERROR 42000: Incorrect argument type to variable 'optimizer_use_condition_selectivity'
+SET @@global.optimizer_use_condition_selectivity = OFF;
+ERROR 42000: Incorrect argument type to variable 'optimizer_use_condition_selectivity'
+SET @@session.optimizer_use_condition_selectivity = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'optimizer_use_condition_selectivity'
+SET @@session.optimizer_use_condition_selectivity = test;
+ERROR 42000: Incorrect argument type to variable 'optimizer_use_condition_selectivity'
+'#------------------FN_DYNVARS_115_06-----------------------#'
+SELECT @@global.optimizer_use_condition_selectivity = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='optimizer_use_condition_selectivity';
+@@global.optimizer_use_condition_selectivity = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_115_07-----------------------#'
+SELECT @@session.optimizer_use_condition_selectivity = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='optimizer_use_condition_selectivity';
+@@session.optimizer_use_condition_selectivity = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_115_08----------------------#'
+SET @@optimizer_use_condition_selectivity = 1;
+SET @@global.optimizer_use_condition_selectivity = 3;
+SELECT @@optimizer_use_condition_selectivity = @@global.optimizer_use_condition_selectivity;
+@@optimizer_use_condition_selectivity = @@global.optimizer_use_condition_selectivity
+0
+'#---------------------FN_DYNVARS_115_09----------------------#'
+SET @@optimizer_use_condition_selectivity = 2;
+SELECT @@optimizer_use_condition_selectivity = @@local.optimizer_use_condition_selectivity;
+@@optimizer_use_condition_selectivity = @@local.optimizer_use_condition_selectivity
+1
+SELECT @@local.optimizer_use_condition_selectivity = @@session.optimizer_use_condition_selectivity;
+@@local.optimizer_use_condition_selectivity = @@session.optimizer_use_condition_selectivity
+1
+SET @@global.optimizer_use_condition_selectivity = @start_global_value;
+SELECT @@global.optimizer_use_condition_selectivity;
+@@global.optimizer_use_condition_selectivity
+1
+SET @@session.optimizer_use_condition_selectivity = @start_session_value;
+SELECT @@session.optimizer_use_condition_selectivity;
+@@session.optimizer_use_condition_selectivity
+1
diff --git a/mysql-test/suite/sys_vars/r/oqgraph_allow_create_integer_latch_basic.result b/mysql-test/suite/sys_vars/r/oqgraph_allow_create_integer_latch_basic.result
new file mode 100644
index 00000000000..9b0766513cc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/oqgraph_allow_create_integer_latch_basic.result
@@ -0,0 +1 @@
+Oqgraph extention
diff --git a/mysql-test/suite/sys_vars/r/pfs_accounts_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_accounts_size_basic.result
new file mode 100644
index 00000000000..5cee377aa73
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_accounts_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_accounts_size;
+@@global.performance_schema_accounts_size
+123
+select @@session.performance_schema_accounts_size;
+ERROR HY000: Variable 'performance_schema_accounts_size' is a GLOBAL variable
+show global variables like 'performance_schema_accounts_size';
+Variable_name Value
+performance_schema_accounts_size 123
+show session variables like 'performance_schema_accounts_size';
+Variable_name Value
+performance_schema_accounts_size 123
+select * from information_schema.global_variables
+where variable_name='performance_schema_accounts_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_ACCOUNTS_SIZE 123
+select * from information_schema.session_variables
+where variable_name='performance_schema_accounts_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_ACCOUNTS_SIZE 123
+set global performance_schema_accounts_size=1;
+ERROR HY000: Variable 'performance_schema_accounts_size' is a read only variable
+set session performance_schema_accounts_size=1;
+ERROR HY000: Variable 'performance_schema_accounts_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_digests_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_digests_size_basic.result
new file mode 100644
index 00000000000..334f5177370
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_digests_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_digests_size;
+@@global.performance_schema_digests_size
+200
+select @@session.performance_schema_digests_size;
+ERROR HY000: Variable 'performance_schema_digests_size' is a GLOBAL variable
+show global variables like 'performance_schema_digests_size';
+Variable_name Value
+performance_schema_digests_size 200
+show session variables like 'performance_schema_digests_size';
+Variable_name Value
+performance_schema_digests_size 200
+select * from information_schema.global_variables
+where variable_name='performance_schema_digests_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_DIGESTS_SIZE 200
+select * from information_schema.session_variables
+where variable_name='performance_schema_digests_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_DIGESTS_SIZE 200
+set global performance_schema_digests_size=1;
+ERROR HY000: Variable 'performance_schema_digests_size' is a read only variable
+set session performance_schema_digests_size=1;
+ERROR HY000: Variable 'performance_schema_digests_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_events_stages_history_long_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_events_stages_history_long_size_basic.result
new file mode 100644
index 00000000000..bd1b2ee2aca
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_events_stages_history_long_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_events_stages_history_long_size;
+@@global.performance_schema_events_stages_history_long_size
+15000
+select @@session.performance_schema_events_stages_history_long_size;
+ERROR HY000: Variable 'performance_schema_events_stages_history_long_size' is a GLOBAL variable
+show global variables like 'performance_schema_events_stages_history_long_size';
+Variable_name Value
+performance_schema_events_stages_history_long_size 15000
+show session variables like 'performance_schema_events_stages_history_long_size';
+Variable_name Value
+performance_schema_events_stages_history_long_size 15000
+select * from information_schema.global_variables
+where variable_name='performance_schema_events_stages_history_long_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE 15000
+select * from information_schema.session_variables
+where variable_name='performance_schema_events_stages_history_long_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE 15000
+set global performance_schema_events_stages_history_long_size=1;
+ERROR HY000: Variable 'performance_schema_events_stages_history_long_size' is a read only variable
+set session performance_schema_events_stages_history_long_size=1;
+ERROR HY000: Variable 'performance_schema_events_stages_history_long_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_events_stages_history_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_events_stages_history_size_basic.result
new file mode 100644
index 00000000000..7eef3eca8e4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_events_stages_history_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_events_stages_history_size;
+@@global.performance_schema_events_stages_history_size
+15
+select @@session.performance_schema_events_stages_history_size;
+ERROR HY000: Variable 'performance_schema_events_stages_history_size' is a GLOBAL variable
+show global variables like 'performance_schema_events_stages_history_size';
+Variable_name Value
+performance_schema_events_stages_history_size 15
+show session variables like 'performance_schema_events_stages_history_size';
+Variable_name Value
+performance_schema_events_stages_history_size 15
+select * from information_schema.global_variables
+where variable_name='performance_schema_events_stages_history_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE 15
+select * from information_schema.session_variables
+where variable_name='performance_schema_events_stages_history_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE 15
+set global performance_schema_events_stages_history_size=1;
+ERROR HY000: Variable 'performance_schema_events_stages_history_size' is a read only variable
+set session performance_schema_events_stages_history_size=1;
+ERROR HY000: Variable 'performance_schema_events_stages_history_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_events_statements_history_long_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_events_statements_history_long_size_basic.result
new file mode 100644
index 00000000000..c8efb317496
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_events_statements_history_long_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_events_statements_history_long_size;
+@@global.performance_schema_events_statements_history_long_size
+15000
+select @@session.performance_schema_events_statements_history_long_size;
+ERROR HY000: Variable 'performance_schema_events_statements_history_long_size' is a GLOBAL variable
+show global variables like 'performance_schema_events_statements_history_long_size';
+Variable_name Value
+performance_schema_events_statements_history_long_size 15000
+show session variables like 'performance_schema_events_statements_history_long_size';
+Variable_name Value
+performance_schema_events_statements_history_long_size 15000
+select * from information_schema.global_variables
+where variable_name='performance_schema_events_statements_history_long_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE 15000
+select * from information_schema.session_variables
+where variable_name='performance_schema_events_statements_history_long_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE 15000
+set global performance_schema_events_statements_history_long_size=1;
+ERROR HY000: Variable 'performance_schema_events_statements_history_long_size' is a read only variable
+set session performance_schema_events_statements_history_long_size=1;
+ERROR HY000: Variable 'performance_schema_events_statements_history_long_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_events_statements_history_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_events_statements_history_size_basic.result
new file mode 100644
index 00000000000..fcb2410432e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_events_statements_history_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_events_statements_history_size;
+@@global.performance_schema_events_statements_history_size
+15
+select @@session.performance_schema_events_statements_history_size;
+ERROR HY000: Variable 'performance_schema_events_statements_history_size' is a GLOBAL variable
+show global variables like 'performance_schema_events_statements_history_size';
+Variable_name Value
+performance_schema_events_statements_history_size 15
+show session variables like 'performance_schema_events_statements_history_size';
+Variable_name Value
+performance_schema_events_statements_history_size 15
+select * from information_schema.global_variables
+where variable_name='performance_schema_events_statements_history_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE 15
+select * from information_schema.session_variables
+where variable_name='performance_schema_events_statements_history_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE 15
+set global performance_schema_events_statements_history_size=1;
+ERROR HY000: Variable 'performance_schema_events_statements_history_size' is a read only variable
+set session performance_schema_events_statements_history_size=1;
+ERROR HY000: Variable 'performance_schema_events_statements_history_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_hosts_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_hosts_size_basic.result
new file mode 100644
index 00000000000..5eda27563cb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_hosts_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_hosts_size;
+@@global.performance_schema_hosts_size
+123
+select @@session.performance_schema_hosts_size;
+ERROR HY000: Variable 'performance_schema_hosts_size' is a GLOBAL variable
+show global variables like 'performance_schema_hosts_size';
+Variable_name Value
+performance_schema_hosts_size 123
+show session variables like 'performance_schema_hosts_size';
+Variable_name Value
+performance_schema_hosts_size 123
+select * from information_schema.global_variables
+where variable_name='performance_schema_hosts_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_HOSTS_SIZE 123
+select * from information_schema.session_variables
+where variable_name='performance_schema_hosts_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_HOSTS_SIZE 123
+set global performance_schema_hosts_size=1;
+ERROR HY000: Variable 'performance_schema_hosts_size' is a read only variable
+set session performance_schema_hosts_size=1;
+ERROR HY000: Variable 'performance_schema_hosts_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_max_digest_length_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_digest_length_basic.result
new file mode 100644
index 00000000000..12e48ee50ba
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_max_digest_length_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_max_digest_length;
+@@global.performance_schema_max_digest_length
+1024
+select @@session.performance_schema_max_digest_length;
+ERROR HY000: Variable 'performance_schema_max_digest_length' is a GLOBAL variable
+show global variables like 'performance_schema_max_digest_length';
+Variable_name Value
+performance_schema_max_digest_length 1024
+show session variables like 'performance_schema_max_digest_length';
+Variable_name Value
+performance_schema_max_digest_length 1024
+select * from information_schema.global_variables
+where variable_name='performance_schema_max_digest_length';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH 1024
+select * from information_schema.session_variables
+where variable_name='performance_schema_max_digest_length';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH 1024
+set global performance_schema_max_digest_length=1;
+ERROR HY000: Variable 'performance_schema_max_digest_length' is a read only variable
+set session performance_schema_max_digest_length=1;
+ERROR HY000: Variable 'performance_schema_max_digest_length' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_max_socket_classes_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_socket_classes_basic.result
new file mode 100644
index 00000000000..249bed0dd60
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_max_socket_classes_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_max_socket_classes;
+@@global.performance_schema_max_socket_classes
+123
+select @@session.performance_schema_max_socket_classes;
+ERROR HY000: Variable 'performance_schema_max_socket_classes' is a GLOBAL variable
+show global variables like 'performance_schema_max_socket_classes';
+Variable_name Value
+performance_schema_max_socket_classes 123
+show session variables like 'performance_schema_max_socket_classes';
+Variable_name Value
+performance_schema_max_socket_classes 123
+select * from information_schema.global_variables
+where variable_name='performance_schema_max_socket_classes';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES 123
+select * from information_schema.session_variables
+where variable_name='performance_schema_max_socket_classes';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES 123
+set global performance_schema_max_socket_classes=1;
+ERROR HY000: Variable 'performance_schema_max_socket_classes' is a read only variable
+set session performance_schema_max_socket_classes=1;
+ERROR HY000: Variable 'performance_schema_max_socket_classes' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_max_socket_instances_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_socket_instances_basic.result
new file mode 100644
index 00000000000..1023f9fd950
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_max_socket_instances_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_max_socket_instances;
+@@global.performance_schema_max_socket_instances
+123
+select @@session.performance_schema_max_socket_instances;
+ERROR HY000: Variable 'performance_schema_max_socket_instances' is a GLOBAL variable
+show global variables like 'performance_schema_max_socket_instances';
+Variable_name Value
+performance_schema_max_socket_instances 123
+show session variables like 'performance_schema_max_socket_instances';
+Variable_name Value
+performance_schema_max_socket_instances 123
+select * from information_schema.global_variables
+where variable_name='performance_schema_max_socket_instances';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES 123
+select * from information_schema.session_variables
+where variable_name='performance_schema_max_socket_instances';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES 123
+set global performance_schema_max_socket_instances=1;
+ERROR HY000: Variable 'performance_schema_max_socket_instances' is a read only variable
+set session performance_schema_max_socket_instances=1;
+ERROR HY000: Variable 'performance_schema_max_socket_instances' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_max_stage_classes_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_stage_classes_basic.result
new file mode 100644
index 00000000000..53f06803742
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_max_stage_classes_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_max_stage_classes;
+@@global.performance_schema_max_stage_classes
+123
+select @@session.performance_schema_max_stage_classes;
+ERROR HY000: Variable 'performance_schema_max_stage_classes' is a GLOBAL variable
+show global variables like 'performance_schema_max_stage_classes';
+Variable_name Value
+performance_schema_max_stage_classes 123
+show session variables like 'performance_schema_max_stage_classes';
+Variable_name Value
+performance_schema_max_stage_classes 123
+select * from information_schema.global_variables
+where variable_name='performance_schema_max_stage_classes';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES 123
+select * from information_schema.session_variables
+where variable_name='performance_schema_max_stage_classes';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES 123
+set global performance_schema_max_stage_classes=1;
+ERROR HY000: Variable 'performance_schema_max_stage_classes' is a read only variable
+set session performance_schema_max_stage_classes=1;
+ERROR HY000: Variable 'performance_schema_max_stage_classes' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_max_statement_classes_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_statement_classes_basic.result
new file mode 100644
index 00000000000..d7049b7175b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_max_statement_classes_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_max_statement_classes;
+@@global.performance_schema_max_statement_classes
+123
+select @@session.performance_schema_max_statement_classes;
+ERROR HY000: Variable 'performance_schema_max_statement_classes' is a GLOBAL variable
+show global variables like 'performance_schema_max_statement_classes';
+Variable_name Value
+performance_schema_max_statement_classes 123
+show session variables like 'performance_schema_max_statement_classes';
+Variable_name Value
+performance_schema_max_statement_classes 123
+select * from information_schema.global_variables
+where variable_name='performance_schema_max_statement_classes';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES 123
+select * from information_schema.session_variables
+where variable_name='performance_schema_max_statement_classes';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES 123
+set global performance_schema_max_statement_classes=1;
+ERROR HY000: Variable 'performance_schema_max_statement_classes' is a read only variable
+set session performance_schema_max_statement_classes=1;
+ERROR HY000: Variable 'performance_schema_max_statement_classes' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_session_connect_attrs_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_session_connect_attrs_size_basic.result
new file mode 100644
index 00000000000..a65a71ff8a0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_session_connect_attrs_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_session_connect_attrs_size;
+@@global.performance_schema_session_connect_attrs_size
+2048
+select @@session.performance_schema_session_connect_attrs_size;
+ERROR HY000: Variable 'performance_schema_session_connect_attrs_size' is a GLOBAL variable
+show global variables like 'performance_schema_session_connect_attrs_size';
+Variable_name Value
+performance_schema_session_connect_attrs_size 2048
+show session variables like 'performance_schema_session_connect_attrs_size';
+Variable_name Value
+performance_schema_session_connect_attrs_size 2048
+select * from information_schema.global_variables
+where variable_name='performance_schema_session_connect_attrs_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE 2048
+select * from information_schema.session_variables
+where variable_name='performance_schema_session_connect_attrs_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE 2048
+set global performance_schema_session_connect_attrs_size=1;
+ERROR HY000: Variable 'performance_schema_session_connect_attrs_size' is a read only variable
+set session performance_schema_session_connect_attrs_size=1;
+ERROR HY000: Variable 'performance_schema_session_connect_attrs_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_setup_actors_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_setup_actors_size_basic.result
new file mode 100644
index 00000000000..b4e6c8d9816
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_setup_actors_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_setup_actors_size;
+@@global.performance_schema_setup_actors_size
+123
+select @@session.performance_schema_setup_actors_size;
+ERROR HY000: Variable 'performance_schema_setup_actors_size' is a GLOBAL variable
+show global variables like 'performance_schema_setup_actors_size';
+Variable_name Value
+performance_schema_setup_actors_size 123
+show session variables like 'performance_schema_setup_actors_size';
+Variable_name Value
+performance_schema_setup_actors_size 123
+select * from information_schema.global_variables
+where variable_name='performance_schema_setup_actors_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE 123
+select * from information_schema.session_variables
+where variable_name='performance_schema_setup_actors_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE 123
+set global performance_schema_setup_actors_size=1;
+ERROR HY000: Variable 'performance_schema_setup_actors_size' is a read only variable
+set session performance_schema_setup_actors_size=1;
+ERROR HY000: Variable 'performance_schema_setup_actors_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_setup_objects_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_setup_objects_size_basic.result
new file mode 100644
index 00000000000..12d61a31fda
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_setup_objects_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_setup_objects_size;
+@@global.performance_schema_setup_objects_size
+123
+select @@session.performance_schema_setup_objects_size;
+ERROR HY000: Variable 'performance_schema_setup_objects_size' is a GLOBAL variable
+show global variables like 'performance_schema_setup_objects_size';
+Variable_name Value
+performance_schema_setup_objects_size 123
+show session variables like 'performance_schema_setup_objects_size';
+Variable_name Value
+performance_schema_setup_objects_size 123
+select * from information_schema.global_variables
+where variable_name='performance_schema_setup_objects_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE 123
+select * from information_schema.session_variables
+where variable_name='performance_schema_setup_objects_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE 123
+set global performance_schema_setup_objects_size=1;
+ERROR HY000: Variable 'performance_schema_setup_objects_size' is a read only variable
+set session performance_schema_setup_objects_size=1;
+ERROR HY000: Variable 'performance_schema_setup_objects_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/pfs_users_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_users_size_basic.result
new file mode 100644
index 00000000000..09a9f00d366
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/pfs_users_size_basic.result
@@ -0,0 +1,23 @@
+select @@global.performance_schema_users_size;
+@@global.performance_schema_users_size
+123
+select @@session.performance_schema_users_size;
+ERROR HY000: Variable 'performance_schema_users_size' is a GLOBAL variable
+show global variables like 'performance_schema_users_size';
+Variable_name Value
+performance_schema_users_size 123
+show session variables like 'performance_schema_users_size';
+Variable_name Value
+performance_schema_users_size 123
+select * from information_schema.global_variables
+where variable_name='performance_schema_users_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_USERS_SIZE 123
+select * from information_schema.session_variables
+where variable_name='performance_schema_users_size';
+VARIABLE_NAME VARIABLE_VALUE
+PERFORMANCE_SCHEMA_USERS_SIZE 123
+set global performance_schema_users_size=1;
+ERROR HY000: Variable 'performance_schema_users_size' is a read only variable
+set session performance_schema_users_size=1;
+ERROR HY000: Variable 'performance_schema_users_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result
index 3e444519441..7454f0b0089 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result
@@ -1,4 +1,3 @@
-INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
select @@global.rpl_semi_sync_master_enabled;
@@global.rpl_semi_sync_master_enabled
0
@@ -70,4 +69,3 @@ SET @@global.rpl_semi_sync_master_enabled = @start_global_value;
select @@global.rpl_semi_sync_master_enabled;
@@global.rpl_semi_sync_master_enabled
0
-UNINSTALL PLUGIN rpl_semi_sync_master;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result
index e77bcc1c12a..78fee2a91dc 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result
@@ -1,4 +1,3 @@
-INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
select @@global.rpl_semi_sync_master_timeout;
@@global.rpl_semi_sync_master_timeout
10000
@@ -51,4 +50,3 @@ SET @@global.rpl_semi_sync_master_timeout = @start_global_value;
select @@global.rpl_semi_sync_master_timeout;
@@global.rpl_semi_sync_master_timeout
10000
-UNINSTALL PLUGIN rpl_semi_sync_master;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result
index 55df5f57d9e..1096fa995e7 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result
@@ -1,4 +1,3 @@
-INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
select @@global.rpl_semi_sync_master_trace_level;
@@global.rpl_semi_sync_master_trace_level
32
@@ -69,4 +68,3 @@ SET @@global.rpl_semi_sync_master_trace_level = @start_global_value;
select @@global.rpl_semi_sync_master_trace_level;
@@global.rpl_semi_sync_master_trace_level
32
-UNINSTALL PLUGIN rpl_semi_sync_master;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result
index 3d951b499ed..535f777eff7 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result
@@ -1,4 +1,3 @@
-INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
select @@global.rpl_semi_sync_master_wait_no_slave;
@@global.rpl_semi_sync_master_wait_no_slave
1
@@ -70,4 +69,3 @@ SET @@global.rpl_semi_sync_master_wait_no_slave = @start_global_value;
select @@global.rpl_semi_sync_master_wait_no_slave;
@@global.rpl_semi_sync_master_wait_no_slave
1
-UNINSTALL PLUGIN rpl_semi_sync_master;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result
index a23b160e6f2..f52e8e80127 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result
@@ -1,4 +1,3 @@
-INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so';
select @@global.rpl_semi_sync_slave_enabled;
@@global.rpl_semi_sync_slave_enabled
0
@@ -70,4 +69,3 @@ SET @@global.rpl_semi_sync_slave_enabled = @start_global_value;
select @@global.rpl_semi_sync_slave_enabled;
@@global.rpl_semi_sync_slave_enabled
0
-UNINSTALL PLUGIN rpl_semi_sync_slave;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result
index f7796309aea..9917ec6fce5 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result
@@ -1,4 +1,3 @@
-INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so';
select @@global.rpl_semi_sync_slave_trace_level;
@@global.rpl_semi_sync_slave_trace_level
32
@@ -69,4 +68,3 @@ SET @@global.rpl_semi_sync_slave_trace_level = @start_global_value;
select @@global.rpl_semi_sync_slave_trace_level;
@@global.rpl_semi_sync_slave_trace_level
32
-UNINSTALL PLUGIN rpl_semi_sync_slave;
diff --git a/mysql-test/suite/sys_vars/r/server_id_basic.result b/mysql-test/suite/sys_vars/r/server_id_basic.result
index 4059ca9e6a5..4d82d8f102a 100644
--- a/mysql-test/suite/sys_vars/r/server_id_basic.result
+++ b/mysql-test/suite/sys_vars/r/server_id_basic.result
@@ -44,12 +44,18 @@ SELECT @@global.server_id;
@@global.server_id
4294967295
'#--------------------FN_DYNVARS_144_04-------------------------#'
+SELECT @@server_id;
+@@server_id
+4294967295
SET @@server_id = 2;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@server_id;
+@@server_id
+2
SET @@session.server_id = 3;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@server_id;
+@@server_id
+3
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:
@@ -106,12 +112,11 @@ SELECT @@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
+2048
SET global server_id = 99;
SET @@global.server_id = @start_global_value;
SELECT @@global.server_id;
diff --git a/mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_basic.result b/mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_basic.result
new file mode 100644
index 00000000000..e758e61f648
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_basic.result
@@ -0,0 +1,39 @@
+SET @start_value = @@global.slave_ddl_exec_mode;
+SELECT @@global.slave_ddl_exec_mode;
+@@global.slave_ddl_exec_mode
+IDEMPOTENT
+SELECT @@slave_ddl_exec_mode = @@GLOBAL.slave_ddl_exec_mode;
+@@slave_ddl_exec_mode = @@GLOBAL.slave_ddl_exec_mode
+1
+1 Expected
+SELECT COUNT(@@slave_ddl_exec_mode);
+COUNT(@@slave_ddl_exec_mode)
+1
+1 Expected
+SELECT COUNT(@@local.slave_ddl_exec_mode);
+ERROR HY000: Variable 'slave_ddl_exec_mode' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.slave_ddl_exec_mode);
+ERROR HY000: Variable 'slave_ddl_exec_mode' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.slave_ddl_exec_mode);
+COUNT(@@GLOBAL.slave_ddl_exec_mode)
+1
+1 Expected
+SELECT slave_ddl_exec_mode = @@SESSION.version;
+ERROR 42S22: Unknown column 'slave_ddl_exec_mode' in 'field list'
+Expected error 'Readonly variable'
+SET @@GLOBAL.slave_ddl_exec_mode=STRICT;
+SELECT @@GLOBAL.slave_ddl_exec_mode;
+@@GLOBAL.slave_ddl_exec_mode
+STRICT
+SET @@GLOBAL.slave_ddl_exec_mode=IDEMPOTENT;
+SELECT @@GLOBAL.slave_ddl_exec_mode;
+@@GLOBAL.slave_ddl_exec_mode
+IDEMPOTENT
+SET @@GLOBAL.slave_ddl_exec_mode=XXX;
+ERROR 42000: Variable 'slave_ddl_exec_mode' can't be set to the value of 'XXX'
+SELECT @@GLOBAL.slave_ddl_exec_mode;
+@@GLOBAL.slave_ddl_exec_mode
+IDEMPOTENT
+SET @@global.slave_ddl_exec_mode= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/slave_domain_parallel_threads_basic.result b/mysql-test/suite/sys_vars/r/slave_domain_parallel_threads_basic.result
new file mode 100644
index 00000000000..9e53d9bd891
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_domain_parallel_threads_basic.result
@@ -0,0 +1,13 @@
+SET @save_slave_domain_parallel_threads= @@GLOBAL.slave_domain_parallel_threads;
+SELECT @@GLOBAL.slave_domain_parallel_threads as 'must be zero because of default';
+must be zero because of default
+0
+SELECT @@SESSION.slave_domain_parallel_threads as 'no session var';
+ERROR HY000: Variable 'slave_domain_parallel_threads' is a GLOBAL variable
+SET GLOBAL slave_domain_parallel_threads= 0;
+SET GLOBAL slave_domain_parallel_threads= DEFAULT;
+SET GLOBAL slave_domain_parallel_threads= 10;
+SELECT @@GLOBAL.slave_domain_parallel_threads;
+@@GLOBAL.slave_domain_parallel_threads
+10
+SET GLOBAL slave_domain_parallel_threads = @save_slave_domain_parallel_threads;
diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_max_queued_basic.result b/mysql-test/suite/sys_vars/r/slave_parallel_max_queued_basic.result
new file mode 100644
index 00000000000..568ecac6de6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_parallel_max_queued_basic.result
@@ -0,0 +1,13 @@
+SET @save_slave_parallel_max_queued= @@GLOBAL.slave_parallel_max_queued;
+SELECT @@GLOBAL.slave_parallel_max_queued as 'Check default';
+Check default
+131072
+SELECT @@SESSION.slave_parallel_max_queued as 'no session var';
+ERROR HY000: Variable 'slave_parallel_max_queued' is a GLOBAL variable
+SET GLOBAL slave_parallel_max_queued= 0;
+SET GLOBAL slave_parallel_max_queued= DEFAULT;
+SET GLOBAL slave_parallel_max_queued= 65536;
+SELECT @@GLOBAL.slave_parallel_max_queued;
+@@GLOBAL.slave_parallel_max_queued
+65536
+SET GLOBAL slave_parallel_max_queued = @save_slave_parallel_max_queued;
diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result b/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result
new file mode 100644
index 00000000000..56aa5976f91
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result
@@ -0,0 +1,22 @@
+SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
+SELECT IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 20 because of .cnf';
+must be 20 because of .cnf
+20
+SELECT @@SESSION.slave_parallel_threads as 'no session var';
+ERROR HY000: Variable 'slave_parallel_threads' is a GLOBAL variable
+SET GLOBAL slave_parallel_threads= 0;
+SET GLOBAL slave_parallel_threads= DEFAULT;
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 0 because of default';
+must be 0 because of default
+0
+SET GLOBAL slave_parallel_threads= 10;
+SELECT @@GLOBAL.slave_parallel_threads;
+@@GLOBAL.slave_parallel_threads
+10
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*)))
+OK
+SET GLOBAL slave_parallel_threads = @save_slave_parallel_threads;
diff --git a/mysql-test/suite/sys_vars/r/slow_query_log_func.result b/mysql-test/suite/sys_vars/r/slow_query_log_func.result
index fb650399597..f01b2c4c48b 100644
--- a/mysql-test/suite/sys_vars/r/slow_query_log_func.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_func.result
@@ -81,7 +81,7 @@ DROP FUNCTION f_slow_current_time;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
Warnings:
-Note 1051 Unknown table 't1'
+Note 1051 Unknown table 'test.t1'
CREATE TABLE t1(c1 INT) ENGINE=MyISAM;
DROP PROCEDURE IF EXISTS p1;
CREATE PROCEDURE p1()
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 f96e28379a3..bd534140172 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
@@ -3,9 +3,7 @@
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 '@@sql_max_join_size' is deprecated and will be removed in a future release. Please use '@@max_join_size' instead
+SET MAX_JOIN_SIZE=9;
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_notes_func.result b/mysql-test/suite/sys_vars/r/sql_notes_func.result
index 87c4ecb8431..28510f027da 100644
--- a/mysql-test/suite/sys_vars/r/sql_notes_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_notes_func.result
@@ -13,7 +13,7 @@ SELECT @@warning_count;
0 Expected
DROP TABLE IF EXISTS t1;
Warnings:
-Note 1051 Unknown table 't1'
+Note 1051 Unknown table 'test.t1'
SELECT @@warning_count;
@@warning_count
1
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 e6d9aff7141..0e1d7af5485 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
@@ -35,9 +35,6 @@ 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
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/ssl_crl_basic.result b/mysql-test/suite/sys_vars/r/ssl_crl_basic.result
new file mode 100644
index 00000000000..5e0c0c58ba6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/ssl_crl_basic.result
@@ -0,0 +1,5 @@
+# a simplified test to keep the suite happy.
+# the real test is in main.
+select @@ssl_crl;
+@@ssl_crl
+NULL
diff --git a/mysql-test/suite/sys_vars/r/ssl_crlpath_basic.result b/mysql-test/suite/sys_vars/r/ssl_crlpath_basic.result
new file mode 100644
index 00000000000..407a13d7c1e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/ssl_crlpath_basic.result
@@ -0,0 +1,5 @@
+# a simplified test to keep the suite happy.
+# the real test is in main.
+select @@ssl_crlpath;
+@@ssl_crlpath
+NULL
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 2831ebaa500..9461707dd79 100644
--- a/mysql-test/suite/sys_vars/r/storage_engine_basic.result
+++ b/mysql-test/suite/sys_vars/r/storage_engine_basic.result
@@ -19,7 +19,7 @@ MyISAM
SET @@global.storage_engine = MERGE;
SELECT @@global.storage_engine;
@@global.storage_engine
-MRG_MYISAM
+MRG_MyISAM
SET @@global.storage_engine = MEMORY;
SELECT @@global.storage_engine;
@@global.storage_engine
@@ -36,7 +36,7 @@ MyISAM
SET @@session.storage_engine = MERGE;
SELECT @@session.storage_engine;
@@session.storage_engine
-MRG_MYISAM
+MRG_MyISAM
SET @@session.storage_engine = MEMORY;
SELECT @@session.storage_engine;
@@session.storage_engine
diff --git a/mysql-test/suite/sys_vars/r/table_open_cache_instances_basic.result b/mysql-test/suite/sys_vars/r/table_open_cache_instances_basic.result
new file mode 100644
index 00000000000..e735c5ccbc6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/table_open_cache_instances_basic.result
@@ -0,0 +1,3 @@
+select @@table_open_cache_instances;
+@@table_open_cache_instances
+1
diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_bug27322.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_bug27322.result
index e845400b397..895223a8462 100644
--- a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_bug27322.result
+++ b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_bug27322.result
@@ -2,20 +2,20 @@ SET @def_var= @@session.transaction_prealloc_size;
SET SESSION transaction_prealloc_size=1024*1024*1024*1;
SHOW PROCESSLIST;
Id User Host db Command Time State Info Progress
-<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST 0.000
+<Id> root <Host> test Query <Time> <State> SHOW PROCESSLIST 0.000
SET SESSION transaction_prealloc_size=1024*1024*1024*2;
SHOW PROCESSLIST;
Id User Host db Command Time State Info Progress
-<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST 0.000
+<Id> root <Host> test Query <Time> <State> SHOW PROCESSLIST 0.000
SET SESSION transaction_prealloc_size=1024*1024*1024*3;
SHOW PROCESSLIST;
Id User Host db Command Time State Info Progress
-<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST 0.000
+<Id> root <Host> test Query <Time> <State> SHOW PROCESSLIST 0.000
SET SESSION transaction_prealloc_size=1024*1024*1024*4;
SHOW PROCESSLIST;
Id User Host db Command Time State Info Progress
-<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST 0.000
+<Id> root <Host> test Query <Time> <State> SHOW PROCESSLIST 0.000
SET SESSION transaction_prealloc_size=1024*1024*1024*5;
SHOW PROCESSLIST;
Id User Host db Command Time State Info Progress
-<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST 0.000
+<Id> root <Host> test Query <Time> <State> SHOW PROCESSLIST 0.000
diff --git a/mysql-test/suite/sys_vars/r/tx_read_only_basic.result b/mysql-test/suite/sys_vars/r/tx_read_only_basic.result
new file mode 100644
index 00000000000..3750145083f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/tx_read_only_basic.result
@@ -0,0 +1,181 @@
+####################################################################
+# START OF tx_read_only TESTS #
+####################################################################
+#############################################################
+# Save initial value #
+#############################################################
+SET @start_global_value = @@global.tx_read_only;
+SELECT @start_global_value;
+@start_global_value
+0
+SET @start_session_value = @@session.tx_read_only;
+SELECT @start_session_value;
+@start_session_value
+0
+########################################################################
+# Display the DEFAULT value of tx_read_only #
+########################################################################
+SET @@global.tx_read_only = ON;
+SET @@global.tx_read_only = DEFAULT;
+SELECT @@global.tx_read_only;
+@@global.tx_read_only
+0
+SET @@session.tx_read_only = ON;
+SET @@session.tx_read_only = DEFAULT;
+SELECT @@session.tx_read_only;
+@@session.tx_read_only
+0
+##############################################################################
+# Change the value of tx_read_only to a valid value for GLOBAL Scope #
+##############################################################################
+SET @@global.tx_read_only = ON;
+SELECT @@global.tx_read_only;
+@@global.tx_read_only
+1
+SET @@global.tx_read_only = OFF;
+SELECT @@global.tx_read_only;
+@@global.tx_read_only
+0
+SET @@global.tx_read_only = 0;
+SELECT @@global.tx_read_only;
+@@global.tx_read_only
+0
+SET @@global.tx_read_only = 1;
+SELECT @@global.tx_read_only;
+@@global.tx_read_only
+1
+SET @@global.tx_read_only = TRUE;
+SELECT @@global.tx_read_only;
+@@global.tx_read_only
+1
+SET @@global.tx_read_only = FALSE;
+SELECT @@global.tx_read_only;
+@@global.tx_read_only
+0
+###############################################################################
+# Change the value of tx_read_only to a valid value for SESSION Scope #
+###############################################################################
+SET @@session.tx_read_only = ON;
+SELECT @@session.tx_read_only;
+@@session.tx_read_only
+1
+SET @@session.tx_read_only = OFF;
+SELECT @@session.tx_read_only;
+@@session.tx_read_only
+0
+SET @@session.tx_read_only = 0;
+SELECT @@session.tx_read_only;
+@@session.tx_read_only
+0
+SET @@session.tx_read_only = 1;
+SELECT @@session.tx_read_only;
+@@session.tx_read_only
+1
+SET @@session.tx_read_only = TRUE;
+SELECT @@session.tx_read_only;
+@@session.tx_read_only
+1
+SET @@session.tx_read_only = FALSE;
+SELECT @@session.tx_read_only;
+@@session.tx_read_only
+0
+################################################################
+# Change the value of tx_read_only to an invalid value #
+################################################################
+SET @@global.tx_read_only = 'ONN';
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'ONN'
+SET @@global.tx_read_only = "OFFF";
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'OFFF'
+SET @@global.tx_read_only = TTRUE;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'TTRUE'
+SET @@global.tx_read_only = FELSE;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'FELSE'
+SET @@global.tx_read_only = -1024;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of '-1024'
+SET @@global.tx_read_only = 65536;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of '65536'
+SET @@global.tx_read_only = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'tx_read_only'
+SET @@global.tx_read_only = test;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'test'
+SET @@session.tx_read_only = ONN;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'ONN'
+SET @@session.tx_read_only = ONF;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'ONF'
+SET @@session.tx_read_only = OF;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'OF'
+SET @@session.tx_read_only = 'OFN';
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'OFN'
+SET @@session.tx_read_only = -2;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of '-2'
+SET @@session.tx_read_only = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'tx_read_only'
+SET @@session.tx_read_only = 65550;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of '65550'
+SET @@session.tx_read_only = test;
+ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'test'
+SELECT @@session.tx_read_only;
+@@session.tx_read_only
+0
+####################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+####################################################################
+SELECT IF(@@global.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='tx_read_only';
+IF(@@global.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
+1
+####################################################################
+# Check if the value in SESSION Table matches value in variable #
+####################################################################
+SELECT IF(@@session.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='tx_read_only';
+IF(@@session.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
+1
+###############################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+###############################################################################
+SET @@tx_read_only = OFF;
+SET @@global.tx_read_only = ON;
+SELECT @@tx_read_only = @@global.tx_read_only;
+@@tx_read_only = @@global.tx_read_only
+0
+##############################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points #
+# to same session variable #
+##############################################################################
+SET @@tx_read_only = ON;
+SELECT @@tx_read_only = @@local.tx_read_only;
+@@tx_read_only = @@local.tx_read_only
+1
+SELECT @@local.tx_read_only = @@session.tx_read_only;
+@@local.tx_read_only = @@session.tx_read_only
+1
+###############################################################################
+# Check if tx_read_only can be accessed with and without @@ sign #
+###############################################################################
+# @@session is synonym for SESSION
+SET @@session.tx_read_only= 0;
+# Without modifier, SET changes session variable
+SET tx_read_only = 1;
+SELECT @@tx_read_only;
+@@tx_read_only
+1
+# name1.name2 refers to database_name.table_name
+SELECT session.tx_read_only;
+ERROR 42S02: Unknown table 'session' in field list
+####################################
+# Restore initial value #
+####################################
+SET @@global.tx_read_only = @start_global_value;
+SELECT @@global.tx_read_only;
+@@global.tx_read_only
+0
+SET @@session.tx_read_only = @start_session_value;
+SELECT @@session.tx_read_only;
+@@session.tx_read_only
+0
+#########################################################
+# END OF tx_read_only TESTS #
+#########################################################
diff --git a/mysql-test/suite/sys_vars/r/use_stat_tables_basic.result b/mysql-test/suite/sys_vars/r/use_stat_tables_basic.result
new file mode 100644
index 00000000000..64f6d868fa6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/use_stat_tables_basic.result
@@ -0,0 +1,95 @@
+SET @start_global_value = @@global.use_stat_tables;
+SELECT @start_global_value;
+@start_global_value
+NEVER
+SET @start_session_value = @@session.use_stat_tables;
+SELECT @start_session_value;
+@start_session_value
+NEVER
+SET @@global.use_stat_tables = 2;
+SET @@global.use_stat_tables = DEFAULT;
+SELECT @@global.use_stat_tables;
+@@global.use_stat_tables
+NEVER
+SET @@global.use_stat_tables = 0;
+SELECT @@global.use_stat_tables;
+@@global.use_stat_tables
+NEVER
+SET @@global.use_stat_tables = 1;
+SELECT @@global.use_stat_tables;
+@@global.use_stat_tables
+COMPLEMENTARY
+SET @@global.use_stat_tables = 2;
+SELECT @@global.use_stat_tables;
+@@global.use_stat_tables
+PREFERABLY
+SET @@global.use_stat_tables = NEVER;
+SELECT @@global.use_stat_tables;
+@@global.use_stat_tables
+NEVER
+SET @@global.use_stat_tables = COMPLEMENTARY;
+SELECT @@global.use_stat_tables;
+@@global.use_stat_tables
+COMPLEMENTARY
+SET @@global.use_stat_tables = PREFERABLY;
+SELECT @@global.use_stat_tables;
+@@global.use_stat_tables
+PREFERABLY
+SET @@session.use_stat_tables = 0;
+SELECT @@session.use_stat_tables;
+@@session.use_stat_tables
+NEVER
+SET @@session.use_stat_tables = 1;
+SELECT @@session.use_stat_tables;
+@@session.use_stat_tables
+COMPLEMENTARY
+SET @@session.use_stat_tables = 2;
+SELECT @@session.use_stat_tables;
+@@session.use_stat_tables
+PREFERABLY
+SET @@session.use_stat_tables = NEVER;
+SELECT @@session.use_stat_tables;
+@@session.use_stat_tables
+NEVER
+SET @@session.use_stat_tables = PREFERABLY;
+SELECT @@session.use_stat_tables;
+@@session.use_stat_tables
+PREFERABLY
+SET @@session.use_stat_tables = COMPLEMENTARY;
+SELECT @@session.use_stat_tables;
+@@session.use_stat_tables
+COMPLEMENTARY
+set sql_mode=TRADITIONAL;
+SET @@global.use_stat_tables = 10;
+ERROR 42000: Variable 'use_stat_tables' can't be set to the value of '10'
+SET @@global.use_stat_tables = -1024;
+ERROR 42000: Variable 'use_stat_tables' can't be set to the value of '-1024'
+SET @@global.use_stat_tables = 2.4;
+ERROR 42000: Incorrect argument type to variable 'use_stat_tables'
+SET @@global.use_stat_tables = OFF;
+ERROR 42000: Variable 'use_stat_tables' can't be set to the value of 'OFF'
+SET @@session.use_stat_tables = 10;
+ERROR 42000: Variable 'use_stat_tables' can't be set to the value of '10'
+SET @@session.use_stat_tables = -2;
+ERROR 42000: Variable 'use_stat_tables' can't be set to the value of '-2'
+SET @@session.use_stat_tables = 1.2;
+ERROR 42000: Incorrect argument type to variable 'use_stat_tables'
+SET @@session.use_stat_tables = ON;
+ERROR 42000: Variable 'use_stat_tables' can't be set to the value of 'ON'
+SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='use_stat_tables';
+VARIABLE_NAME VARIABLE_VALUE
+USE_STAT_TABLES PREFERABLY
+SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='use_stat_tables';
+VARIABLE_NAME VARIABLE_VALUE
+USE_STAT_TABLES COMPLEMENTARY
+SET @@global.use_stat_tables = @start_global_value;
+SELECT @@global.use_stat_tables;
+@@global.use_stat_tables
+NEVER
+SET @@session.use_stat_tables = @start_session_value;
+SELECT @@session.use_stat_tables;
+@@session.use_stat_tables
+NEVER
+set sql_mode='';
diff --git a/mysql-test/suite/sys_vars/r/version_malloc_library_basic.result b/mysql-test/suite/sys_vars/r/version_malloc_library_basic.result
new file mode 100644
index 00000000000..5895b8122d9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/version_malloc_library_basic.result
@@ -0,0 +1,53 @@
+'#---------------------BS_STVARS_053_01----------------------#'
+SELECT COUNT(@@GLOBAL.version_malloc_library);
+COUNT(@@GLOBAL.version_malloc_library)
+1
+1 Expected
+'#---------------------BS_STVARS_053_02----------------------#'
+SET @@GLOBAL.version_malloc_library=1;
+ERROR HY000: Variable 'version_malloc_library' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.version_malloc_library);
+COUNT(@@GLOBAL.version_malloc_library)
+1
+1 Expected
+'#---------------------BS_STVARS_053_03----------------------#'
+SELECT @@GLOBAL.version_malloc_library = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='version_malloc_library';
+@@GLOBAL.version_malloc_library = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.version_malloc_library);
+COUNT(@@GLOBAL.version_malloc_library)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='version_malloc_library';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_053_04----------------------#'
+SELECT @@version_malloc_library = @@GLOBAL.version_malloc_library;
+@@version_malloc_library = @@GLOBAL.version_malloc_library
+1
+1 Expected
+'#---------------------BS_STVARS_053_05----------------------#'
+SELECT COUNT(@@version_malloc_library);
+COUNT(@@version_malloc_library)
+1
+1 Expected
+SELECT COUNT(@@local.version_malloc_library);
+ERROR HY000: Variable 'version_malloc_library' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.version_malloc_library);
+ERROR HY000: Variable 'version_malloc_library' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.version_malloc_library);
+COUNT(@@GLOBAL.version_malloc_library)
+1
+1 Expected
+SELECT version_malloc_library = @@SESSION.version;
+ERROR 42S22: Unknown column 'version_malloc_library' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/aria_pagecache_file_hash_size_basic.test b/mysql-test/suite/sys_vars/t/aria_pagecache_file_hash_size_basic.test
new file mode 100644
index 00000000000..8bedb498e2c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_pagecache_file_hash_size_basic.test
@@ -0,0 +1,22 @@
+# ulong readonly
+
+--source include/have_maria.inc
+#
+# show the global and session values;
+#
+select @@global.aria_pagecache_file_hash_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.aria_pagecache_file_hash_size;
+show global variables like 'aria_pagecache_file_hash_size';
+show session variables like 'aria_pagecache_file_hash_size';
+select * from information_schema.global_variables where variable_name='aria_pagecache_file_hash_size';
+select * from information_schema.session_variables where variable_name='aria_pagecache_file_hash_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global aria_pagecache_file_hash_size=200;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session aria_pagecache_file_hash_size=200;
+
diff --git a/mysql-test/suite/sys_vars/t/binlog_commit_wait_count_basic.test b/mysql-test/suite/sys_vars/t/binlog_commit_wait_count_basic.test
new file mode 100644
index 00000000000..ebce0da77fe
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/binlog_commit_wait_count_basic.test
@@ -0,0 +1,14 @@
+--source include/not_embedded.inc
+
+SET @save_binlog_commit_wait_count= @@GLOBAL.binlog_commit_wait_count;
+
+SELECT @@GLOBAL.binlog_commit_wait_count as 'must be zero because of default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.binlog_commit_wait_count as 'no session var';
+
+SET GLOBAL binlog_commit_wait_count= 0;
+SET GLOBAL binlog_commit_wait_count= DEFAULT;
+SET GLOBAL binlog_commit_wait_count= 10;
+SELECT @@GLOBAL.binlog_commit_wait_count;
+
+SET GLOBAL binlog_commit_wait_count = @save_binlog_commit_wait_count;
diff --git a/mysql-test/suite/sys_vars/t/binlog_commit_wait_usec_basic.test b/mysql-test/suite/sys_vars/t/binlog_commit_wait_usec_basic.test
new file mode 100644
index 00000000000..ad9b6c99630
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/binlog_commit_wait_usec_basic.test
@@ -0,0 +1,14 @@
+--source include/not_embedded.inc
+
+SET @save_binlog_commit_wait_usec= @@GLOBAL.binlog_commit_wait_usec;
+
+SELECT @@GLOBAL.binlog_commit_wait_usec as 'check default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.binlog_commit_wait_usec as 'no session var';
+
+SET GLOBAL binlog_commit_wait_usec= 0;
+SET GLOBAL binlog_commit_wait_usec= DEFAULT;
+SET GLOBAL binlog_commit_wait_usec= 10000;
+SELECT @@GLOBAL.binlog_commit_wait_usec;
+
+SET GLOBAL binlog_commit_wait_usec = @save_binlog_commit_wait_usec;
diff --git a/mysql-test/suite/sys_vars/t/default_master_connection_basic.test b/mysql-test/suite/sys_vars/t/default_master_connection_basic.test
new file mode 100644
index 00000000000..627a236aaa7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/default_master_connection_basic.test
@@ -0,0 +1,128 @@
+############## mysql-test\t\default_master_connection_basic.test ###############
+#
+# Implemented in the scope of MDEV-253
+# The variable is SESSION-only
+#
+
+--source include/not_embedded.inc
+
+#############################################################
+# Save initial value #
+#############################################################
+
+SET @start_session_value = @@session.default_master_connection;
+SELECT @start_session_value;
+
+###################################################################
+# Display the DEFAULT value of default_master_connection #
+###################################################################
+
+SET @@session.default_master_connection = 'bar';
+SET @@session.default_master_connection = DEFAULT;
+SELECT @@session.default_master_connection;
+
+###################################################################
+# Check the DEFAULT value of default_master_connection #
+###################################################################
+
+SET @@session.default_master_connection = @start_session_value;
+SELECT @@session.default_master_connection = '';
+
+#################################################
+# Check that the GLOBAL scope is not applicable #
+#################################################
+
+--error ER_LOCAL_VARIABLE
+SET @@global.default_master_connection = 'master1';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@global.default_master_connection;
+
+####################################################################################
+# Change the value of default_master_connection to a valid value for SESSION Scope #
+####################################################################################
+
+SET @@session.default_master_connection = 'master1';
+SELECT @@session.default_master_connection;
+SET @@session.default_master_connection = '';
+SELECT @@session.default_master_connection;
+SET @@session.default_master_connection = '1234-5678';
+SELECT @@session.default_master_connection;
+SET @@session.default_master_connection = '@!*/"';
+SELECT @@session.default_master_connection;
+SET @@session.default_master_connection = REPEAT('a',191);
+SELECT @@session.default_master_connection;
+SET @@session.default_master_connection = master2;
+SELECT @@session.default_master_connection;
+
+
+#####################################################################
+# Change the value of default_master_connection to an invalid value #
+#####################################################################
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@session.default_master_connection = 1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@session.default_master_connection = 65530.30;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@session.default_master_connection = FALSE;
+SELECT @@session.default_master_connection;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@session.default_master_connection = REPEAT('a',192);
+SELECT @@session.default_master_connection;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@session.default_master_connection = NULL;
+SELECT @@session.default_master_connection;
+
+###############################################################################
+# Check if the value in GLOBAL & SESSION Tables matches value in variable #
+###############################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@global.default_master_connection = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='default_master_connection';
+
+SELECT @@session.default_master_connection = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='default_master_connection';
+
+
+########################################################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
+########################################################################################################
+
+SET @@default_master_connection = 'foo';
+SELECT @@default_master_connection = @@local.default_master_connection;
+SELECT @@local.default_master_connection = @@session.default_master_connection;
+
+
+###################################################################################
+# Check if default_master_connection can be accessed with and without @@ sign #
+###################################################################################
+
+SET default_master_connection = 'foo';
+SELECT @@default_master_connection;
+--Error ER_PARSE_ERROR
+SET local.default_master_connection = 'foo';
+--Error ER_UNKNOWN_TABLE
+SELECT local.default_master_connection;
+--Error ER_PARSE_ERROR
+SET session.default_master_connection = 'foo';
+--Error ER_UNKNOWN_TABLE
+SELECT session.default_master_connection;
+--Error ER_BAD_FIELD_ERROR
+SELECT default_master_connection = @@session.default_master_connection;
+
+
+####################################
+# Restore initial value #
+####################################
+
+SET @@session.default_master_connection = @start_session_value;
+SELECT @@session.default_master_connection;
+
+
+#############################################################
+# END OF default_master_connection TESTS #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/t/default_regex_flags_basic.test b/mysql-test/suite/sys_vars/t/default_regex_flags_basic.test
new file mode 100644
index 00000000000..1e826293949
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/default_regex_flags_basic.test
@@ -0,0 +1,43 @@
+
+SET default_regex_flags='';
+SELECT @@default_regex_flags;
+SET default_regex_flags=DEFAULT;
+SELECT @@default_regex_flags;
+--error ER_WRONG_VALUE_FOR_VAR
+SET default_regex_flags=NULL;
+SELECT @@default_regex_flags;
+--error ER_WRONG_VALUE_FOR_VAR
+SET default_regex_flags='UNKNOWN';
+--error ER_WRONG_VALUE_FOR_VAR
+SET default_regex_flags=123;
+--error ER_WRONG_TYPE_FOR_VAR
+SET default_regex_flags=123.0;
+--error ER_WRONG_TYPE_FOR_VAR
+SET default_regex_flags=123e0;
+SET default_regex_flags='DOTALL';
+SELECT @@default_regex_flags;
+--error ER_WRONG_VALUE_FOR_VAR
+SET default_regex_flags=NULL;
+SELECT @@default_regex_flags;
+
+SET @@default_regex_flags=63;
+SELECT @@default_regex_flags;
+SET @@default_regex_flags='DOTALL';
+SELECT @@default_regex_flags;
+SET @@default_regex_flags='DOTALL,DUPNAMES,EXTENDED,EXTRA,MULTILINE,UNGREEDY';
+SELECT @@default_regex_flags;
+SET @@default_regex_flags=DEFAULT;
+
+SET @@global.default_regex_flags='MULTILINE';
+SELECT @@session.default_regex_flags;
+connect (con1,localhost,root,,);
+--echo # connection con1
+connection con1;
+SELECT @@session.default_regex_flags;
+connection default;
+--echo # connection default
+disconnect con1;
+SELECT @@session.default_regex_flags;
+SET @@global.default_regex_flags=DEFAULT;
+
+SET default_regex_flags=DEFAULT;
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
deleted file mode 100644
index ab9bfc3dd6a..00000000000
--- a/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test
+++ /dev/null
@@ -1,267 +0,0 @@
-############## mysql-test\t\engine_condition_pushdown_basic.test ##############
-# #
-# Variable Name: engine_condition_pushdown #
-# Scope: GLOBAL | SESSION #
-# Access Type: Dynamic #
-# Data Type: boolean #
-# Default Value: OFF #
-# Valid Values: ON, OFF #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author: Rizwan #
-# #
-# Description: Test Cases of Dynamic System Variable engine_condition_pushdown#
-# that checks the 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-system-variables.html #
-# #
-###############################################################################
-
---source include/load_sysvars.inc
-
-########################################################################
-# START OF engine_condition_pushdown TESTS #
-########################################################################
-
-
-###############################################################################
-# Saving initial value of engine_condition_pushdown in a temporary variable #
-###############################################################################
-
-SET @session_start_value = @@session.engine_condition_pushdown;
-SELECT @session_start_value;
-
-SET @global_start_value = @@global.engine_condition_pushdown;
-SELECT @global_start_value;
-
-# same for optimizer_switch
-select @old_session_opt_switch:=@@session.optimizer_switch,
-@old_global_opt_switch:=@@global.optimizer_switch;
-
---echo '#--------------------FN_DYNVARS_028_01------------------------#'
-########################################################################
-# Display the DEFAULT value of engine_condition_pushdown #
-########################################################################
-
-SET @@session.engine_condition_pushdown = 0;
-SET @@session.engine_condition_pushdown = DEFAULT;
-SELECT @@session.engine_condition_pushdown;
-
-SET @@global.engine_condition_pushdown = 0;
-SET @@global.engine_condition_pushdown = DEFAULT;
-SELECT @@global.engine_condition_pushdown;
-
---echo '#---------------------FN_DYNVARS_028_02-------------------------#'
-###############################################################################
-# Check if engine_condition_pushdown can be accessed with and without @@ sign #
-###############################################################################
-
-SET engine_condition_pushdown = 1;
-SELECT @@engine_condition_pushdown;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.engine_condition_pushdown;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.engine_condition_pushdown;
-
---Error ER_UNKNOWN_TABLE
-SELECT global.engine_condition_pushdown;
-
-SET session engine_condition_pushdown = 0;
-SELECT @@session.engine_condition_pushdown;
-
-SET global engine_condition_pushdown = 0;
-SELECT @@global.engine_condition_pushdown;
-
-
---echo '#--------------------FN_DYNVARS_028_03------------------------#'
-##########################################################################
-# change the value of engine_condition_pushdown to a valid value #
-##########################################################################
-
-SET @@session.engine_condition_pushdown = 0;
-SELECT @@session.engine_condition_pushdown;
-SET @@session.engine_condition_pushdown = 1;
-SELECT @@session.engine_condition_pushdown;
-
-
-SET @@global.engine_condition_pushdown = 0;
-SELECT @@global.engine_condition_pushdown;
-SET @@global.engine_condition_pushdown = 1;
-SELECT @@global.engine_condition_pushdown;
-
-
---echo '#--------------------FN_DYNVARS_028_04-------------------------#'
-###########################################################################
-# Change the value of engine_condition_pushdown to invalid value #
-###########################################################################
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.engine_condition_pushdown = -1;
---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";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.engine_condition_pushdown = "Y";
---Error ER_WRONG_VALUE_FOR_VAR
-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;
---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
-SET @@global.engine_condition_pushdown = 2;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.engine_condition_pushdown = "T";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.engine_condition_pushdown = "Y";
---Error ER_WRONG_VALUE_FOR_VAR
-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;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.engine_condition_pushdown = ÓFF;
-
-
---echo '#-------------------FN_DYNVARS_028_05----------------------------#'
-###########################################################################
-# Test if changing global variable effects session and vice versa #
-###########################################################################
-
-SET @@global.engine_condition_pushdown = 0;
-SET @@session.engine_condition_pushdown = 1;
-SELECT @@global.engine_condition_pushdown AS res_is_0;
-
-SET @@global.engine_condition_pushdown = 0;
-SELECT @@session.engine_condition_pushdown AS res_is_1;
-
---echo '#----------------------FN_DYNVARS_028_06------------------------#'
-#########################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-#########################################################################
-
-SELECT IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='engine_condition_pushdown';
-SELECT @@global.engine_condition_pushdown;
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='engine_condition_pushdown';
-
---echo '#----------------------FN_DYNVARS_028_07------------------------#'
-#########################################################################
-# Check if the value in SESSION Table matches value in variable #
-#########################################################################
-
-SELECT IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='engine_condition_pushdown';
-SELECT @@session.engine_condition_pushdown;
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='engine_condition_pushdown';
-
-
---echo '#---------------------FN_DYNVARS_028_08-------------------------#'
-###################################################################
-# Check if ON and OFF values can be used on variable #
-###################################################################
-
-SET @@session.engine_condition_pushdown = OFF;
-SELECT @@session.engine_condition_pushdown;
-SET @@session.engine_condition_pushdown = ON;
-SELECT @@session.engine_condition_pushdown;
-
-SET @@global.engine_condition_pushdown = OFF;
-SELECT @@global.engine_condition_pushdown;
-SET @@global.engine_condition_pushdown = ON;
-SELECT @@global.engine_condition_pushdown;
-
---echo '#---------------------FN_DYNVARS_028_09----------------------#'
-###################################################################
-# Check if TRUE and FALSE values can be used on variable #
-###################################################################
-
-SET @@session.engine_condition_pushdown = TRUE;
-SELECT @@session.engine_condition_pushdown;
-SET @@session.engine_condition_pushdown = FALSE;
-SELECT @@session.engine_condition_pushdown;
-
-SET @@global.engine_condition_pushdown = TRUE;
-SELECT @@global.engine_condition_pushdown;
-SET @@global.engine_condition_pushdown = FALSE;
-SELECT @@global.engine_condition_pushdown;
-
---echo Check that @@engine_condition_pushdown influences
---echo @@optimizer_switch and vice-versa
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-set @@session.engine_condition_pushdown = TRUE;
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-set @@session.engine_condition_pushdown = FALSE;
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-set @@global.engine_condition_pushdown = TRUE;
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-set @@global.engine_condition_pushdown = FALSE;
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-set @@session.optimizer_switch = "engine_condition_pushdown=on";
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-set @@session.optimizer_switch = "engine_condition_pushdown=off";
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-set @@global.optimizer_switch = "engine_condition_pushdown=on";
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-set @@global.optimizer_switch = "engine_condition_pushdown=off";
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-
-##############################
-# Restore initial value #
-##############################
-
-SET @@session.engine_condition_pushdown = @session_start_value;
-SELECT @@session.engine_condition_pushdown;
-
-SET @@global.engine_condition_pushdown = @global_start_value;
-SELECT @@global.engine_condition_pushdown;
-
-set @session.optimizer_switch=@old_session_opt_switch,
-@@global.optimizer_switch=@old_global_opt_switch;
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
-
-###############################################################
-# END OF engine_condition_pushdown TESTS #
-###############################################################
diff --git a/mysql-test/suite/sys_vars/t/general_log_file_basic-master.opt b/mysql-test/suite/sys_vars/t/general_log_file_basic-master.opt
index 8482f8cbbc3..c9f62c1ab8a 100644
--- a/mysql-test/suite/sys_vars/t/general_log_file_basic-master.opt
+++ b/mysql-test/suite/sys_vars/t/general_log_file_basic-master.opt
@@ -1 +1,2 @@
---log=test.log
+--general-log
+--general-log-file=test.log
diff --git a/mysql-test/suite/sys_vars/t/general_log_file_func-master.opt b/mysql-test/suite/sys_vars/t/general_log_file_func-master.opt
index 3652d715f5f..487f17425c6 100644
--- a/mysql-test/suite/sys_vars/t/general_log_file_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/general_log_file_func-master.opt
@@ -1,2 +1,3 @@
---log=mysql-test.log
+--general-log
+--general-log-file=mysql-test.log
diff --git a/mysql-test/suite/sys_vars/t/gtid_binlog_pos_basic.test b/mysql-test/suite/sys_vars/t/gtid_binlog_pos_basic.test
new file mode 100644
index 00000000000..452132653fc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_binlog_pos_basic.test
@@ -0,0 +1,15 @@
+--source include/not_embedded.inc
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL gtid_binlog_pos= '';
+SELECT variable_name FROM information_schema.global_variables
+ WHERE variable_name='gtid_binlog_pos';
+
+# The value of the variable depends on the binary log, this is tested extensively
+# elsewhere in rpl.rpl_gtid*.test
+--disable_result_log
+SELECT @@gtid_binlog_pos;
+--enable_result_log
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.gtid_binlog_pos;
diff --git a/mysql-test/suite/sys_vars/t/gtid_binlog_state_basic.test b/mysql-test/suite/sys_vars/t/gtid_binlog_state_basic.test
new file mode 100644
index 00000000000..f171086e2ce
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_binlog_state_basic.test
@@ -0,0 +1,17 @@
+--source include/not_embedded.inc
+
+# Most things with gtid_binlog_state requires binlog enabled, and so is
+# tested in rpl suite.
+
+SELECT @@GLOBAL.gtid_slave_pos;
+
+--error ER_GLOBAL_VARIABLE
+SET gtid_binlog_state= '';
+--error ER_GLOBAL_VARIABLE
+SET SESSION gtid_binlog_state= '';
+
+--error ER_NO_DEFAULT
+SET GLOBAL gtid_binlog_state= DEFAULT;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.gtid_binlog_state;
diff --git a/mysql-test/suite/sys_vars/t/gtid_current_pos_basic.test b/mysql-test/suite/sys_vars/t/gtid_current_pos_basic.test
new file mode 100644
index 00000000000..9aac7ad7c10
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_current_pos_basic.test
@@ -0,0 +1,15 @@
+--source include/not_embedded.inc
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL gtid_current_pos= '';
+SELECT variable_name FROM information_schema.global_variables
+ WHERE variable_name='gtid_current_pos';
+
+# The value of the variable depends on the binary log, this is tested extensively
+# elsewhere in rpl.rpl_gtid*.test
+--disable_result_log
+SELECT @@gtid_current_pos;
+--enable_result_log
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.gtid_current_pos;
diff --git a/mysql-test/suite/sys_vars/t/gtid_domain_id_basic.test b/mysql-test/suite/sys_vars/t/gtid_domain_id_basic.test
new file mode 100644
index 00000000000..f9c78fe2749
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_domain_id_basic.test
@@ -0,0 +1,17 @@
+SET @old_gtid_domain_id= @@global.gtid_domain_id;
+SELECT @@global.gtid_domain_id;
+
+SET GLOBAL gtid_domain_id= 10;
+SET SESSION gtid_domain_id= 20;
+SELECT @@global.gtid_domain_id;
+SELECT @@session.gtid_domain_id;
+
+SET GLOBAL gtid_domain_id= DEFAULT;
+SELECT @@global.gtid_domain_id;
+
+SET GLOBAL gtid_domain_id= -10;
+SELECT @@global.gtid_domain_id;
+SET SESSION gtid_domain_id= -1;
+SELECT @@session.gtid_domain_id;
+
+SET GLOBAL gtid_domain_id= @old_gtid_domain_id;
diff --git a/mysql-test/suite/sys_vars/t/gtid_ignore_duplicates_basic.test b/mysql-test/suite/sys_vars/t/gtid_ignore_duplicates_basic.test
new file mode 100644
index 00000000000..23b7dc85596
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_ignore_duplicates_basic.test
@@ -0,0 +1,14 @@
+--source include/not_embedded.inc
+
+SET @save_gtid_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
+
+SELECT @@GLOBAL.gtid_ignore_duplicates as 'must be zero because of default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.gtid_ignore_duplicates as 'no session var';
+
+SET GLOBAL gtid_ignore_duplicates= FALSE;
+SET GLOBAL gtid_ignore_duplicates= DEFAULT;
+SET GLOBAL gtid_ignore_duplicates= TRUE;
+SELECT @@GLOBAL.gtid_ignore_duplicates;
+
+SET GLOBAL gtid_ignore_duplicates = @save_gtid_ignore_duplicates;
diff --git a/mysql-test/suite/sys_vars/t/gtid_seq_no_basic.test b/mysql-test/suite/sys_vars/t/gtid_seq_no_basic.test
new file mode 100644
index 00000000000..db5768ac334
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_seq_no_basic.test
@@ -0,0 +1,13 @@
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@global.gtid_seq_no;
+
+--error ER_LOCAL_VARIABLE
+SET GLOBAL gtid_seq_no= 10;
+SET SESSION gtid_seq_no= 20;
+SELECT @@session.gtid_seq_no;
+
+--error ER_LOCAL_VARIABLE
+SET GLOBAL gtid_seq_no= DEFAULT;
+
+SET SESSION gtid_seq_no= -1;
+SELECT @@session.gtid_seq_no;
diff --git a/mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test b/mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test
new file mode 100644
index 00000000000..d021e335b86
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_slave_pos_basic.test
@@ -0,0 +1,46 @@
+--source include/not_embedded.inc
+
+SET @old_gtid_slave_pos= @@gtid_slave_pos;
+
+SET GLOBAL gtid_slave_pos= '';
+SELECT @@gtid_slave_pos;
+SET GLOBAL gtid_slave_pos= '1-2-3';
+SELECT variable_value FROM information_schema.global_variables
+ WHERE variable_name='gtid_slave_pos';
+SET @@global.gtid_slave_pos= '1-2-4';
+SELECT @@gtid_slave_pos;
+
+SET GLOBAL gtid_slave_pos= ' 1-2-3';
+SELECT @@gtid_slave_pos;
+SET GLOBAL gtid_slave_pos= '1-2-3, 2-4-6';
+SELECT @@gtid_slave_pos;
+
+--error ER_INCORRECT_GTID_STATE
+SET GLOBAL gtid_slave_pos= '-1-2-3';
+--error ER_INCORRECT_GTID_STATE
+SET GLOBAL gtid_slave_pos= '1-2 -3';
+--error ER_INCORRECT_GTID_STATE
+SET GLOBAL gtid_slave_pos= '1-2-3 ';
+--error ER_INCORRECT_GTID_STATE
+SET GLOBAL gtid_slave_pos= '1-2-3,2-4';
+
+--error ER_DUPLICATE_GTID_DOMAIN
+SET GLOBAL gtid_slave_pos= '0-1-10,0-2-20';
+--error ER_DUPLICATE_GTID_DOMAIN
+SET GLOBAL gtid_slave_pos= '0-1-10,1-2-20,2-3-30,1-20-200,3-4-1';
+
+--error ER_GLOBAL_VARIABLE
+SET gtid_slave_pos= '';
+--error ER_GLOBAL_VARIABLE
+SET SESSION gtid_slave_pos= '';
+
+SET GLOBAL gtid_slave_pos= '1-2-3,2-4-6';
+SELECT @@gtid_slave_pos;
+
+--error ER_NO_DEFAULT
+SET GLOBAL gtid_slave_pos= DEFAULT;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.gtid_slave_pos;
+
+SET GLOBAL gtid_slave_pos= @old_gtid_slave_pos;
diff --git a/mysql-test/suite/sys_vars/t/gtid_strict_mode_basic.test b/mysql-test/suite/sys_vars/t/gtid_strict_mode_basic.test
new file mode 100644
index 00000000000..c6287dcd6bc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/gtid_strict_mode_basic.test
@@ -0,0 +1,21 @@
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.gtid_strict_mode;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.gtid_strict_mode;
+show global variables like 'gtid_strict_mode';
+show session variables like 'gtid_strict_mode';
+select * from information_schema.global_variables where variable_name='gtid_strict_mode';
+select * from information_schema.session_variables where variable_name='gtid_strict_mode';
+
+SET @old= @@GLOBAL.gtid_strict_mode;
+set global gtid_strict_mode=1;
+select @@global.gtid_strict_mode;
+set global gtid_strict_mode=0;
+select @@global.gtid_strict_mode;
+set global gtid_strict_mode=@old;
+
+--error ER_GLOBAL_VARIABLE
+set session gtid_strict_mode=1;
diff --git a/mysql-test/suite/sys_vars/t/histogram_size_basic.test b/mysql-test/suite/sys_vars/t/histogram_size_basic.test
new file mode 100644
index 00000000000..d65936e3616
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/histogram_size_basic.test
@@ -0,0 +1,142 @@
+--source include/load_sysvars.inc
+
+##############################################################
+# START OF histogram_size TESTS #
+##############################################################
+
+
+#############################################################
+# Save initial value #
+#############################################################
+
+SET @start_global_value = @@global.histogram_size;
+SELECT @start_global_value;
+SET @start_session_value = @@session.histogram_size;
+SELECT @start_session_value;
+
+--echo '#--------------------FN_DYNVARS_053_01-------------------------#'
+################################################################
+# Display the DEFAULT value of histogram_size #
+################################################################
+
+SET @@global.histogram_size = DEFAULT;
+SELECT @@global.histogram_size;
+
+SET @@session.histogram_size = DEFAULT;
+SELECT @@session.histogram_size;
+
+--echo '#--------------------FN_DYNVARS_053_03-------------------------#'
+########################################################################
+# Change the value of histogram_size to a valid value for GLOBAL Scope #
+########################################################################
+
+SET @@global.histogram_size = 1;
+SELECT @@global.histogram_size;
+SET @@global.histogram_size = 31;
+SELECT @@global.histogram_size;
+SET @@global.histogram_size = 255;
+SELECT @@global.histogram_size;
+
+--echo '#--------------------FN_DYNVARS_053_04-------------------------#'
+#########################################################################
+# Change the value of histogram_size to a valid value for SESSION Scope #
+#########################################################################
+
+SET @@session.histogram_size = 1;
+SELECT @@session.histogram_size;
+SET @@session.histogram_size = 31;
+SELECT @@session.histogram_size;
+SET @@session.histogram_size = 255;
+SELECT @@session.histogram_size;
+
+--echo '#------------------FN_DYNVARS_053_05-----------------------#'
+##########################################################
+# Change the value of histogram_size to an invalid value #
+###########################################################
+
+SET @@global.histogram_size = -1;
+SELECT @@global.histogram_size;
+SET @@global.histogram_size = 256;
+SELECT @@global.histogram_size;
+SET @@global.histogram_size = 1024;
+SELECT @@global.histogram_size;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.histogram_size = 4.5;
+SELECT @@global.histogram_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.histogram_size = test;
+SELECT @@global.histogram_size;
+
+SET @@session.histogram_size = -1;
+SELECT @@session.histogram_size;
+SET @@session.histogram_size = 256;
+SELECT @@session.histogram_size;
+SET @@session.histogram_size = 1024;
+SELECT @@session.histogram_size;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.histogram_size = 4.5;
+SELECT @@session.histogram_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.histogram_size = test;
+SELECT @@session.histogram_size;
+
+--echo '#------------------FN_DYNVARS_053_06-----------------------#'
+####################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+####################################################################
+
+SELECT @@global.histogram_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='histogram_size';
+
+--echo '#------------------FN_DYNVARS_053_07-----------------------#'
+####################################################################
+# Check if the value in SESSION Table matches value in variable #
+####################################################################
+
+SELECT @@session.histogram_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='histogram_size';
+
+
+--echo '#------------------FN_DYNVARS_053_08-----------------------#'
+####################################################################
+# Check if TRUE and FALSE values can be used on variable #
+####################################################################
+
+SET @@global.histogram_size = TRUE;
+SET @@global.histogram_size = FALSE;
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+#################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+#################################################################################
+
+SET @@global.histogram_size = 10;
+SELECT @@histogram_size = @@global.histogram_size;
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+########################################################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
+########################################################################################################
+
+SET @@histogram_size = 100;
+SELECT @@histogram_size = @@local.histogram_size;
+SELECT @@local.histogram_size = @@session.histogram_size;
+
+####################################
+# Restore initial value #
+####################################
+
+SET @@global.histogram_size = @start_global_value;
+SELECT @@global.histogram_size;
+SET @@session.histogram_size = @start_session_value;
+SELECT @@session.histogram_size;
+
+
+###################################################
+# END OF histogram_size TESTS #
+###################################################
+
diff --git a/mysql-test/suite/sys_vars/t/histogram_type_basic.test b/mysql-test/suite/sys_vars/t/histogram_type_basic.test
new file mode 100644
index 00000000000..bf1ef5ef700
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/histogram_type_basic.test
@@ -0,0 +1,92 @@
+--source include/load_sysvars.inc
+
+#############################################################
+# Save initial value #
+#############################################################
+
+SET @start_global_value = @@global.histogram_type;
+SELECT @start_global_value;
+SET @start_session_value = @@session.histogram_type;
+SELECT @start_session_value;
+
+##############################################################
+# Display the DEFAULT value of histogram_type #
+##############################################################
+
+SET @@global.histogram_type = 1;
+SET @@global.histogram_type = DEFAULT;
+SELECT @@global.histogram_type;
+
+#################################################################################
+# Change the value of histogram_type to a valid value for GLOBAL Scope #
+#################################################################################
+
+SET @@global.histogram_type = 0;
+SELECT @@global.histogram_type;
+SET @@global.histogram_type = 1;
+SELECT @@global.histogram_type;
+
+SET @@global.histogram_type = SINGLE_PREC_HB;
+SELECT @@global.histogram_type;
+SET @@global.histogram_type = DOUBLE_PREC_HB;
+SELECT @@global.histogram_type;
+
+###################################################################################
+# Change the value of histogram_type to a valid value for SESSION Scope #
+###################################################################################
+
+SET @@session.histogram_type = 0;
+SELECT @@session.histogram_type;
+SET @@session.histogram_type = 1;
+SELECT @@session.histogram_type;
+
+SET @@session.histogram_type = SINGLE_PREC_HB;
+SELECT @@session.histogram_type;
+SET @@session.histogram_type = DOUBLE_PREC_HB;
+SELECT @@session.histogram_type;
+
+####################################################################
+# Change the value of histogram_type to an invalid value #
+####################################################################
+
+set sql_mode=TRADITIONAL;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.histogram_type = 10;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.histogram_type = -1024;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.histogram_type = 2.4;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.histogram_type = OFF;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.histogram_type = 10;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.histogram_type = -2;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.histogram_type = 1.2;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.histogram_type = ON;
+
+###############################################################################
+# Check if the value in GLOBAL & SESSION Tables matches value in variable #
+###############################################################################
+
+SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='histogram_type';
+
+SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='histogram_type';
+
+####################################
+# Restore initial value #
+####################################
+
+SET @@global.histogram_type = @start_global_value;
+SELECT @@global.histogram_type;
+SET @@session.histogram_type = @start_session_value;
+SELECT @@session.histogram_type;
+set sql_mode='';
+
+#####################################################
+# END OF histogram_type TESTS #
+##################################################### \ No newline at end of file
diff --git a/mysql-test/suite/sys_vars/t/host_cache_size_basic-master.opt b/mysql-test/suite/sys_vars/t/host_cache_size_basic-master.opt
new file mode 100644
index 00000000000..7fb505c5572
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/host_cache_size_basic-master.opt
@@ -0,0 +1 @@
+--host-cache-size=123
diff --git a/mysql-test/suite/sys_vars/t/host_cache_size_basic.test b/mysql-test/suite/sys_vars/t/host_cache_size_basic.test
new file mode 100644
index 00000000000..38713d2f963
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/host_cache_size_basic.test
@@ -0,0 +1,41 @@
+--source include/not_embedded.inc
+
+#
+# Only global
+#
+
+select @@global.host_cache_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.host_cache_size;
+
+show global variables like 'host_cache_size';
+
+show session variables like 'host_cache_size';
+
+select * from information_schema.global_variables
+ where variable_name='host_cache_size';
+
+select * from information_schema.session_variables
+ where variable_name='host_cache_size';
+
+#
+# Read-Write
+#
+
+set global host_cache_size=1;
+select @@global.host_cache_size;
+
+set global host_cache_size=12;
+select @@global.host_cache_size;
+
+set global host_cache_size=0;
+select @@global.host_cache_size;
+
+--error ER_GLOBAL_VARIABLE
+set session host_cache_size=1;
+
+# Restore default
+set global host_cache_size=123;
+select @@global.host_cache_size;
+
diff --git a/mysql-test/suite/sys_vars/t/ignore_db_dirs_basic.test b/mysql-test/suite/sys_vars/t/ignore_db_dirs_basic.test
index 9544fc540f9..78f6479dea6 100644
--- a/mysql-test/suite/sys_vars/t/ignore_db_dirs_basic.test
+++ b/mysql-test/suite/sys_vars/t/ignore_db_dirs_basic.test
@@ -1,3 +1,5 @@
+call mtr.add_suppression("table or database name '.otherdir'");
+
select @@ignore_db_dirs;
let $MYSQLD_DATADIR= `select @@datadir`;
diff --git a/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_lwm_basic.test b/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_lwm_basic.test
new file mode 100644
index 00000000000..04f07cdd3df
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_lwm_basic.test
@@ -0,0 +1,142 @@
+############ mysql-test\t\innodb_adaptive_flushing_lwm_basic.test #############
+# #
+# Variable Name: innodb_adaptive_flushing_lwm #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: Numeric #
+# Default Value: 10 #
+# Range: 0-70 #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author: Rizwan #
+# #
+#Description:Test Cases of Dynamic System Variable innodb_adaptive_flushing_lwm #
+# that checks the 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-system-variables.html #
+# #
+###############################################################################
+
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+########################################################################
+# START OF innodb_adaptive_flushing_lwm TESTS #
+########################################################################
+
+
+###############################################################################
+#Saving initial value of innodb_adaptive_flushing_lwm in a temporary variable #
+###############################################################################
+
+SET @global_start_value = @@global.innodb_adaptive_flushing_lwm;
+SELECT @global_start_value;
+
+--echo '#--------------------FN_DYNVARS_046_01------------------------#'
+########################################################################
+# Display the DEFAULT value of innodb_adaptive_flushing_lwm #
+########################################################################
+
+SET @@global.innodb_adaptive_flushing_lwm = 1;
+SET @@global.innodb_adaptive_flushing_lwm = DEFAULT;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
+###################################################################################
+# Check if innodb_adaptive_flushing_lwm can be accessed with and without @@ sign #
+###################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET innodb_adaptive_flushing_lwm = 1;
+SELECT @@innodb_adaptive_flushing_lwm;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.innodb_adaptive_flushing_lwm;
+
+SET global innodb_adaptive_flushing_lwm = 1;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+--echo '#--------------------FN_DYNVARS_046_03------------------------#'
+###############################################################################
+# change the value of innodb_adaptive_flushing_lwm to a valid value #
+###############################################################################
+
+SET @@global.innodb_adaptive_flushing_lwm = 1;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+SET @@global.innodb_adaptive_flushing_lwm = 60;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+SET @@global.innodb_adaptive_flushing_lwm = 70;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
+###########################################################################
+# Change the value of innodb_adaptive_flushing_lwm to invalid value #
+###########################################################################
+
+SET @@global.innodb_adaptive_flushing_lwm = -1;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_adaptive_flushing_lwm = "T";
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_adaptive_flushing_lwm = "Y";
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+SET @@global.innodb_adaptive_flushing_lwm = 71;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+--echo '#----------------------FN_DYNVARS_046_05------------------------#'
+#########################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#########################################################################
+
+SELECT @@global.innodb_adaptive_flushing_lwm =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_adaptive_flushing_lwm';
+SELECT @@global.innodb_adaptive_flushing_lwm;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_adaptive_flushing_lwm';
+
+--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+###################################################################
+# Check if ON and OFF values can be used on variable #
+###################################################################
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_adaptive_flushing_lwm = OFF;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_adaptive_flushing_lwm = ON;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+--echo '#---------------------FN_DYNVARS_046_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+
+SET @@global.innodb_adaptive_flushing_lwm = TRUE;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+SET @@global.innodb_adaptive_flushing_lwm = FALSE;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.innodb_adaptive_flushing_lwm = @global_start_value;
+SELECT @@global.innodb_adaptive_flushing_lwm;
+
+###############################################################
+# END OF innodb_adaptive_flushing_lwm TESTS #
+###############################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_adaptive_max_sleep_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_adaptive_max_sleep_delay_basic.test
new file mode 100644
index 00000000000..a2508b073eb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_adaptive_max_sleep_delay_basic.test
@@ -0,0 +1,75 @@
+################## mysql-test/t/innodb_adaptive_max_sleep_delay.test ##########
+# #
+# Variable Name: innodb_adaptive_max_sleep_delay #
+# Scope: Global #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# #
+# Note: This variable is only defined if innodb_have_atomic_builtins=ON #
+# #
+# Creation Date: 2011-08-17 #
+# Author : Sunny Bains #
+# #
+# #
+# Description: Dynamic config global variable innodb_adaptive_max_sleep_delay #
+# * Value check #
+# * Scope check #
+# #
+###############################################################################
+
+--source include/have_innodb.inc
+
+# Check if builtins are enabled
+if (`SELECT LOWER(VARIABLE_VALUE)='off' FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+ WHERE LOWER(variable_name) = 'innodb_have_atomic_builtins'`) {
+ --skip Test requires InnoDB atomic builtins
+}
+
+# Display default value
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+--echo 150000 Expected
+
+# Check if value can be set
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100;
+
+# Check for out of bounds
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000001;
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+--echo 1000000 Expected
+
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=-1;
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+--echo 0 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_adaptive_max_sleep_delay);
+--echo 1 Expected
+
+# Check if the value in GLOBAL table matches value in variable
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_adaptive_max_sleep_delay';
+--echo 100 Expected
+
+# Check if accessing variable with and without GLOBAL point to same
+# variable
+SELECT @@innodb_adaptive_max_sleep_delay = @@GLOBAL.innodb_adaptive_max_sleep_delay;
+--echo 1000000 Expected
+
+# Check if innodb_adaptive_max_sleep_delay can be accessed with and
+# without @@ sign.
+SELECT COUNT(@@innodb_adaptive_max_sleep_delay);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_adaptive_max_sleep_delay);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_adaptive_max_sleep_delay);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_adaptive_max_sleep_delay = @@SESSION.innodb_adaptive_max_sleep_delay;
+
+# Reset the default
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=150000;
diff --git a/mysql-test/suite/sys_vars/t/innodb_api_bk_commit_interval_basic.test b/mysql-test/suite/sys_vars/t/innodb_api_bk_commit_interval_basic.test
new file mode 100644
index 00000000000..b3a7aebce4e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_api_bk_commit_interval_basic.test
@@ -0,0 +1,58 @@
+#
+# 2012-08-01 Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_api_bk_commit_interval;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are positive number
+SELECT @@global.innodb_api_bk_commit_interval > 0;
+SELECT @@global.innodb_api_bk_commit_interval <= 1024*1024*1024;
+SELECT @@global.innodb_api_bk_commit_interval;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_api_bk_commit_interval;
+SHOW global variables LIKE 'innodb_api_bk_commit_interval';
+SHOW session variables LIKE 'innodb_api_bk_commit_interval';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_bk_commit_interval';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_api_bk_commit_interval';
+
+#
+# show that it's writable
+#
+SET global innodb_api_bk_commit_interval=100;
+SELECT @@global.innodb_api_bk_commit_interval;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_bk_commit_interval';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_api_bk_commit_interval';
+--error ER_GLOBAL_VARIABLE
+SET session innodb_api_bk_commit_interval=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_api_bk_commit_interval=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_api_bk_commit_interval=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_api_bk_commit_interval="foo";
+SET global innodb_api_bk_commit_interval=-7;
+SELECT @@global.innodb_api_bk_commit_interval;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_bk_commit_interval';
+
+#
+# cleanup
+#
+
+SET @@global.innodb_api_bk_commit_interval = @start_global_value;
+SELECT @@global.innodb_api_bk_commit_interval;
diff --git a/mysql-test/suite/sys_vars/t/have_ndbcluster_basic.test b/mysql-test/suite/sys_vars/t/innodb_api_disable_rowlock_basic.test
index 1ac341ff62e..c9c04a27229 100644
--- a/mysql-test/suite/sys_vars/t/have_ndbcluster_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_api_disable_rowlock_basic.test
@@ -1,18 +1,18 @@
-################## mysql-test\t\have_ndbcluster_basic.test ####################
+################## mysql-test\t\innodb_api_disable_rowlock_basic.test ##############
# #
-# Variable Name: have_ndbcluster #
+# Variable Name: innodb_api_disable_rowlock #
# Scope: Global #
# Access Type: Static #
-# Data Type: boolean #
+# Data Type: numeric #
# #
# #
# Creation Date: 2008-02-07 #
-# Author : Sharique Abdullah #
+# Author : Sharique Abdullah #
# #
# #
-# Description:Test Cases of Dynamic System Variable have_ndbcluster #
+# Description:Test Cases of Dynamic System Variable innodb_api_disable_rowlock #
# that checks the behavior of this variable in the following ways #
# * Value Check #
# * Scope Check #
@@ -22,79 +22,81 @@
# #
###############################################################################
---echo '#---------------------BS_STVARS_012_01----------------------#'
+--source include/have_innodb.inc
+
+--echo '#---------------------BS_STVARS_035_01----------------------#'
####################################################################
# Displaying default value #
####################################################################
-SELECT COUNT(@@GLOBAL.have_ndbcluster);
+SELECT COUNT(@@GLOBAL.innodb_api_disable_rowlock);
--echo 1 Expected
---echo '#---------------------BS_STVARS_012_02----------------------#'
+--echo '#---------------------BS_STVARS_035_02----------------------#'
####################################################################
# Check if Value can set #
####################################################################
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.have_ndbcluster=1;
+SET @@GLOBAL.innodb_api_disable_rowlock=1;
--echo Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.have_ndbcluster);
+SELECT COUNT(@@GLOBAL.innodb_api_disable_rowlock);
--echo 1 Expected
---echo '#---------------------BS_STVARS_012_03----------------------#'
+--echo '#---------------------BS_STVARS_035_03----------------------#'
#################################################################
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
-SELECT @@GLOBAL.have_ndbcluster = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_api_disable_rowlock, 'ON', 'OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_ndbcluster';
+WHERE VARIABLE_NAME='innodb_api_disable_rowlock';
--echo 1 Expected
-SELECT COUNT(@@GLOBAL.have_ndbcluster);
+SELECT COUNT(@@GLOBAL.innodb_api_disable_rowlock);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_ndbcluster';
+WHERE VARIABLE_NAME='innodb_api_disable_rowlock';
--echo 1 Expected
---echo '#---------------------BS_STVARS_012_04----------------------#'
+--echo '#---------------------BS_STVARS_035_04----------------------#'
################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
################################################################################
-SELECT @@have_ndbcluster = @@GLOBAL.have_ndbcluster;
+SELECT @@innodb_api_disable_rowlock = @@GLOBAL.innodb_api_enable_binlog;
--echo 1 Expected
---echo '#---------------------BS_STVARS_012_05----------------------#'
+--echo '#---------------------BS_STVARS_035_05----------------------#'
################################################################################
-# Check if have_ndbcluster can be accessed with and without @@ sign #
+# Check if innodb_log_file_size can be accessed with and without @@ sign #
################################################################################
-SELECT COUNT(@@have_ndbcluster);
+SELECT COUNT(@@innodb_api_disable_rowlock);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.have_ndbcluster);
+SELECT COUNT(@@local.innodb_api_disable_rowlock);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.have_ndbcluster);
+SELECT COUNT(@@SESSION.innodb_api_disable_rowlock);
--echo Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.have_ndbcluster);
+SELECT COUNT(@@GLOBAL.innodb_api_disable_rowlock);
--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
-SELECT have_ndbcluster = @@SESSION.have_ndbcluster;
+SELECT innodb_api_disable_rowlock = @@SESSION.innodb_api_enable_binlog;
--echo Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/have_innodb_basic.test b/mysql-test/suite/sys_vars/t/innodb_api_enable_binlog_basic.test
index 9ae1bb0d443..637541ef621 100644
--- a/mysql-test/suite/sys_vars/t/have_innodb_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_api_enable_binlog_basic.test
@@ -1,18 +1,18 @@
-################## mysql-test\t\have_innodb_basic.test ########################
+################## mysql-test\t\innodb_api_enable_binlog_basic.test ##############
# #
-# Variable Name: have_innodb #
+# Variable Name: innodb_api_enable_binlog #
# Scope: Global #
# Access Type: Static #
-# Data Type: boolean #
+# Data Type: numeric #
# #
# #
# Creation Date: 2008-02-07 #
-# Author : Sharique Abdullah #
+# Author : Sharique Abdullah #
# #
# #
-# Description:Test Cases of Dynamic System Variable have_innodb #
+# Description:Test Cases of Dynamic System Variable innodb_api_enable_binlog #
# that checks the behavior of this variable in the following ways #
# * Value Check #
# * Scope Check #
@@ -22,79 +22,81 @@
# #
###############################################################################
---echo '#---------------------BS_STVARS_011_01----------------------#'
+--source include/have_innodb.inc
+
+--echo '#---------------------BS_STVARS_035_01----------------------#'
####################################################################
# Displaying default value #
####################################################################
-SELECT COUNT(@@GLOBAL.have_innodb);
+SELECT COUNT(@@GLOBAL.innodb_api_enable_binlog);
--echo 1 Expected
---echo '#---------------------BS_STVARS_011_02----------------------#'
+--echo '#---------------------BS_STVARS_035_02----------------------#'
####################################################################
# Check if Value can set #
####################################################################
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.have_innodb=1;
+SET @@GLOBAL.innodb_api_enable_binlog=1;
--echo Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.have_innodb);
+SELECT COUNT(@@GLOBAL.innodb_api_enable_binlog);
--echo 1 Expected
---echo '#---------------------BS_STVARS_011_03----------------------#'
+--echo '#---------------------BS_STVARS_035_03----------------------#'
#################################################################
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
-SELECT @@GLOBAL.have_innodb = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_api_enable_binlog, 'ON', 'OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_innodb';
+WHERE VARIABLE_NAME='innodb_api_enable_binlog';
--echo 1 Expected
-SELECT COUNT(@@GLOBAL.have_innodb);
+SELECT COUNT(@@GLOBAL.innodb_api_enable_binlog);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_innodb';
+WHERE VARIABLE_NAME='innodb_api_enable_binlog';
--echo 1 Expected
---echo '#---------------------BS_STVARS_011_04----------------------#'
+--echo '#---------------------BS_STVARS_035_04----------------------#'
################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
################################################################################
-SELECT @@have_innodb = @@GLOBAL.have_innodb;
+SELECT @@innodb_api_enable_binlog = @@GLOBAL.innodb_api_enable_binlog;
--echo 1 Expected
---echo '#---------------------BS_STVARS_011_05----------------------#'
+--echo '#---------------------BS_STVARS_035_05----------------------#'
################################################################################
-# Check if have_innodb can be accessed with and without @@ sign #
+# Check if innodb_log_file_size can be accessed with and without @@ sign #
################################################################################
-SELECT COUNT(@@have_innodb);
+SELECT COUNT(@@innodb_api_enable_binlog);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.have_innodb);
+SELECT COUNT(@@local.innodb_api_enable_binlog);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.have_innodb);
+SELECT COUNT(@@SESSION.innodb_api_enable_binlog);
--echo Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.have_innodb);
+SELECT COUNT(@@GLOBAL.innodb_api_enable_binlog);
--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
-SELECT have_innodb = @@SESSION.have_innodb;
+SELECT innodb_api_enable_binlog = @@SESSION.innodb_api_enable_binlog;
--echo Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/have_csv_basic.test b/mysql-test/suite/sys_vars/t/innodb_api_enable_mdl_basic.test
index 12081ff270e..0e440a72cce 100644
--- a/mysql-test/suite/sys_vars/t/have_csv_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_api_enable_mdl_basic.test
@@ -1,18 +1,18 @@
-################## mysql-test\t\have_csv_basic.test ###########################
+################## mysql-test\t\innodb_api_enable_mdl_basic.test ##############
# #
-# Variable Name: have_csv #
+# Variable Name: innodb_api_enable_mdl #
# Scope: Global #
# Access Type: Static #
-# Data Type: boolean #
+# Data Type: numeric #
# #
# #
# Creation Date: 2008-02-07 #
-# Author : Sharique Abdullah #
+# Author : Sharique Abdullah #
# #
# #
-# Description:Test Cases of Dynamic System Variable have_csv #
+# Description:Test Cases of Dynamic System Variable innodb_api_enable_mdl #
# that checks the behavior of this variable in the following ways #
# * Value Check #
# * Scope Check #
@@ -22,79 +22,81 @@
# #
###############################################################################
---echo '#---------------------BS_STVARS_008_01----------------------#'
+--source include/have_innodb.inc
+
+--echo '#---------------------BS_STVARS_035_01----------------------#'
####################################################################
# Displaying default value #
####################################################################
-SELECT COUNT(@@GLOBAL.have_csv);
+SELECT COUNT(@@GLOBAL.innodb_api_enable_mdl);
--echo 1 Expected
---echo '#---------------------BS_STVARS_008_02----------------------#'
+--echo '#---------------------BS_STVARS_035_02----------------------#'
####################################################################
# Check if Value can set #
####################################################################
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.have_csv=1;
+SET @@GLOBAL.innodb_api_enable_mdl=1;
--echo Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.have_csv);
+SELECT COUNT(@@GLOBAL.innodb_api_enable_mdl);
--echo 1 Expected
---echo '#---------------------BS_STVARS_008_03----------------------#'
+--echo '#---------------------BS_STVARS_035_03----------------------#'
#################################################################
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
-SELECT @@GLOBAL.have_csv = VARIABLE_VALUE
+SELECT IF(@@GLOBAL.innodb_api_enable_mdl, 'ON', 'OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_csv';
+WHERE VARIABLE_NAME='innodb_api_enable_mdl';
--echo 1 Expected
-SELECT COUNT(@@GLOBAL.have_csv);
+SELECT COUNT(@@GLOBAL.innodb_api_enable_mdl);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_csv';
+WHERE VARIABLE_NAME='innodb_api_enable_mdl';
--echo 1 Expected
---echo '#---------------------BS_STVARS_008_04----------------------#'
+--echo '#---------------------BS_STVARS_035_04----------------------#'
################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
################################################################################
-SELECT @@have_csv = @@GLOBAL.have_csv;
+SELECT @@innodb_api_enable_mdl = @@GLOBAL.innodb_api_enable_mdl;
--echo 1 Expected
---echo '#---------------------BS_STVARS_008_05----------------------#'
+--echo '#---------------------BS_STVARS_035_05----------------------#'
################################################################################
-# Check if have_csv can be accessed with and without @@ sign #
+# Check if innodb_log_file_size can be accessed with and without @@ sign #
################################################################################
-SELECT COUNT(@@have_csv);
+SELECT COUNT(@@innodb_api_enable_mdl);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.have_csv);
+SELECT COUNT(@@local.innodb_api_enable_mdl);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.have_csv);
+SELECT COUNT(@@SESSION.innodb_api_enable_mdl);
--echo Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.have_csv);
+SELECT COUNT(@@GLOBAL.innodb_api_enable_mdl);
--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
-SELECT have_csv = @@SESSION.have_csv;
+SELECT innodb_api_enable_mdl = @@SESSION.innodb_api_enable_mdl;
--echo Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/innodb_api_trx_level_basic.test b/mysql-test/suite/sys_vars/t/innodb_api_trx_level_basic.test
new file mode 100644
index 00000000000..49c34b647fd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_api_trx_level_basic.test
@@ -0,0 +1,58 @@
+#
+# 2011-08-01 Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_api_trx_level;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are zero or above
+SELECT @@global.innodb_api_trx_level >=0;
+SELECT @@global.innodb_api_trx_level <=3;
+SELECT @@global.innodb_api_trx_level;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_api_trx_level;
+SHOW global variables LIKE 'innodb_api_trx_level';
+SHOW session variables LIKE 'innodb_api_trx_level';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_trx_level';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_api_trx_level';
+
+#
+# show that it's writable
+#
+SET global innodb_api_trx_level=100;
+SELECT @@global.innodb_api_trx_level;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_trx_level';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_api_trx_level';
+--error ER_GLOBAL_VARIABLE
+SET session innodb_api_trx_level=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_api_trx_level=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_api_trx_level=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_api_trx_level="foo";
+SET global innodb_api_trx_level=-7;
+SELECT @@global.innodb_api_trx_level;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_api_trx_level';
+
+#
+# cleanup
+#
+
+SET @@global.innodb_api_trx_level = @start_global_value;
+SELECT @@global.innodb_api_trx_level;
diff --git a/mysql-test/suite/sys_vars/t/innodb_autoextend_increment_basic.test b/mysql-test/suite/sys_vars/t/innodb_autoextend_increment_basic.test
index eb208e7197f..cbe62a105ff 100644
--- a/mysql-test/suite/sys_vars/t/innodb_autoextend_increment_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_autoextend_increment_basic.test
@@ -4,7 +4,7 @@
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
-# Default Value: 8 #
+# Default Value: 64 #
# Range: 0,1 #
# #
# #
diff --git a/mysql-test/suite/sys_vars/t/innodb_buf_flush_list_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_buf_flush_list_now_basic.test
new file mode 100644
index 00000000000..8a53b0a5770
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buf_flush_list_now_basic.test
@@ -0,0 +1,32 @@
+--echo #
+--echo # Basic test for innodb_buf_flush_list_now.
+--echo #
+
+--source include/have_innodb.inc
+
+# The config variable is a debug variable for now
+-- source include/have_debug.inc
+
+SELECT @@global.innodb_buf_flush_list_now;
+
+set global innodb_buf_flush_list_now = 1;
+
+SELECT @@global.innodb_buf_flush_list_now;
+
+set global innodb_buf_flush_list_now = 0;
+
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_buf_flush_list_now = dummy;
+
+--error ER_GLOBAL_VARIABLE
+set innodb_buf_flush_list_now = ON;
+
+--echo # Setting to ON is ok.
+set global innodb_buf_flush_list_now = ON;
+
+--echo # Setting to OFF is ok.
+set global innodb_buf_flush_list_now = OFF;
+
+--echo # Must always be 0.
+SELECT @@global.innodb_buf_flush_list_now;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_at_shutdown_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_at_shutdown_basic.test
new file mode 100644
index 00000000000..b69e856be5a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_at_shutdown_basic.test
@@ -0,0 +1,42 @@
+#
+# Basic test for innodb_buffer_pool_dump_at_shutdown
+#
+
+-- source include/have_innodb.inc
+# include/restart_mysqld.inc does not work in embedded mode
+-- source include/not_embedded.inc
+
+# Check the default value
+SET @orig = @@global.innodb_buffer_pool_dump_at_shutdown;
+SELECT @orig;
+
+# Confirm that we can change the value
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = OFF;
+SELECT @@global.innodb_buffer_pool_dump_at_shutdown;
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = ON;
+SELECT @@global.innodb_buffer_pool_dump_at_shutdown;
+
+# Check the type
+
+-- error ER_WRONG_TYPE_FOR_VAR, ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = 12.34;
+
+-- error ER_WRONG_TYPE_FOR_VAR, ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = "string";
+
+-- error ER_WRONG_TYPE_FOR_VAR, ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = 5;
+
+# Confirm that the dump file is created at shutdown
+
+-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
+
+-- error 0,1
+-- remove_file $file
+
+-- error 1
+-- file_exists $file
+
+-- source include/restart_mysqld.inc
+
+-- file_exists $file
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test
new file mode 100644
index 00000000000..0bae347428e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test
@@ -0,0 +1,25 @@
+#
+# Basic test for innodb_buffer_pool_dump_now
+#
+
+-- source include/have_innodb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_buffer_pool_dump_now;
+SELECT @orig;
+
+# Do the dump
+SET GLOBAL innodb_buffer_pool_dump_now = ON;
+# Should always be OFF
+SELECT @@global.innodb_buffer_pool_dump_now;
+
+# Wait for the dump to complete
+let $wait_condition =
+ SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
+-- source include/wait_condition.inc
+
+# Confirm that the dump file has been created
+-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
+-- file_exists $file
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_pct_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_pct_basic.test
new file mode 100644
index 00000000000..d2f5cb4a0de
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_pct_basic.test
@@ -0,0 +1,34 @@
+#
+# Basic test for innodb_buffer_pool_dump_pct
+#
+
+-- source include/have_innodb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_buffer_pool_dump_pct;
+SELECT @orig;
+
+# Do the dump
+SET GLOBAL innodb_buffer_pool_dump_pct=3, GLOBAL innodb_buffer_pool_dump_now = ON;
+
+# Wait for the dump to complete
+let $wait_condition =
+ SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
+-- source include/wait_condition.inc
+
+# Confirm that the dump file has been created
+-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
+-- file_exists $file
+
+--disable_warnings
+SET GLOBAL innodb_buffer_pool_dump_pct=0;
+SELECT @@global.innodb_buffer_pool_dump_pct;
+SHOW WARNINGS;
+SET GLOBAL innodb_buffer_pool_dump_pct=101;
+SELECT @@global.innodb_buffer_pool_dump_pct;
+SHOW WARNINGS;
+--enable_warnings
+
+SET GLOBAL innodb_buffer_pool_dump_pct=@orig;
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test
new file mode 100644
index 00000000000..c50d2d66dff
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test
@@ -0,0 +1,32 @@
+#
+# Basic test for innodb_buffer_pool_filename
+#
+
+-- source include/have_innodb.inc
+
+# Check the default value and save for later restoration
+SET @orig = @@global.innodb_buffer_pool_filename;
+SELECT @orig;
+
+let $old_val=query_get_value(SHOW STATUS LIKE 'innodb_buffer_pool_dump_status', Value, 1);
+sleep 1; # to ensure that the previous and the next dumps are at least a second apart
+
+# Try with a non-default filename
+
+SET GLOBAL innodb_buffer_pool_filename = 'innodb_foobar_dump';
+
+SET GLOBAL innodb_buffer_pool_dump_now = ON;
+-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
+
+# Wait for the dump to complete
+let $wait_condition =
+ SELECT variable_value LIKE 'Buffer pool(s) dump completed at %'
+ AND variable_value <> '$old_val'
+ FROM information_schema.global_status
+ WHERE variable_name = 'innodb_buffer_pool_dump_status';
+-- source include/wait_condition.inc
+
+-- file_exists $file
+
+# Restore the env
+SET GLOBAL innodb_buffer_pool_filename = @orig;
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_abort_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_abort_basic.test
new file mode 100644
index 00000000000..31a9d2ca25a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_abort_basic.test
@@ -0,0 +1,15 @@
+#
+# Basic test for innodb_buffer_pool_load_abort
+#
+
+-- source include/have_innodb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_buffer_pool_load_abort;
+SELECT @orig;
+
+# Confirm that the value remains OFF after being set to ON
+
+SET GLOBAL innodb_buffer_pool_load_abort = ON;
+
+SELECT @@global.innodb_buffer_pool_load_abort;
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_at_startup_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_at_startup_basic.test
new file mode 100644
index 00000000000..efaffa091a6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_at_startup_basic.test
@@ -0,0 +1,15 @@
+#
+# Basic test for innodb_buffer_pool_load_at_startup
+#
+
+-- source include/have_innodb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_buffer_pool_load_at_startup;
+SELECT @orig;
+
+# Confirm that we can not change the value
+-- error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL innodb_buffer_pool_load_at_startup = OFF;
+-- error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL innodb_buffer_pool_load_at_startup = ON;
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
new file mode 100644
index 00000000000..a0409901865
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
@@ -0,0 +1,59 @@
+#
+# Basic test for innodb_buffer_pool_load_now
+#
+
+-- source include/have_innodb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_buffer_pool_load_now;
+SELECT @orig;
+
+let $old_status= `SELECT variable_value FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`;
+
+# A previous test could have run buffer pool dump already;
+# in this case we want to make sure that the current time is different
+# from the timestamp in the status variable.
+# We should have had a smart wait condition here, like the commented one below,
+# but we can't because of MDEV-9867, so there will be just sleep instead.
+# And it might be not enough to sleep one second, so we'll have to sleep two.
+# let $wait_condition =
+# SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
+# -- source include/wait_condition.inc
+
+if (`SELECT variable_value LIKE '%dump completed at%' FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`)
+{
+ -- sleep 2
+}
+
+# Do the dump
+SET GLOBAL innodb_buffer_pool_dump_now = ON;
+
+# Wait for the dump to complete
+let $wait_condition =
+ SELECT variable_value != '$old_status'
+ AND SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
+-- source include/wait_condition.inc
+
+# Confirm the file is really created
+-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
+-- file_exists $file
+
+# Load the dump
+SET GLOBAL innodb_buffer_pool_load_now = ON;
+
+# Wait for the load to complete
+let $wait_condition =
+ SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at '
+ FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
+-- source include/wait_condition.inc
+
+# Show the status, interesting if the above timed out
+-- replace_regex /[0-9]{6}[[:space:]]+[0-9]{1,2}:[0-9]{2}:[0-9]{2}/TIMESTAMP_NOW/
+SELECT variable_value
+FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffer_max_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffer_max_size_basic.test
new file mode 100644
index 00000000000..5e081b1a0a4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_change_buffer_max_size_basic.test
@@ -0,0 +1,63 @@
+
+
+# 2011-02-09 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_change_buffer_max_size;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are between 0 and 50
+select @@global.innodb_change_buffer_max_size between 0 and 50;
+select @@global.innodb_change_buffer_max_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_change_buffer_max_size;
+show global variables like 'innodb_change_buffer_max_size';
+show session variables like 'innodb_change_buffer_max_size';
+select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
+select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
+
+#
+# show that it's writable
+#
+set global innodb_change_buffer_max_size=10;
+select @@global.innodb_change_buffer_max_size;
+select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
+select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
+--error ER_GLOBAL_VARIABLE
+set session innodb_change_buffer_max_size=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_change_buffer_max_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_change_buffer_max_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_change_buffer_max_size="foo";
+
+set global innodb_change_buffer_max_size=-7;
+select @@global.innodb_change_buffer_max_size;
+select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
+set global innodb_change_buffer_max_size=56;
+select @@global.innodb_change_buffer_max_size;
+select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
+
+#
+# min/max/DEFAULT values
+#
+set global innodb_change_buffer_max_size=0;
+select @@global.innodb_change_buffer_max_size;
+set global innodb_change_buffer_max_size=50;
+select @@global.innodb_change_buffer_max_size;
+set global innodb_change_buffer_max_size=DEFAULT;
+select @@global.innodb_change_buffer_max_size;
+
+
+SET @@global.innodb_change_buffer_max_size = @start_global_value;
+SELECT @@global.innodb_change_buffer_max_size;
diff --git a/mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test b/mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test
new file mode 100644
index 00000000000..bb0f3417f87
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test
@@ -0,0 +1,38 @@
+--source include/have_innodb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_checksum_algorithm;
+SELECT @orig;
+
+SET GLOBAL innodb_checksum_algorithm = 'crc32';
+SELECT @@global.innodb_checksum_algorithm;
+
+SET GLOBAL innodb_checksum_algorithm = 'strict_crc32';
+SELECT @@global.innodb_checksum_algorithm;
+
+SET GLOBAL innodb_checksum_algorithm = 'innodb';
+SELECT @@global.innodb_checksum_algorithm;
+
+SET GLOBAL innodb_checksum_algorithm = 'strict_innodb';
+SELECT @@global.innodb_checksum_algorithm;
+
+SET GLOBAL innodb_checksum_algorithm = 'none';
+SELECT @@global.innodb_checksum_algorithm;
+
+SET GLOBAL innodb_checksum_algorithm = 'strict_none';
+SELECT @@global.innodb_checksum_algorithm;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_checksum_algorithm = '';
+SELECT @@global.innodb_checksum_algorithm;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_checksum_algorithm = 'foobar';
+SELECT @@global.innodb_checksum_algorithm;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_checksum_algorithm = 123;
+SELECT @@global.innodb_checksum_algorithm;
+
+SET GLOBAL innodb_checksum_algorithm = @orig;
+SELECT @@global.innodb_checksum_algorithm;
diff --git a/mysql-test/suite/sys_vars/t/innodb_cleaner_eviction_factor_basic.test b/mysql-test/suite/sys_vars/t/innodb_cleaner_eviction_factor_basic.test
new file mode 100644
index 00000000000..8e0af20a47e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_cleaner_eviction_factor_basic.test
@@ -0,0 +1,35 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_cleaner_eviction_factor;
+
+# Default value
+SELECT @@GLOBAL.innodb_cleaner_eviction_factor;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_cleaner_eviction_factor;
+
+# Correct values
+SET GLOBAL innodb_cleaner_eviction_factor='OFF';
+SELECT @@GLOBAL.innodb_cleaner_eviction_factor;
+SET GLOBAL innodb_cleaner_eviction_factor='ON';
+SELECT @@GLOBAL.innodb_cleaner_eviction_factor;
+SET GLOBAL innodb_cleaner_eviction_factor=0;
+SELECT @@GLOBAL.innodb_cleaner_eviction_factor;
+SET GLOBAL innodb_cleaner_eviction_factor=1;
+SELECT @@GLOBAL.innodb_cleaner_eviction_factor;
+
+# Incorrect values
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_eviction_factor=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_eviction_factor=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_cleaner_eviction_factor=2;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_cleaner_eviction_factor='foo';
+
+SET GLOBAL innodb_cleaner_eviction_factor = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_cleaner_flush_chunk_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_cleaner_flush_chunk_size_basic.test
new file mode 100644
index 00000000000..c65fc63c20f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_cleaner_flush_chunk_size_basic.test
@@ -0,0 +1,33 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_cleaner_flush_chunk_size;
+
+# Default value
+SELECT @@GLOBAL.innodb_cleaner_flush_chunk_size;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_cleaner_flush_chunk_size;
+
+# Correct values
+SET GLOBAL innodb_cleaner_flush_chunk_size=1;
+SELECT @@GLOBAL.innodb_cleaner_flush_chunk_size;
+SET GLOBAL innodb_cleaner_flush_chunk_size=1000;
+SELECT @@GLOBAL.innodb_cleaner_flush_chunk_size;
+SET GLOBAL innodb_cleaner_flush_chunk_size=4294967295;
+SELECT @@GLOBAL.innodb_cleaner_flush_chunk_size;
+
+# Incorrect values
+SET GLOBAL innodb_cleaner_flush_chunk_size=0;
+SELECT @@GLOBAL.innodb_cleaner_flush_chunk_size;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_flush_chunk_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_flush_chunk_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_flush_chunk_size='foo';
+
+SET GLOBAL innodb_cleaner_flush_chunk_size = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_cleaner_free_list_lwm_basic.test b/mysql-test/suite/sys_vars/t/innodb_cleaner_free_list_lwm_basic.test
new file mode 100644
index 00000000000..fa9d1e9f574
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_cleaner_free_list_lwm_basic.test
@@ -0,0 +1,35 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_cleaner_free_list_lwm;
+
+# Default value
+SELECT @@GLOBAL.innodb_cleaner_free_list_lwm;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_cleaner_free_list_lwm;
+
+# Correct values
+SET GLOBAL innodb_cleaner_free_list_lwm=0;
+SELECT @@GLOBAL.innodb_cleaner_free_list_lwm;
+SET GLOBAL innodb_cleaner_free_list_lwm=1;
+SELECT @@GLOBAL.innodb_cleaner_free_list_lwm;
+SET GLOBAL innodb_cleaner_free_list_lwm=99;
+SELECT @@GLOBAL.innodb_cleaner_free_list_lwm;
+SET GLOBAL innodb_cleaner_free_list_lwm=100;
+SELECT @@GLOBAL.innodb_cleaner_free_list_lwm;
+
+# Incorrect values
+SET GLOBAL innodb_cleaner_free_list_lwm=101;
+SELECT @@innodb_cleaner_free_list_lwm;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_free_list_lwm=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_free_list_lwm=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_free_list_lwm='foo';
+
+SET GLOBAL innodb_cleaner_free_list_lwm = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_cleaner_lru_chunk_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_cleaner_lru_chunk_size_basic.test
new file mode 100644
index 00000000000..12da590446c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_cleaner_lru_chunk_size_basic.test
@@ -0,0 +1,33 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_cleaner_lru_chunk_size;
+
+# Default value
+SELECT @@GLOBAL.innodb_cleaner_lru_chunk_size;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_cleaner_lru_chunk_size;
+
+# Correct values
+SET GLOBAL innodb_cleaner_lru_chunk_size=1;
+SELECT @@GLOBAL.innodb_cleaner_lru_chunk_size;
+SET GLOBAL innodb_cleaner_lru_chunk_size=1000;
+SELECT @@GLOBAL.innodb_cleaner_lru_chunk_size;
+SET GLOBAL innodb_cleaner_lru_chunk_size=4294967295;
+SELECT @@GLOBAL.innodb_cleaner_lru_chunk_size;
+
+# Incorrect values
+SET GLOBAL innodb_cleaner_lru_chunk_size=0;
+SELECT @@GLOBAL.innodb_cleaner_lru_chunk_size;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_lru_chunk_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_lru_chunk_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_lru_chunk_size='foo';
+
+SET GLOBAL innodb_cleaner_lru_chunk_size = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_cleaner_lsn_age_factor_basic.test b/mysql-test/suite/sys_vars/t/innodb_cleaner_lsn_age_factor_basic.test
new file mode 100644
index 00000000000..b34fcc94494
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_cleaner_lsn_age_factor_basic.test
@@ -0,0 +1,28 @@
+--source include/have_xtradb.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_cleaner_lsn_age_factor;
+
+# Default value
+SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_cleaner_lsn_age_factor;
+
+# Correct values
+SET GLOBAL innodb_cleaner_lsn_age_factor='legacy';
+SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
+SET GLOBAL innodb_cleaner_lsn_age_factor='high_checkpoint';
+SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
+
+# Incorrect values
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_lsn_age_factor=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_lsn_age_factor=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_cleaner_lsn_age_factor='foo';
+
+SET GLOBAL innodb_cleaner_lsn_age_factor = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_cleaner_max_flush_time_basic.test b/mysql-test/suite/sys_vars/t/innodb_cleaner_max_flush_time_basic.test
new file mode 100644
index 00000000000..283c651d0c5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_cleaner_max_flush_time_basic.test
@@ -0,0 +1,31 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_cleaner_max_flush_time;
+
+# Default value
+SELECT @@GLOBAL.innodb_cleaner_max_flush_time;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_cleaner_max_flush_time;
+
+# Correct values
+SET GLOBAL innodb_cleaner_max_flush_time=0;
+SELECT @@GLOBAL.innodb_cleaner_max_flush_time;
+SET GLOBAL innodb_cleaner_max_flush_time=1000;
+SELECT @@GLOBAL.innodb_cleaner_max_flush_time;
+SET GLOBAL innodb_cleaner_max_flush_time=4294967295;
+SELECT @@GLOBAL.innodb_cleaner_max_flush_time;
+
+# Incorrect values
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_max_flush_time=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_max_flush_time=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_max_flush_time='foo';
+
+SET GLOBAL innodb_cleaner_max_flush_time = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_cleaner_max_lru_time_basic.test b/mysql-test/suite/sys_vars/t/innodb_cleaner_max_lru_time_basic.test
new file mode 100644
index 00000000000..d0621e77df3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_cleaner_max_lru_time_basic.test
@@ -0,0 +1,31 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_cleaner_max_lru_time;
+
+# Default value
+SELECT @@GLOBAL.innodb_cleaner_max_lru_time;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_cleaner_max_lru_time;
+
+# Correct values
+SET GLOBAL innodb_cleaner_max_lru_time=0;
+SELECT @@GLOBAL.innodb_cleaner_max_lru_time;
+SET GLOBAL innodb_cleaner_max_lru_time=1000;
+SELECT @@GLOBAL.innodb_cleaner_max_lru_time;
+SET GLOBAL innodb_cleaner_max_lru_time=4294967295;
+SELECT @@GLOBAL.innodb_cleaner_max_lru_time;
+
+# Incorrect values
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_max_lru_time=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_max_lru_time=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_cleaner_max_lru_time='foo';
+
+SET GLOBAL innodb_cleaner_max_lru_time = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_cmp_per_index_enabled_basic.test b/mysql-test/suite/sys_vars/t/innodb_cmp_per_index_enabled_basic.test
new file mode 100644
index 00000000000..d729acea02c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_cmp_per_index_enabled_basic.test
@@ -0,0 +1,69 @@
+-- source include/have_innodb.inc
+# CREATE TABLE ... KEY_BLOCK_SIZE=8; does not work with page size = 4k
+-- source include/have_innodb_16k.inc
+
+# Check the default value
+SELECT @@global.innodb_cmp_per_index_enabled;
+
+# should be a boolean
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_stats_persistent=123;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_stats_persistent='foo';
+
+# Check that changing value works and that setting the same value again
+# is as expected
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+SELECT @@global.innodb_cmp_per_index_enabled;
+
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+SELECT @@global.innodb_cmp_per_index_enabled;
+
+SET GLOBAL innodb_cmp_per_index_enabled=OFF;
+SELECT @@global.innodb_cmp_per_index_enabled;
+
+SET GLOBAL innodb_cmp_per_index_enabled=OFF;
+SELECT @@global.innodb_cmp_per_index_enabled;
+
+SET GLOBAL innodb_file_format=Barracuda;
+
+-- vertical_results
+
+# Check that enabling after being disabled resets the stats
+
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+
+CREATE TABLE t (a INT) ENGINE=INNODB KEY_BLOCK_SIZE=8;
+
+INSERT INTO t VALUES (1);
+
+SELECT * FROM information_schema.innodb_cmp_per_index;
+
+SET GLOBAL innodb_cmp_per_index_enabled=OFF;
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+
+SELECT * FROM information_schema.innodb_cmp_per_index;
+
+DROP TABLE t;
+
+# Check that enabling after being enabled does not reset the stats
+
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+
+CREATE TABLE t (a INT) ENGINE=INNODB KEY_BLOCK_SIZE=8;
+
+INSERT INTO t VALUES (1);
+
+SELECT * FROM information_schema.innodb_cmp_per_index;
+
+SET GLOBAL innodb_cmp_per_index_enabled=ON;
+
+SELECT * FROM information_schema.innodb_cmp_per_index;
+
+DROP TABLE t;
+
+#
+
+SET GLOBAL innodb_file_format=default;
+SET GLOBAL innodb_cmp_per_index_enabled=default;
diff --git a/mysql-test/suite/sys_vars/t/innodb_compression_failure_threshold_pct_basic.test b/mysql-test/suite/sys_vars/t/innodb_compression_failure_threshold_pct_basic.test
new file mode 100644
index 00000000000..1cdfaa6b31d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_compression_failure_threshold_pct_basic.test
@@ -0,0 +1,143 @@
+##### mysql-test\t\innodb_compression_failure_threshold_pct_basic.test ########
+# #
+# Variable Name: innodb_compression_failure_threshold_pct #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: Numeric #
+# Default Value: 5 #
+# Range: 0-100 #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author: Rizwan #
+# #
+#Description: Test Cases of Dynamic System Variable #
+# innodb_compression_failure_threshold_pct #
+# that checks the 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-system-variables.html #
+# #
+###############################################################################
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+######################################################################
+# START OF innodb_compression_failure_threshold_pct TESTS #
+######################################################################
+
+
+############################################################################################
+# Saving initial value of innodb_compression_failure_threshold_pct in a temporary variable #
+############################################################################################
+
+SET @global_start_value = @@global.innodb_compression_failure_threshold_pct;
+SELECT @global_start_value;
+
+--echo '#--------------------FN_DYNVARS_046_01------------------------#'
+########################################################################
+# Display the DEFAULT value of innodb_compression_failure_threshold_pct#
+########################################################################
+
+SET @@global.innodb_compression_failure_threshold_pct = 0;
+SET @@global.innodb_compression_failure_threshold_pct = DEFAULT;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
+##############################################################################################
+# check if innodb_compression_failure_threshold_pct can be accessed with and without @@ sign #
+##############################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET innodb_compression_failure_threshold_pct = 1;
+SELECT @@innodb_compression_failure_threshold_pct;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.innodb_compression_failure_threshold_pct;
+
+SET global innodb_compression_failure_threshold_pct = 0;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+--echo '#--------------------FN_DYNVARS_046_03------------------------#'
+#################################################################################
+# change the value of innodb_compression_failure_threshold_pct to a valid value #
+#################################################################################
+
+SET @@global.innodb_compression_failure_threshold_pct = 0;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+SET @@global.innodb_compression_failure_threshold_pct = 1;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+SET @@global.innodb_compression_failure_threshold_pct = 100;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
+################################################################################
+# Cange the value of innodb_compression_failure_threshold_pct to invalid value #
+################################################################################
+
+SET @@global.innodb_compression_failure_threshold_pct = -1;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_failure_threshold_pct = "T";
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_failure_threshold_pct = "Y";
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+SET @@global.innodb_compression_failure_threshold_pct = 101;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+
+--echo '#----------------------FN_DYNVARS_046_05------------------------#'
+#########################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#########################################################################
+
+SELECT @@global.innodb_compression_failure_threshold_pct =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_compression_failure_threshold_pct';
+SELECT @@global.innodb_compression_failure_threshold_pct;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_compression_failure_threshold_pct';
+
+--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+###################################################################
+# Check if ON and OFF values can be used on variable #
+###################################################################
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_failure_threshold_pct = OFF;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_failure_threshold_pct = ON;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+--echo '#---------------------FN_DYNVARS_046_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+SET @@global.innodb_compression_failure_threshold_pct = TRUE;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+SET @@global.innodb_compression_failure_threshold_pct = FALSE;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.innodb_compression_failure_threshold_pct = @global_start_value;
+SELECT @@global.innodb_compression_failure_threshold_pct;
+
+###############################################################
+# END OF innodb_compression_failure_threshold_pct TESTS #
+###############################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_compression_level_basic.test b/mysql-test/suite/sys_vars/t/innodb_compression_level_basic.test
new file mode 100644
index 00000000000..a90abdde2f1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_compression_level_basic.test
@@ -0,0 +1,64 @@
+
+
+# 2012-05-29 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_compression_level;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid value 0-9
+select @@global.innodb_compression_level <= 9;
+select @@global.innodb_compression_level;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_compression_level;
+show global variables like 'innodb_compression_level';
+show session variables like 'innodb_compression_level';
+select * from information_schema.global_variables where variable_name='innodb_compression_level';
+select * from information_schema.session_variables where variable_name='innodb_compression_level';
+
+#
+# show that it's writable
+#
+set global innodb_compression_level=2;
+select @@global.innodb_compression_level;
+select * from information_schema.global_variables where variable_name='innodb_compression_level';
+select * from information_schema.session_variables where variable_name='innodb_compression_level';
+--error ER_GLOBAL_VARIABLE
+set session innodb_compression_level=4;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_compression_level=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_compression_level=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_compression_level="foo";
+
+set global innodb_compression_level=10;
+select @@global.innodb_compression_level;
+select * from information_schema.global_variables where variable_name='innodb_compression_level';
+set global innodb_compression_level=-7;
+select @@global.innodb_compression_level;
+select * from information_schema.global_variables where variable_name='innodb_compression_level';
+
+#
+# min/max values
+#
+set global innodb_compression_level=0;
+select @@global.innodb_compression_level;
+set global innodb_compression_level=9;
+select @@global.innodb_compression_level;
+
+#
+# cleanup
+#
+
+SET @@global.innodb_compression_level = @start_global_value;
+SELECT @@global.innodb_compression_level;
diff --git a/mysql-test/suite/sys_vars/t/innodb_compression_pad_pct_max_basic.test b/mysql-test/suite/sys_vars/t/innodb_compression_pad_pct_max_basic.test
new file mode 100644
index 00000000000..3ca566956ef
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_compression_pad_pct_max_basic.test
@@ -0,0 +1,136 @@
+############# mysql-test\t\innodb_compression_pad_pct_max_basic.test ##########
+# #
+# Variable Name: innodb_compression_pad_pct_max #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: Numeric #
+# Default Value: 50 #
+# Range: 0-75 #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author: Rizwan #
+# #
+#Description: Test Cases of Dynamic System Variable #
+# innodb_compression_pad_pct_max #
+# that checks the 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-system-variables.html #
+# #
+###############################################################################
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+######################################################################
+# START OF innodb_compression_pad_pct_max TESTS #
+######################################################################
+
+
+############################################################################################
+# Saving initial value of innodb_compression_pad_pct_max in a temporary variable #
+############################################################################################
+
+SET @global_start_value = @@global.innodb_compression_pad_pct_max;
+SELECT @global_start_value;
+
+--echo '#--------------------FN_DYNVARS_046_01------------------------#'
+########################################################################
+# Display the DEFAULT value of innodb_compression_pad_pct_max #
+########################################################################
+
+SET @@global.innodb_compression_pad_pct_max = DEFAULT;
+SELECT @@global.innodb_compression_pad_pct_max;
+
+--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
+##############################################################################################
+# check if innodb_compression_pad_pct_max can be accessed with and without @@ sign #
+##############################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET innodb_compression_pad_pct_max = 1;
+SELECT @@innodb_compression_pad_pct_max;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.innodb_compression_pad_pct_max;
+
+SET global innodb_compression_pad_pct_max = 0;
+SELECT @@global.innodb_compression_pad_pct_max;
+
+--echo '#--------------------FN_DYNVARS_046_03------------------------#'
+#################################################################################
+# change the value of innodb_compression_pad_pct_max to a valid value #
+#################################################################################
+
+SET @@global.innodb_compression_pad_pct_max = 0;
+SELECT @@global.innodb_compression_pad_pct_max;
+
+SET @@global.innodb_compression_pad_pct_max = 75;
+SELECT @@global.innodb_compression_pad_pct_max;
+
+--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
+################################################################################
+# Cange the value of innodb_compression_pad_pct_max to invalid value #
+################################################################################
+
+SET @@global.innodb_compression_pad_pct_max = -1;
+SELECT @@global.innodb_compression_pad_pct_max;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_pad_pct_max = "T";
+SELECT @@global.innodb_compression_pad_pct_max;
+
+SET @@global.innodb_compression_pad_pct_max = 76;
+SELECT @@global.innodb_compression_pad_pct_max;
+
+
+--echo '#----------------------FN_DYNVARS_046_05------------------------#'
+#########################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#########################################################################
+
+SELECT @@global.innodb_compression_pad_pct_max =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_compression_pad_pct_max';
+SELECT @@global.innodb_compression_pad_pct_max;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_compression_pad_pct_max';
+
+--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+###################################################################
+# Check if ON and OFF values can be used on variable #
+###################################################################
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_pad_pct_max = OFF;
+SELECT @@global.innodb_compression_pad_pct_max;
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_pad_pct_max = ON;
+SELECT @@global.innodb_compression_pad_pct_max;
+
+--echo '#---------------------FN_DYNVARS_046_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+SET @@global.innodb_compression_pad_pct_max = TRUE;
+SELECT @@global.innodb_compression_pad_pct_max;
+SET @@global.innodb_compression_pad_pct_max = FALSE;
+SELECT @@global.innodb_compression_pad_pct_max;
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.innodb_compression_pad_pct_max = @global_start_value;
+SELECT @@global.innodb_compression_pad_pct_max;
+
+###############################################################
+# END OF innodb_compression_pad_pct_max TESTS #
+###############################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic.test b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic.test
index 67b0247d169..f73e25179ba 100644
--- a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic.test
@@ -4,7 +4,7 @@
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
-# Default Value: 500 #
+# Default Value: 5000 #
# Range: 1-4294967295 #
# #
# #
diff --git a/mysql-test/suite/sys_vars/t/innodb_disable_background_merge_basic.test b/mysql-test/suite/sys_vars/t/innodb_disable_background_merge_basic.test
new file mode 100644
index 00000000000..9ab1a90efe1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_disable_background_merge_basic.test
@@ -0,0 +1,12 @@
+#
+# Basic test for innodb_disable_background_merge.
+#
+
+-- source include/have_innodb.inc
+
+# The config variable is a debug variable
+-- source include/have_debug.inc
+
+# Check the default value
+SET @orig = @@global.innodb_disable_background_merge;
+SELECT @orig;
diff --git a/mysql-test/suite/sys_vars/t/innodb_disable_sort_file_cache_basic.test b/mysql-test/suite/sys_vars/t/innodb_disable_sort_file_cache_basic.test
new file mode 100644
index 00000000000..62b499f03b0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_disable_sort_file_cache_basic.test
@@ -0,0 +1,70 @@
+
+
+# 2011-11-15 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_disable_sort_file_cache;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_disable_sort_file_cache in (0, 1);
+select @@global.innodb_disable_sort_file_cache;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_disable_sort_file_cache;
+show global variables like 'innodb_disable_sort_file_cache';
+show session variables like 'innodb_disable_sort_file_cache';
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+
+#
+# show that it's writable
+#
+set global innodb_disable_sort_file_cache='OFF';
+select @@global.innodb_disable_sort_file_cache;
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+set @@global.innodb_disable_sort_file_cache=1;
+select @@global.innodb_disable_sort_file_cache;
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+set global innodb_disable_sort_file_cache=0;
+select @@global.innodb_disable_sort_file_cache;
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+set @@global.innodb_disable_sort_file_cache='ON';
+select @@global.innodb_disable_sort_file_cache;
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+--error ER_GLOBAL_VARIABLE
+set session innodb_disable_sort_file_cache='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_disable_sort_file_cache='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_disable_sort_file_cache=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_disable_sort_file_cache=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_disable_sort_file_cache=2;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_disable_sort_file_cache=-3;
+select @@global.innodb_disable_sort_file_cache;
+select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
+select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_disable_sort_file_cache='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_disable_sort_file_cache = @start_global_value;
+SELECT @@global.innodb_disable_sort_file_cache;
diff --git a/mysql-test/suite/sys_vars/t/innodb_doublewrite_batch_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_doublewrite_batch_size_basic.test
new file mode 100644
index 00000000000..ccdab532737
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_doublewrite_batch_size_basic.test
@@ -0,0 +1,22 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+#
+# exists as global only
+#
+select @@global.innodb_doublewrite_batch_size between 1 and 127;
+select @@global.innodb_doublewrite_batch_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_doublewrite_batch_size;
+show global variables like 'innodb_doublewrite_batch_size';
+show session variables like 'innodb_doublewrite_batch_size';
+select * from information_schema.global_variables where variable_name='innodb_doublewrite_batch_size';
+select * from information_schema.session_variables where variable_name='innodb_doublewrite_batch_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_doublewrite_batch_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set @@session.innodb_doublewrite_batch_size='some';
diff --git a/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt b/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt
new file mode 100644
index 00000000000..c788dc76ac7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt
@@ -0,0 +1 @@
+--loose-innodb-buffer-pool-size=20M
diff --git a/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.test b/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.test
new file mode 100644
index 00000000000..6bb34f36a4f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.test
@@ -0,0 +1,30 @@
+--source include/have_xtradb.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_empty_free_list_algorithm;
+
+# Default value
+SELECT @@GLOBAL.innodb_empty_free_list_algorithm;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_empty_free_list_algorithm;
+
+# Correct values
+SET GLOBAL innodb_empty_free_list_algorithm='legacy';
+SELECT @@GLOBAL.innodb_empty_free_list_algorithm;
+SET GLOBAL innodb_empty_free_list_algorithm='backoff';
+SELECT @@GLOBAL.innodb_empty_free_list_algorithm;
+
+# Incorrect values
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_empty_free_list_algorithm=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_empty_free_list_algorithm=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_empty_free_list_algorithm=2;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_empty_free_list_algorithm='foo';
+
+SET GLOBAL innodb_empty_free_list_algorithm = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_fil_make_page_dirty_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_fil_make_page_dirty_debug_basic.test
new file mode 100644
index 00000000000..950dbabd1bd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_fil_make_page_dirty_debug_basic.test
@@ -0,0 +1,34 @@
+--echo #
+--echo # Basic test for innodb_fil_make_page_dirty_debug.
+--echo #
+
+--source include/have_innodb.inc
+
+# The config variable is a debug variable
+-- source include/have_debug.inc
+
+SELECT @@global.innodb_fil_make_page_dirty_debug;
+
+set global innodb_fil_make_page_dirty_debug = 0;
+
+SELECT @@global.innodb_fil_make_page_dirty_debug;
+
+set global innodb_fil_make_page_dirty_debug = 0;
+
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_fil_make_page_dirty_debug = dummy;
+
+--error ER_GLOBAL_VARIABLE
+set innodb_fil_make_page_dirty_debug = ON;
+
+--echo # An example usage.
+create table t1 (f1 int primary key) engine = innodb;
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+drop table t1;
+
+--echo # Must always be 0.
+SELECT @@global.innodb_fil_make_page_dirty_debug;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_flush_log_at_timeout_basic.test b/mysql-test/suite/sys_vars/t/innodb_flush_log_at_timeout_basic.test
new file mode 100644
index 00000000000..0ab079adaa8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_log_at_timeout_basic.test
@@ -0,0 +1,151 @@
+################# mysql-test\t\innodb_flush_log_at_timeout_basic.test #########
+# #
+# Variable Name: innodb_flush_log_at_timeout #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: Numeric #
+# Default Value: 1 #
+# Range: 0-2700 #
+# #
+# #
+# Creation Date: 2012-05-10 #
+# Author: Nuno Carvalho #
+# #
+#Description: Test Cases of Dynamic System Variable #
+# innodb_flush_log_at_timeout that checks the 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-system-variables.html #
+# #
+###############################################################################
+
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+########################################################################
+# START OF innodb_flush_log_at_timeout TESTS #
+########################################################################
+
+
+#############################################################################
+# Saving initial value of innodb_flush_log_at_timeout #
+#############################################################################
+
+
+SET @global_start_value = @@global.innodb_flush_log_at_timeout;
+SELECT @global_start_value;
+
+
+
+--echo '#--------------------FN_DYNVARS_046_01------------------------#'
+##########################################################################
+# Display the DEFAULT value of innodb_flush_log_at_timeout #
+##########################################################################
+
+SET @@global.innodb_flush_log_at_timeout = 0;
+SET @@global.innodb_flush_log_at_timeout = DEFAULT;
+SELECT @@global.innodb_flush_log_at_timeout;
+
+--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
+###############################################################################
+# Check if variable can be accessed with and without @@ sign #
+###############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET innodb_flush_log_at_timeout = 1;
+SELECT @@innodb_flush_log_at_timeout;
+
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.innodb_flush_log_at_timeout;
+
+
+SET global innodb_flush_log_at_timeout = 0;
+SELECT @@global.innodb_flush_log_at_timeout;
+
+
+--echo '#--------------------FN_DYNVARS_046_03------------------------#'
+#############################################################################
+# change the value of innodb_flush_log_at_timeout to a valid value #
+#############################################################################
+
+
+SET @@global.innodb_flush_log_at_timeout = 0;
+SELECT @@global.innodb_flush_log_at_timeout;
+
+SET @@global.innodb_flush_log_at_timeout = 10;
+SELECT @@global.innodb_flush_log_at_timeout;
+SET @@global.innodb_flush_log_at_timeout = 2700;
+SELECT @@global.innodb_flush_log_at_timeout;
+
+--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
+###############################################################################
+# Change the value of innodb_flush_log_at_timeout to invalid value #
+###############################################################################
+
+SET @@global.innodb_flush_log_at_timeout = -1;
+SELECT @@global.innodb_flush_log_at_timeout;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flush_log_at_timeout = "T";
+SELECT @@global.innodb_flush_log_at_timeout;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flush_log_at_timeout = "Y";
+SELECT @@global.innodb_flush_log_at_timeout;
+
+SET @@global.innodb_flush_log_at_timeout = 2701;
+SELECT @@global.innodb_flush_log_at_timeout;
+
+--echo '#----------------------FN_DYNVARS_046_05------------------------#'
+#########################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#########################################################################
+
+SELECT @@global.innodb_flush_log_at_timeout =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_flush_log_at_timeout';
+SELECT @@global.innodb_flush_log_at_timeout;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_flush_log_at_timeout';
+
+--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+###################################################################
+# Check if ON and OFF values can be used on variable #
+###################################################################
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flush_log_at_timeout = OFF;
+SELECT @@global.innodb_flush_log_at_timeout;
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flush_log_at_timeout = ON;
+SELECT @@global.innodb_flush_log_at_timeout;
+
+--echo '#---------------------FN_DYNVARS_046_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+
+SET @@global.innodb_flush_log_at_timeout = TRUE;
+SELECT @@global.innodb_flush_log_at_timeout;
+SET @@global.innodb_flush_log_at_timeout = FALSE;
+SELECT @@global.innodb_flush_log_at_timeout;
+
+##############################
+# Restore initial value #
+##############################
+
+
+SET @@global.innodb_flush_log_at_timeout = @global_start_value;
+SELECT @@global.innodb_flush_log_at_timeout;
+
+###############################################################
+# END OF innodb_flush_log_at_timeout TESTS #
+###############################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_flush_neighbors_basic.test b/mysql-test/suite/sys_vars/t/innodb_flush_neighbors_basic.test
new file mode 100644
index 00000000000..698e30b6669
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_neighbors_basic.test
@@ -0,0 +1,73 @@
+
+
+# 2011-02-23 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_flush_neighbors;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.innodb_flush_neighbors;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_flush_neighbors;
+show global variables like 'innodb_flush_neighbors';
+show session variables like 'innodb_flush_neighbors';
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+
+#
+# show that it's writable
+#
+set global innodb_flush_neighbors=0;
+select @@global.innodb_flush_neighbors;
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+set @@global.innodb_flush_neighbors=TRUE;
+select @@global.innodb_flush_neighbors;
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+set global innodb_flush_neighbors=0;
+select @@global.innodb_flush_neighbors;
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+set @@global.innodb_flush_neighbors=2;
+select @@global.innodb_flush_neighbors;
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+set @@global.innodb_flush_neighbors=DEFAULT;
+select @@global.innodb_flush_neighbors;
+select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
+select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+--error ER_GLOBAL_VARIABLE
+set session innodb_flush_neighbors=0;
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_flush_neighbors=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_flush_neighbors='OFF';
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_flush_neighbors='ON';
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_flush_neighbors=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_flush_neighbors=1e1;
+set global innodb_flush_neighbors=3;
+select @@global.innodb_flush_neighbors;
+set global innodb_flush_neighbors=-3;
+select @@global.innodb_flush_neighbors;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_flush_neighbors='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_flush_neighbors = @start_global_value;
+SELECT @@global.innodb_flush_neighbors;
diff --git a/mysql-test/suite/sys_vars/t/innodb_flushing_avg_loops_basic.test b/mysql-test/suite/sys_vars/t/innodb_flushing_avg_loops_basic.test
new file mode 100644
index 00000000000..a84e623f2c3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_flushing_avg_loops_basic.test
@@ -0,0 +1,143 @@
+############ mysql-test\t\innodb_flushing_avg_loops_basic.test ################
+# #
+# Variable Name: innodb_flushing_avg_loops #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: Numeric #
+# Default Value: 10 #
+# Range: 0-70 #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author: Rizwan #
+# #
+#Description:Test Cases of Dynamic System Variable innodb_flushing_avg_loops #
+# that checks the 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-system-variables.html #
+# #
+###############################################################################
+
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+########################################################################
+# START OF innodb_flushing_avg_loops TESTS #
+########################################################################
+
+
+###############################################################################
+#Saving initial value of innodb_flushing_avg_loops in a temporary variable #
+###############################################################################
+
+SET @global_start_value = @@global.innodb_flushing_avg_loops;
+SELECT @global_start_value;
+
+--echo '#--------------------FN_DYNVARS_046_01------------------------#'
+########################################################################
+# Display the DEFAULT value of innodb_flushing_avg_loops #
+########################################################################
+
+SET @@global.innodb_flushing_avg_loops = 1;
+SET @@global.innodb_flushing_avg_loops = DEFAULT;
+SELECT @@global.innodb_flushing_avg_loops;
+
+--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
+##################################################################################
+# Check if innodb_flushing_avg_loops can be accessed with and without @@ sign #
+##################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET innodb_flushing_avg_loops = 1;
+SELECT @@innodb_flushing_avg_loops;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.innodb_flushing_avg_loops;
+
+SET global innodb_flushing_avg_loops = 1;
+SELECT @@global.innodb_flushing_avg_loops;
+
+--echo '#--------------------FN_DYNVARS_046_03------------------------#'
+###############################################################################
+# change the value of innodb_flushing_avg_loops to a valid value #
+###############################################################################
+
+SET @@global.innodb_flushing_avg_loops = 1;
+SELECT @@global.innodb_flushing_avg_loops;
+
+SET @@global.innodb_flushing_avg_loops = 60;
+SELECT @@global.innodb_flushing_avg_loops;
+
+SET @@global.innodb_flushing_avg_loops = 1000;
+SELECT @@global.innodb_flushing_avg_loops;
+
+--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
+###########################################################################
+# Change the value of innodb_flushing_avg_loops to invalid value #
+###########################################################################
+
+SET @@global.innodb_flushing_avg_loops = -1;
+SELECT @@global.innodb_flushing_avg_loops;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flushing_avg_loops = "T";
+SELECT @@global.innodb_flushing_avg_loops;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flushing_avg_loops = "Y";
+SELECT @@global.innodb_flushing_avg_loops;
+
+SET @@global.innodb_flushing_avg_loops = 1001;
+SELECT @@global.innodb_flushing_avg_loops;
+
+--echo '#----------------------FN_DYNVARS_046_05------------------------#'
+#########################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#########################################################################
+
+SELECT @@global.innodb_flushing_avg_loops =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_flushing_avg_loops';
+SELECT @@global.innodb_flushing_avg_loops;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_flushing_avg_loops';
+
+--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+###################################################################
+# Check if ON and OFF values can be used on variable #
+###################################################################
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flushing_avg_loops = OFF;
+SELECT @@global.innodb_flushing_avg_loops;
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flushing_avg_loops = ON;
+SELECT @@global.innodb_flushing_avg_loops;
+
+--echo '#---------------------FN_DYNVARS_046_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+
+SET @@global.innodb_flushing_avg_loops = TRUE;
+SELECT @@global.innodb_flushing_avg_loops;
+SET @@global.innodb_flushing_avg_loops = FALSE;
+SELECT @@global.innodb_flushing_avg_loops;
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.innodb_flushing_avg_loops = @global_start_value;
+SELECT @@global.innodb_flushing_avg_loops;
+
+###############################################################
+# END OF innodb_flushing_avg_loops TESTS #
+###############################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_foreground_preflush_basic.test b/mysql-test/suite/sys_vars/t/innodb_foreground_preflush_basic.test
new file mode 100644
index 00000000000..f388b392f9b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_foreground_preflush_basic.test
@@ -0,0 +1,30 @@
+--source include/have_xtradb.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_foreground_preflush;
+
+# Default value
+SELECT @@GLOBAL.innodb_foreground_preflush;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_foreground_preflush;
+
+# Correct values
+SET GLOBAL innodb_foreground_preflush='sync_preflush';
+SELECT @@GLOBAL.innodb_foreground_preflush;
+SET GLOBAL innodb_foreground_preflush='exponential_backoff';
+SELECT @@GLOBAL.innodb_foreground_preflush;
+
+# Incorrect values
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_foreground_preflush=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_foreground_preflush=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_foreground_preflush=2;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_foreground_preflush='foo';
+
+SET GLOBAL innodb_foreground_preflush = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_aux_table_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_aux_table_basic.test
new file mode 100644
index 00000000000..2ea99cf9835
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_aux_table_basic.test
@@ -0,0 +1,41 @@
+
+
+# 2011-11-15 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_ft_aux_table;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_ft_aux_table;
+show global variables like 'innodb_ft_aux_table';
+show session variables like 'innodb_ft_aux_table';
+select * from information_schema.global_variables where variable_name='innodb_ft_aux_table';
+select * from information_schema.session_variables where variable_name='innodb_ft_aux_table';
+
+--error ER_GLOBAL_VARIABLE
+set session innodb_ft_aux_table='Salmon';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_ft_aux_table='Salmon';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_aux_table=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_aux_table=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_ft_aux_table='Salmon';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_ft_aux_table = @start_global_value;
+SELECT @@global.innodb_ft_aux_table;
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_cache_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_cache_size_basic.test
new file mode 100644
index 00000000000..f6d62835f0a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_cache_size_basic.test
@@ -0,0 +1,26 @@
+
+#
+# 2011-11-17 - Added
+#
+
+--source include/have_innodb.inc
+
+#
+# show the global and session values;
+#
+select @@global.innodb_ft_cache_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_ft_cache_size;
+show global variables like 'innodb_ft_cache_size';
+show session variables like 'innodb_ft_cache_size';
+select * from information_schema.global_variables where variable_name='innodb_ft_cache_size';
+select * from information_schema.session_variables where variable_name='innodb_ft_cache_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_ft_cache_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session innodb_ft_cache_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_enable_diag_print_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_enable_diag_print_basic.test
new file mode 100644
index 00000000000..ebe9cc556ec
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_enable_diag_print_basic.test
@@ -0,0 +1,70 @@
+
+
+# 2011-11-15 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_ft_enable_diag_print;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_ft_enable_diag_print in (0, 1);
+select @@global.innodb_ft_enable_diag_print;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_ft_enable_diag_print;
+show global variables like 'innodb_ft_enable_diag_print';
+show session variables like 'innodb_ft_enable_diag_print';
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+
+#
+# show that it's writable
+#
+set global innodb_ft_enable_diag_print='OFF';
+select @@global.innodb_ft_enable_diag_print;
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+set @@global.innodb_ft_enable_diag_print=1;
+select @@global.innodb_ft_enable_diag_print;
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+set global innodb_ft_enable_diag_print=0;
+select @@global.innodb_ft_enable_diag_print;
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+set @@global.innodb_ft_enable_diag_print='ON';
+select @@global.innodb_ft_enable_diag_print;
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+--error ER_GLOBAL_VARIABLE
+set session innodb_ft_enable_diag_print='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_ft_enable_diag_print='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_enable_diag_print=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_enable_diag_print=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_ft_enable_diag_print=2;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_ft_enable_diag_print=-3;
+select @@global.innodb_ft_enable_diag_print;
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_ft_enable_diag_print='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_ft_enable_diag_print = @start_global_value;
+SELECT @@global.innodb_ft_enable_diag_print;
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_enable_stopword_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_enable_stopword_basic.test
new file mode 100644
index 00000000000..1a983a3d7e6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_enable_stopword_basic.test
@@ -0,0 +1,85 @@
+
+
+# 2011-11-15 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_ft_enable_stopword;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_ft_enable_stopword in (0, 1);
+select @@global.innodb_ft_enable_stopword;
+select @@session.innodb_ft_enable_stopword in (0, 1);
+select @@session.innodb_ft_enable_stopword;
+show global variables like 'innodb_ft_enable_stopword';
+show session variables like 'innodb_ft_enable_stopword';
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+
+#
+# show that it's writable
+#
+set global innodb_ft_enable_stopword='OFF';
+set session innodb_ft_enable_stopword='OFF';
+select @@global.innodb_ft_enable_stopword;
+select @@session.innodb_ft_enable_stopword;
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+set @@global.innodb_ft_enable_stopword=1;
+set @@session.innodb_ft_enable_stopword=1;
+select @@global.innodb_ft_enable_stopword;
+select @@session.innodb_ft_enable_stopword;
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+set global innodb_ft_enable_stopword=0;
+set session innodb_ft_enable_stopword=0;
+select @@global.innodb_ft_enable_stopword;
+select @@session.innodb_ft_enable_stopword;
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+set @@global.innodb_ft_enable_stopword='ON';
+set @@session.innodb_ft_enable_stopword='ON';
+select @@global.innodb_ft_enable_stopword;
+select @@session.innodb_ft_enable_stopword;
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_enable_stopword=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session innodb_ft_enable_stopword=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_enable_stopword=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set session innodb_ft_enable_stopword=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_ft_enable_stopword=2;
+--error ER_WRONG_VALUE_FOR_VAR
+set session innodb_ft_enable_stopword=2;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_ft_enable_stopword='AUTO';
+--error ER_WRONG_VALUE_FOR_VAR
+set session innodb_ft_enable_stopword='AUTO';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_ft_enable_stopword=-3;
+--error ER_WRONG_VALUE_FOR_VAR
+set session innodb_ft_enable_stopword=-7;
+select @@global.innodb_ft_enable_stopword;
+select @@session.innodb_ft_enable_stopword;
+select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
+select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_ft_enable_stopword = @start_global_value;
+SELECT @@global.innodb_ft_enable_stopword;
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_max_token_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_max_token_size_basic.test
new file mode 100644
index 00000000000..e75517466d7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_max_token_size_basic.test
@@ -0,0 +1,26 @@
+
+#
+# 2011-11-17 - Added
+#
+
+--source include/have_innodb.inc
+
+#
+# show the global and session values;
+#
+select @@global.innodb_ft_max_token_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_ft_max_token_size;
+show global variables like 'innodb_ft_max_token_size';
+show session variables like 'innodb_ft_max_token_size';
+select * from information_schema.global_variables where variable_name='innodb_ft_max_token_size';
+select * from information_schema.session_variables where variable_name='innodb_ft_max_token_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_ft_max_token_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session innodb_ft_max_token_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_min_token_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_min_token_size_basic.test
new file mode 100644
index 00000000000..edf63c70782
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_min_token_size_basic.test
@@ -0,0 +1,26 @@
+
+#
+# 2011-11-17 - Added
+#
+
+--source include/have_innodb.inc
+
+#
+# show the global and session values;
+#
+select @@global.innodb_ft_min_token_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_ft_min_token_size;
+show global variables like 'innodb_ft_min_token_size';
+show session variables like 'innodb_ft_min_token_size';
+select * from information_schema.global_variables where variable_name='innodb_ft_min_token_size';
+select * from information_schema.session_variables where variable_name='innodb_ft_min_token_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_ft_min_token_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session innodb_ft_min_token_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_num_word_optimize_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_num_word_optimize_basic.test
new file mode 100644
index 00000000000..255caf86116
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_num_word_optimize_basic.test
@@ -0,0 +1,52 @@
+
+#
+# 2011-11-17 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_ft_num_word_optimize;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are zero or above
+select @@global.innodb_ft_num_word_optimize >=1000;
+select @@global.innodb_ft_num_word_optimize;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_ft_num_word_optimize;
+show global variables like 'innodb_ft_num_word_optimize';
+show session variables like 'innodb_ft_num_word_optimize';
+select * from information_schema.global_variables where variable_name='innodb_ft_num_word_optimize';
+select * from information_schema.session_variables where variable_name='innodb_ft_num_word_optimize';
+
+#
+# show that it's writable
+#
+set global innodb_ft_num_word_optimize=1000;
+select @@global.innodb_ft_num_word_optimize;
+select * from information_schema.global_variables where variable_name='innodb_ft_num_word_optimize';
+select * from information_schema.session_variables where variable_name='innodb_ft_num_word_optimize';
+--error ER_GLOBAL_VARIABLE
+set session innodb_ft_num_word_optimize=1000;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_num_word_optimize=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_num_word_optimize=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_num_word_optimize="foo";
+
+set global innodb_ft_num_word_optimize=-7;
+select @@global.innodb_ft_num_word_optimize;
+select * from information_schema.global_variables where variable_name='innodb_ft_num_word_optimize';
+
+#
+# cleanup
+#
+SET @@global.innodb_ft_num_word_optimize = @start_global_value;
+SELECT @@global.innodb_ft_num_word_optimize;
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test
new file mode 100644
index 00000000000..245ed4abdfb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_result_cache_limit_basic.test
@@ -0,0 +1,38 @@
+
+#
+# 2013-05-09 - Added
+#
+
+--source include/have_innodb.inc
+
+if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in InnoDB 5.6.10 or earlier
+}
+
+#
+# show the global and session values;
+#
+select @@global.innodb_ft_result_cache_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_ft_result_cache_limit;
+show global variables like 'innodb_ft_result_cache_limit';
+show session variables like 'innodb_ft_result_cache_limit';
+select * from information_schema.global_variables where variable_name='innodb_ft_result_cache_limit';
+select * from information_schema.session_variables where variable_name='innodb_ft_result_cache_limit';
+
+#
+# test default, min, max value
+#
+let $innodb_ft_result_cache_limit_orig=`select @@innodb_ft_result_cache_limit`;
+
+set global innodb_ft_result_cache_limit=900000;
+select @@innodb_ft_result_cache_limit;
+
+set global innodb_ft_result_cache_limit=1000000;
+select @@innodb_ft_result_cache_limit;
+
+set global innodb_ft_result_cache_limit=4000000000;
+select @@innodb_ft_result_cache_limit;
+
+eval set global innodb_ft_result_cache_limit=$innodb_ft_result_cache_limit_orig;
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_server_stopword_table_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_server_stopword_table_basic.test
new file mode 100644
index 00000000000..e227e790a1d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_server_stopword_table_basic.test
@@ -0,0 +1,41 @@
+
+
+# 2011-11-15 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_ft_server_stopword_table;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_ft_server_stopword_table;
+show global variables like 'innodb_ft_server_stopword_table';
+show session variables like 'innodb_ft_server_stopword_table';
+select * from information_schema.global_variables where variable_name='innodb_ft_server_stopword_table';
+select * from information_schema.session_variables where variable_name='innodb_ft_server_stopword_table';
+
+--error ER_GLOBAL_VARIABLE
+set session innodb_ft_server_stopword_table='Salmon';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_ft_server_stopword_table='Salmon';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_server_stopword_table=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_server_stopword_table=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_ft_server_stopword_table='Salmon';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_ft_server_stopword_table = @start_global_value;
+SELECT @@global.innodb_ft_server_stopword_table;
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_sort_pll_degree_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_sort_pll_degree_basic.test
new file mode 100644
index 00000000000..3cf55f6700b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_sort_pll_degree_basic.test
@@ -0,0 +1,26 @@
+
+#
+# 2011-11-17 - Added
+#
+
+--source include/have_innodb.inc
+
+#
+# show the global and session values;
+#
+select @@global.innodb_ft_sort_pll_degree;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_ft_sort_pll_degree;
+show global variables like 'innodb_ft_sort_pll_degree';
+show session variables like 'innodb_ft_sort_pll_degree';
+select * from information_schema.global_variables where variable_name='innodb_ft_sort_pll_degree';
+select * from information_schema.session_variables where variable_name='innodb_ft_sort_pll_degree';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_ft_sort_pll_degree=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session innodb_ft_sort_pll_degree=1;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_total_cache_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_total_cache_size_basic.test
new file mode 100644
index 00000000000..772ec5a1919
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_total_cache_size_basic.test
@@ -0,0 +1,27 @@
+--source include/have_innodb.inc
+
+if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in InnoDB 5.6.10 or earlier
+}
+
+#
+# show the global and session values;
+#
+select @@global.innodb_ft_total_cache_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_ft_total_cache_size;
+show global variables like 'innodb_ft_total_cache_size';
+show session variables like 'innodb_ft_total_cache_size';
+select * from information_schema.global_variables where variable_name='innodb_ft_total_cache_size';
+select * from information_schema.session_variables where variable_name='innodb_ft_total_cache_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_ft_total_cache_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session innodb_ft_total_cache_size=1;
+
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_ft_user_stopword_table_basic.test b/mysql-test/suite/sys_vars/t/innodb_ft_user_stopword_table_basic.test
new file mode 100644
index 00000000000..159e570b3ce
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_ft_user_stopword_table_basic.test
@@ -0,0 +1,38 @@
+
+
+# 2011-11-15 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_ft_user_stopword_table;
+SELECT @start_global_value;
+
+#
+# exists as session as well
+#
+select @@session.innodb_ft_user_stopword_table;
+
+show global variables like 'innodb_ft_user_stopword_table';
+show session variables like 'innodb_ft_user_stopword_table';
+
+select * from information_schema.global_variables where variable_name='innodb_ft_user_stopword_table';
+select * from information_schema.session_variables where variable_name='innodb_ft_user_stopword_table';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set session innodb_ft_user_stopword_table='Salmon';
+
+--error ER_WRONG_VALUE_FOR_VAR
+set @@session.innodb_ft_user_stopword_table='Salmon';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_user_stopword_table=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_ft_user_stopword_table=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_ft_user_stopword_table='Salmon';
+
+SET @@session.innodb_ft_user_stopword_table=@start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_io_capacity_max_basic.test b/mysql-test/suite/sys_vars/t/innodb_io_capacity_max_basic.test
new file mode 100644
index 00000000000..cedc6c0c45e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_io_capacity_max_basic.test
@@ -0,0 +1,85 @@
+
+
+# 2012-04-02 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_innodb_max_capacity = @@global.innodb_io_capacity_max;
+SELECT @start_innodb_max_capacity;
+
+SET @start_innodb_capacity = @@global.innodb_io_capacity;
+SELECT @start_innodb_capacity;
+
+#
+# exists as global only
+#
+--echo Valid value 100 or more
+select @@global.innodb_io_capacity_max > 99;
+select @@global.innodb_io_capacity_max;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_io_capacity_max;
+show global variables like 'innodb_io_capacity_max';
+show session variables like 'innodb_io_capacity_max';
+select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
+select * from information_schema.session_variables where variable_name='innodb_io_capacity_max';
+
+#
+# show that it's writable.
+#
+set global innodb_io_capacity_max=@start_innodb_capacity + 1;
+select @@global.innodb_io_capacity_max;
+select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
+select * from information_schema.session_variables where variable_name='innodb_io_capacity_max';
+--error ER_GLOBAL_VARIABLE
+set session innodb_io_capacity_max=444;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_io_capacity_max=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_io_capacity_max=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_io_capacity_max="foo";
+
+#
+# Setting io_capacity_max lower than io_capacity affects also io_capacity
+#
+set global innodb_io_capacity_max=1000;
+set global innodb_io_capacity=500;
+set global innodb_io_capacity_max=400;
+select @@global.innodb_io_capacity_max;
+select @@global.innodb_io_capacity;
+select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
+select * from information_schema.global_variables where variable_name='innodb_io_capacity';
+
+#
+# Setting io_capacity higher than io_capacity_max affects also io_capacity_max
+#
+set global innodb_io_capacity_max=1000;
+set global innodb_io_capacity=500;
+set global innodb_io_capacity=1400;
+select @@global.innodb_io_capacity_max;
+select @@global.innodb_io_capacity;
+select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
+select * from information_schema.global_variables where variable_name='innodb_io_capacity';
+#
+# min/max values
+#
+# first set innodb_io_cpaacity lower
+set global innodb_io_capacity=100;
+set global innodb_io_capacity_max=100;
+select @@global.innodb_io_capacity_max;
+
+#
+# cleanup
+#
+
+SET @@global.innodb_io_capacity_max = @start_innodb_max_capacity;
+SELECT @@global.innodb_io_capacity_max;
+
+SET @@global.innodb_io_capacity = @start_innodb_capacity;
+SELECT @@global.innodb_io_capacity;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_arch_dir_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_arch_dir_basic.test
new file mode 100644
index 00000000000..084d97fa460
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_log_arch_dir_basic.test
@@ -0,0 +1,68 @@
+#######################################################
+# Basic test for innodb_log_arch_dir variable #
+#######################################################
+
+--source include/have_xtradb.inc
+
+let $datadir= `select @@datadir`;
+
+####################################################################
+# Displaying default value #
+####################################################################
+--replace_result $datadir ./
+SELECT @@GLOBAL.innodb_log_arch_dir;
+--echo NULL Expected
+
+
+####################################################################
+# Check if Value can set #
+####################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_log_arch_dir=1;
+--echo Expected error 'Read only variable'
+
+--replace_result $datadir ./
+SELECT @@GLOBAL.innodb_log_arch_dir;
+--echo NULL Expected
+
+--replace_result $datadir ./
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_log_arch_dir';
+--echo empty string Expected
+
+############################################
+# Check accessing variable without GLOBAL #
+############################################
+--replace_result $datadir ./
+SELECT @@innodb_log_arch_dir;
+--echo NULL Expected
+
+
+
+##########################################################################
+# Check if innodb_log_arch_dir can be accessed without @@ sign #
+##########################################################################
+
+--replace_result $datadir ./
+SELECT @@innodb_log_arch_dir;
+--echo NULL Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@local.innodb_log_arch_dir;
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_log_arch_dir;
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--replace_result $datadir ./
+SELECT @@GLOBAL.innodb_log_arch_dir;
+--echo NULL Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_log_arch_dir = @@SESSION.innodb_log_arch_dir;
+--echo Expected error Unknown column 'innodb_log_arch_dir' in 'field list'
+
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_arch_expire_sec_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_arch_expire_sec_basic.test
new file mode 100644
index 00000000000..87c374ea886
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_log_arch_expire_sec_basic.test
@@ -0,0 +1,60 @@
+###############################################################
+# Basic test for innodb_log_arch_expire_sec variable #
+###############################################################
+
+--source include/have_xtradb.inc
+
+SELECT @@GLOBAL.innodb_log_arch_expire_sec INTO @save;
+
+####################################################################
+# Displaying default value #
+####################################################################
+SELECT @@GLOBAL.innodb_log_arch_expire_sec;
+--echo 0 Expected
+
+
+####################################################################
+# Check if Value can set #
+####################################################################
+
+SET @@GLOBAL.innodb_log_arch_expire_sec=1;
+
+SELECT @@GLOBAL.innodb_log_arch_expire_sec;
+--echo 1 Expected
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_log_arch_expire_sec';
+--echo 1 Expected
+
+############################################
+# Check accessing variable without GLOBAL #
+############################################
+SELECT @@innodb_log_arch_expire_sec;
+--echo 1 Expected
+
+
+
+##################################################################################
+# Check if innodb_log_arch_expire_sec can be accessed without @@ sign #
+##################################################################################
+
+SELECT @@innodb_log_arch_expire_sec;
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@local.innodb_log_arch_expire_sec;
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_log_arch_expire_sec;
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT @@GLOBAL.innodb_log_arch_expire_sec;
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_log_arch_expire_sec = @@SESSION.innodb_log_arch_expire_sec;
+--echo Expected error Unknown column 'innodb_log_arch_expire_sec' in 'field list'
+
+SET @@GLOBAL.innodb_log_arch_expire_sec = @save;
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_archive_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_archive_basic.test
new file mode 100644
index 00000000000..cbc885123ce
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_log_archive_basic.test
@@ -0,0 +1,61 @@
+###################################################
+# Basic test for innodb_log_archive variable #
+###################################################
+
+--source include/have_xtradb.inc
+
+####################################################################
+# Displaying default value #
+####################################################################
+SELECT @@GLOBAL.innodb_log_archive;
+--echo 0 Expected
+
+
+####################################################################
+# Check if Value can set #
+####################################################################
+
+SET @save_innodb_log_archive = @@GLOBAL.innodb_log_archive;
+SET @@GLOBAL.innodb_log_archive=1;
+
+SELECT @@GLOBAL.innodb_log_archive;
+--echo 1 Expected
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_log_archive';
+--echo ON Expected
+
+SET @@GLOBAL.innodb_log_archive = @save_innodb_log_archive;
+
+############################################
+# Check accessing variable without GLOBAL #
+############################################
+SELECT @@innodb_log_archive;
+--echo 0 Expected
+
+
+
+##########################################################################
+# Check if innodb_log_archive can be accessed without @@ sign #
+##########################################################################
+
+SELECT @@innodb_log_archive;
+--echo 0 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@local.innodb_log_archive;
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_log_archive;
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT @@GLOBAL.innodb_log_archive;
+--echo 0 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_log_archive = @@SESSION.innodb_log_archive;
+--echo Expected error Unknown column 'innodb_log_archive' in 'field list'
+
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_checksum_algorithm_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_checksum_algorithm_basic.test
new file mode 100644
index 00000000000..1a83d4f2602
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_log_checksum_algorithm_basic.test
@@ -0,0 +1,38 @@
+--source include/have_xtradb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_log_checksum_algorithm;
+SELECT @orig;
+
+SET GLOBAL innodb_log_checksum_algorithm = 'crc32';
+SELECT @@global.innodb_log_checksum_algorithm;
+
+SET GLOBAL innodb_log_checksum_algorithm = 'strict_crc32';
+SELECT @@global.innodb_log_checksum_algorithm;
+
+SET GLOBAL innodb_log_checksum_algorithm = 'innodb';
+SELECT @@global.innodb_log_checksum_algorithm;
+
+SET GLOBAL innodb_log_checksum_algorithm = 'strict_innodb';
+SELECT @@global.innodb_log_checksum_algorithm;
+
+SET GLOBAL innodb_log_checksum_algorithm = 'none';
+SELECT @@global.innodb_log_checksum_algorithm;
+
+SET GLOBAL innodb_log_checksum_algorithm = 'strict_none';
+SELECT @@global.innodb_log_checksum_algorithm;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_log_checksum_algorithm = '';
+SELECT @@global.innodb_log_checksum_algorithm;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_log_checksum_algorithm = 'foobar';
+SELECT @@global.innodb_log_checksum_algorithm;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_log_checksum_algorithm = 123;
+SELECT @@global.innodb_log_checksum_algorithm;
+
+SET GLOBAL innodb_log_checksum_algorithm = @orig;
+SELECT @@global.innodb_log_checksum_algorithm;
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_compressed_pages_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_compressed_pages_basic.test
new file mode 100644
index 00000000000..8d10309ae02
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_log_compressed_pages_basic.test
@@ -0,0 +1,93 @@
+--source include/have_innodb.inc
+
+if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in InnoDB 5.6.10 or earlier
+}
+
+SET @start_global_value = @@global.innodb_log_compressed_pages;
+SELECT @start_global_value;
+
+
+--echo '#---------------------BS_STVARS_028_01----------------------#'
+####################################################################
+# Displaying default value #
+####################################################################
+SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages);
+--echo 1 Expected
+
+
+--echo '#---------------------BS_STVARS_028_02----------------------#'
+####################################################################
+# Check if Value can set #
+####################################################################
+
+SET @@global.innodb_log_compressed_pages = 0;
+SELECT @@global.innodb_log_compressed_pages;
+
+SET @@global.innodb_log_compressed_pages ='On' ;
+SELECT @@global.innodb_log_compressed_pages;
+
+SET @@global.innodb_log_compressed_pages ='Off' ;
+SELECT @@global.innodb_log_compressed_pages;
+
+SET @@global.innodb_log_compressed_pages = 1;
+SELECT @@global.innodb_log_compressed_pages;
+
+--echo '#---------------------BS_STVARS_028_03----------------------#'
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#################################################################
+
+SELECT IF(@@GLOBAL.innodb_log_compressed_pages,'ON','OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_log_compressed_pages';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_log_compressed_pages';
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_028_04----------------------#'
+################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+################################################################################
+SELECT @@innodb_log_compressed_pages = @@GLOBAL.innodb_log_compressed_pages;
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_028_05----------------------#'
+################################################################################
+# Check if innodb_log_compressed_pages can be accessed with and without @@ sign#
+################################################################################
+
+SELECT COUNT(@@innodb_log_compressed_pages);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_log_compressed_pages);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_log_compressed_pages);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_log_compressed_pages = @@SESSION.innodb_log_compressed_pages;
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_log_compressed_pages = @start_global_value;
+SELECT @@global.innodb_log_compressed_pages;
diff --git a/mysql-test/suite/sys_vars/t/innodb_lru_scan_depth_basic.test b/mysql-test/suite/sys_vars/t/innodb_lru_scan_depth_basic.test
new file mode 100644
index 00000000000..12211308410
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_lru_scan_depth_basic.test
@@ -0,0 +1,58 @@
+
+
+# 2011-02-23 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_lru_scan_depth;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid value 100 or more
+select @@global.innodb_lru_scan_depth >= 100;
+select @@global.innodb_lru_scan_depth;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_lru_scan_depth;
+show global variables like 'innodb_lru_scan_depth';
+show session variables like 'innodb_lru_scan_depth';
+select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
+select * from information_schema.session_variables where variable_name='innodb_lru_scan_depth';
+
+#
+# show that it's writable
+#
+set global innodb_lru_scan_depth=325;
+select @@global.innodb_lru_scan_depth;
+select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
+select * from information_schema.session_variables where variable_name='innodb_lru_scan_depth';
+--error ER_GLOBAL_VARIABLE
+set session innodb_lru_scan_depth=444;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_lru_scan_depth=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_lru_scan_depth=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_lru_scan_depth="foo";
+
+set global innodb_lru_scan_depth=7;
+select @@global.innodb_lru_scan_depth;
+select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
+set global innodb_lru_scan_depth=-7;
+select @@global.innodb_lru_scan_depth;
+select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
+
+#
+# min/max values
+#
+set global innodb_lru_scan_depth=100;
+select @@global.innodb_lru_scan_depth;
+
+SET @@global.innodb_lru_scan_depth = @start_global_value;
+SELECT @@global.innodb_lru_scan_depth;
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
index 7e70ed11351..5b4eaa41598 100644
--- a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_basic.test
@@ -44,7 +44,7 @@ SELECT @global_start_value;
########################################################################
SET @@global.innodb_max_dirty_pages_pct = 0;
-SET @@global.innodb_max_dirty_pages_pct = DEFAULT;
+SET @@global.innodb_max_dirty_pages_pct = @global_start_value;
SELECT @@global.innodb_max_dirty_pages_pct;
--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_lwm_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_lwm_basic.test
new file mode 100644
index 00000000000..d81b6cc725b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_lwm_basic.test
@@ -0,0 +1,151 @@
+############# mysql-test\t\innodb_max_dirty_pages_pct_lwm_basic.test ##########
+# #
+# Variable Name: innodb_max_dirty_pages_pct_lwm #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: Numeric #
+# Default Value: 75 #
+# Range: 0-99 #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author: Rizwan #
+# #
+#Description: Test Cases of Dynamic System Variable #
+# innodb_max_dirty_pages_pct_lwm that checks the 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-system-variables.html #
+# #
+###############################################################################
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+######################################################################
+# START OF innodb_max_dirty_pages_pct_lwm TESTS #
+######################################################################
+
+
+#################################################################################
+#Saving initial value of innodb_max_dirty_pages_pct_lwm in a temporary variable #
+#################################################################################
+
+SET @pct_lwm_start_value = @@global.innodb_max_dirty_pages_pct_lwm;
+SELECT @pct_lwm_start_value;
+
+SET @pct_start_value = @@global.innodb_max_dirty_pages_pct;
+SELECT @pct_start_value;
+
+--echo '#--------------------FN_DYNVARS_046_01------------------------#'
+########################################################################
+# Display the DEFAULT value of innodb_max_dirty_pages_pct_lwm #
+########################################################################
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = 0;
+SET @@global.innodb_max_dirty_pages_pct_lwm = @pct_lwm_start_value;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
+###################################################################################
+#check if innodb_max_dirty_pages_pct_lwm can be accessed with and without @@ sign #
+###################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET innodb_max_dirty_pages_pct_lwm = 1;
+SELECT @@innodb_max_dirty_pages_pct_lwm;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.innodb_max_dirty_pages_pct_lwm;
+
+SET global innodb_max_dirty_pages_pct_lwm = 0;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+--echo '#--------------------FN_DYNVARS_046_03------------------------#'
+##########################################################################
+# change the value of innodb_max_dirty_pages_pct_lwm to a valid value #
+# Aloowed values are <= innodb_max_dirty_pages_pct value #
+##########################################################################
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = 0;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = @pct_start_value;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
+###########################################################################
+# Change the value of innodb_max_dirty_pages_pct_lwm to invalid value #
+###########################################################################
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = -1;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_dirty_pages_pct_lwm = "T";
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_dirty_pages_pct_lwm = "Y";
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = @pct_start_value + 1;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = 100;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+
+
+--echo '#----------------------FN_DYNVARS_046_05------------------------#'
+#########################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#########################################################################
+
+SELECT @@global.innodb_max_dirty_pages_pct_lwm =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct_lwm';
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct_lwm';
+
+--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+###################################################################
+# Check if ON and OFF values can be used on variable #
+###################################################################
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_dirty_pages_pct_lwm = OFF;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_dirty_pages_pct_lwm = ON;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+--echo '#---------------------FN_DYNVARS_046_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = TRUE;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+SET @@global.innodb_max_dirty_pages_pct_lwm = FALSE;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.innodb_max_dirty_pages_pct = @pct_start_value;
+SELECT @@global.innodb_max_dirty_pages_pct;
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = @pct_lwm_start_value;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+###############################################################
+# END OF innodb_max_dirty_pages_pct_lwm TESTS #
+###############################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test
new file mode 100644
index 00000000000..6374e3716df
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test
@@ -0,0 +1,43 @@
+# Variable Name: innodb_max_purge_lag_delay
+# Scope: Global #
+# Access Type: Static #
+# Data Type: numeric #
+
+--source include/have_innodb.inc
+
+SELECT @@GLOBAL.innodb_max_purge_lag_delay;
+--echo 0 Expected
+
+SET @@GLOBAL.innodb_max_purge_lag_delay=1;
+
+SELECT COUNT(@@GLOBAL.innodb_max_purge_lag_delay);
+--echo 1 Expected
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_purge_lag_delay';
+--echo 1 Expected
+
+SELECT @@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay;
+--echo 1 Expected
+
+SELECT COUNT(@@innodb_max_purge_lag_delay);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_max_purge_lag_delay);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_max_purge_lag_delay);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_max_purge_lag_delay = @@SESSION.innodb_max_purge_lag_delay;
+
+set global innodb_max_purge_lag_delay = -1;
+set global innodb_max_purge_lag_delay = 1000000;
+set global innodb_max_purge_lag_delay = 10000000;
+set global innodb_max_purge_lag_delay = 100000000;
+set global innodb_max_purge_lag_delay = 100000001;
+set global innodb_max_purge_lag_delay = 0;
diff --git a/mysql-test/suite/sys_vars/t/innodb_merge_sort_block_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_merge_sort_block_size_basic.test
deleted file mode 100644
index 2ec4870f345..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_merge_sort_block_size_basic.test
+++ /dev/null
@@ -1,19 +0,0 @@
---source include/have_xtradb.inc
-
-SELECT @@global.innodb_merge_sort_block_size;
-SELECT @@session.innodb_merge_sort_block_size;
-
-SET @old_global=@@global.innodb_merge_sort_block_size;
-SET @old_session=@@session.innodb_merge_sort_block_size;
-
-SET @@global.innodb_merge_sort_block_size = 2*1024*1024;
-SET @@session.innodb_merge_sort_block_size = 4*1024*1024;
-
-SELECT @@global.innodb_merge_sort_block_size;
-SELECT @@session.innodb_merge_sort_block_size;
-
-SET @@global.innodb_merge_sort_block_size = 1024*1024*1024+1;
-SELECT @@global.innodb_merge_sort_block_size;
-
-SET @@global.innodb_merge_sort_block_size=@old_global;
-SET @@session.innodb_merge_sort_block_size=@old_session;
diff --git a/mysql-test/suite/sys_vars/t/innodb_monitor_disable_basic.test b/mysql-test/suite/sys_vars/t/innodb_monitor_disable_basic.test
new file mode 100644
index 00000000000..0615d62a0e1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_monitor_disable_basic.test
@@ -0,0 +1,383 @@
+# This is the test for Metrics Monitor Table feature.
+# Test the metrics monitor system's control system
+# and counter accuracy.
+
+if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in InnoDB 5.6.10 or earlier
+}
+
+--source include/have_innodb.inc
+set global innodb_monitor_disable = All;
+# Test turn on/off the monitor counter with "all" option
+# By default, they will be off
+select name, status from information_schema.innodb_metrics;
+
+# Turn on all monitor counters
+set global innodb_monitor_enable = all;
+
+# status should all change to "enabled"
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Test wrong argument to the global configure option
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable = aaa;
+
+# We require a valid monitor counter/module name. There is no default
+# counter name or module. A warning will be printed asking user to
+# specify a valid counter name.
+#--disable_warnings
+#set global innodb_monitor_enable = default;
+#--enable_warnings
+
+# Turn off all monitor counters, option name should be case
+# insensitive
+set global innodb_monitor_disable = All;
+
+# status should all change to "disabled"
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# Reset all counter values
+set global innodb_monitor_reset_all = all;
+
+# count should all change to 0
+select name from information_schema.innodb_metrics where count!=0;
+
+# Test wildcard match, turn on all counters contain string "lock"
+set global innodb_monitor_enable = "%lock%";
+
+# All lock related counter should be enabled
+select name from information_schema.innodb_metrics
+where status != IF(name like "%lock%", 'enabled', 'disabled');
+
+# Disable them
+set global innodb_monitor_disable = "%lock%";
+
+# All lock related counter should be disabled
+select name, status from information_schema.innodb_metrics
+where name like "%lock%";
+
+# No match for "%lock*"
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable = "%lock*";
+
+# All counters will be turned on with wildcard match string with all "%"
+set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
+
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Turn off all counters
+set global innodb_monitor_disable="%%%%%";
+
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# One more round testing. All counters will be turned on with
+# single wildcard character "%"
+set global innodb_monitor_enable="%";
+
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Turn off all the counters with "%_%"
+set global innodb_monitor_disable="%_%";
+
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# Turn on all counters start with "log"
+set global innodb_monitor_enable="log%%%%";
+
+select name from information_schema.innodb_metrics
+where status != IF(name like "log%", 'enabled', 'disabled');
+
+# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
+# is single character wildcard match word
+set global innodb_monitor_enable="os_%a_fs_ncs";
+
+# Turn on counters whose name contains "os" and "pending" with
+# wildcard match "os%pending%"
+set global innodb_monitor_enable="os%pending%";
+
+select name, status from information_schema.innodb_metrics
+where name like "os%";
+
+# Empty string is an invalid option
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable="";
+
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable="_";
+
+SET global innodb_monitor_disable = module_metadata;
+SET global innodb_monitor_reset_all = module_metadata;
+
+# Only turn on "table_open" counter
+set global innodb_monitor_enable = metadata_table_handles_opened;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+# This will open the monitor_test table
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment by 1
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Reset the counter value while counter is still on (started)
+# This will reset value "count_reset" but not
+# "count"
+set global innodb_monitor_reset = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# re-create table again to increment "metadata_table_handles_opened" again
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Cannot reset all monitor value while the counter is on
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Turn off the counter "metadata_table_handles_opened"
+set global innodb_monitor_disable = metadata_table_handles_opened;
+
+# Reset the counter value while counter is off (disabled)
+set global innodb_monitor_reset = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# re-create table again. Since monitor is off, "metadata_table_handles_opened"
+# should not be incremented
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+# "metadata_table_handles_opened" should increment
+select * from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Reset all the counters, include those counter *_since_start
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Turn on "table_open" counter again
+set global innodb_monitor_enable = metadata_table_handles_opened;
+
+# Test metadata_table_handles_opened again to see if it is working correctly
+# after above round of turning on/off/reset
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb stats_persistent=0;
+
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Test counter "metadata_table_handles_closed",
+# create index will close the old handle
+set global innodb_monitor_enable = metadata_table_handles_closed;
+
+create index idx on monitor_test(col);
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_closed";
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+# Reset counters only in "module_metadata" module
+set global innodb_monitor_disable = module_metadata;
+
+set global innodb_monitor_reset = module_metadata;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+set global innodb_monitor_reset_all = module_metadata;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+# Test Transaction Module
+set global innodb_monitor_enable = module_trx;
+
+begin;
+insert into monitor_test values(9);
+commit;
+
+begin;
+insert into monitor_test values(9);
+rollback;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "trx_rollbacks" or name like "trx_active_transactions";
+
+set global innodb_monitor_disable = module_trx;
+
+# Test DML Module
+set global innodb_monitor_enable = module_dml;
+
+insert into monitor_test values(9);
+
+update monitor_test set col = 10 where col = 9;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+delete from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+ from information_schema.innodb_metrics
+ where name like "dml%";
+
+# test reset counter while the counter is on
+set global innodb_monitor_reset = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# insert/delete some rows after the reset
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+
+delete from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# We do not allow reset_all while the counter is on, nothing
+# should be reset here
+set global innodb_monitor_reset_all = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Turn off the counter
+set global innodb_monitor_disable = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Reset all counter values
+set global innodb_monitor_reset_all = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Open individual counter "dml_inserts"
+set global innodb_monitor_enable = dml_inserts;
+
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+
+delete from monitor_test;
+
+# Only counter "dml_inserts" should be updated
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+set global innodb_monitor_disable = module_dml;
+
+drop table monitor_test;
+
+set global innodb_monitor_enable = file_num_open_files;
+
+# Counters are unpredictable when innodb-file-per-table is on
+--replace_column 2 # 3 # 4 # 5 # 6 # 7 #
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "file_num_open_files";
+
+set global innodb_monitor_disable = file_num_open_files;
+
+# Test ICP module counters
+set global innodb_monitor_enable = "icp%";
+
+create table monitor_test(a char(3), b int, c char(2),
+primary key (a(1), c(1)), key(b)) engine = innodb;
+
+insert into monitor_test values("13", 2, "aa");
+
+select a from monitor_test where b < 1 for update;
+
+# should have icp_attempts = 1 and icp_out_of_range = 1
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+
+# should have icp_attempts = 2 and icp_match = 1
+select a from monitor_test where b < 3 for update;
+
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+
+drop table monitor_test;
+set global innodb_monitor_disable = All;
+set global innodb_monitor_reset_all = all;
+
+-- disable_warnings
+set global innodb_monitor_enable = default;
+set global innodb_monitor_disable = default;
+set global innodb_monitor_reset = default;
+set global innodb_monitor_reset_all = default;
+-- enable_warnings
diff --git a/mysql-test/suite/sys_vars/t/innodb_monitor_enable_basic.test b/mysql-test/suite/sys_vars/t/innodb_monitor_enable_basic.test
new file mode 100644
index 00000000000..0615d62a0e1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_monitor_enable_basic.test
@@ -0,0 +1,383 @@
+# This is the test for Metrics Monitor Table feature.
+# Test the metrics monitor system's control system
+# and counter accuracy.
+
+if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in InnoDB 5.6.10 or earlier
+}
+
+--source include/have_innodb.inc
+set global innodb_monitor_disable = All;
+# Test turn on/off the monitor counter with "all" option
+# By default, they will be off
+select name, status from information_schema.innodb_metrics;
+
+# Turn on all monitor counters
+set global innodb_monitor_enable = all;
+
+# status should all change to "enabled"
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Test wrong argument to the global configure option
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable = aaa;
+
+# We require a valid monitor counter/module name. There is no default
+# counter name or module. A warning will be printed asking user to
+# specify a valid counter name.
+#--disable_warnings
+#set global innodb_monitor_enable = default;
+#--enable_warnings
+
+# Turn off all monitor counters, option name should be case
+# insensitive
+set global innodb_monitor_disable = All;
+
+# status should all change to "disabled"
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# Reset all counter values
+set global innodb_monitor_reset_all = all;
+
+# count should all change to 0
+select name from information_schema.innodb_metrics where count!=0;
+
+# Test wildcard match, turn on all counters contain string "lock"
+set global innodb_monitor_enable = "%lock%";
+
+# All lock related counter should be enabled
+select name from information_schema.innodb_metrics
+where status != IF(name like "%lock%", 'enabled', 'disabled');
+
+# Disable them
+set global innodb_monitor_disable = "%lock%";
+
+# All lock related counter should be disabled
+select name, status from information_schema.innodb_metrics
+where name like "%lock%";
+
+# No match for "%lock*"
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable = "%lock*";
+
+# All counters will be turned on with wildcard match string with all "%"
+set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
+
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Turn off all counters
+set global innodb_monitor_disable="%%%%%";
+
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# One more round testing. All counters will be turned on with
+# single wildcard character "%"
+set global innodb_monitor_enable="%";
+
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Turn off all the counters with "%_%"
+set global innodb_monitor_disable="%_%";
+
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# Turn on all counters start with "log"
+set global innodb_monitor_enable="log%%%%";
+
+select name from information_schema.innodb_metrics
+where status != IF(name like "log%", 'enabled', 'disabled');
+
+# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
+# is single character wildcard match word
+set global innodb_monitor_enable="os_%a_fs_ncs";
+
+# Turn on counters whose name contains "os" and "pending" with
+# wildcard match "os%pending%"
+set global innodb_monitor_enable="os%pending%";
+
+select name, status from information_schema.innodb_metrics
+where name like "os%";
+
+# Empty string is an invalid option
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable="";
+
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable="_";
+
+SET global innodb_monitor_disable = module_metadata;
+SET global innodb_monitor_reset_all = module_metadata;
+
+# Only turn on "table_open" counter
+set global innodb_monitor_enable = metadata_table_handles_opened;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+# This will open the monitor_test table
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment by 1
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Reset the counter value while counter is still on (started)
+# This will reset value "count_reset" but not
+# "count"
+set global innodb_monitor_reset = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# re-create table again to increment "metadata_table_handles_opened" again
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Cannot reset all monitor value while the counter is on
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Turn off the counter "metadata_table_handles_opened"
+set global innodb_monitor_disable = metadata_table_handles_opened;
+
+# Reset the counter value while counter is off (disabled)
+set global innodb_monitor_reset = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# re-create table again. Since monitor is off, "metadata_table_handles_opened"
+# should not be incremented
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+# "metadata_table_handles_opened" should increment
+select * from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Reset all the counters, include those counter *_since_start
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Turn on "table_open" counter again
+set global innodb_monitor_enable = metadata_table_handles_opened;
+
+# Test metadata_table_handles_opened again to see if it is working correctly
+# after above round of turning on/off/reset
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb stats_persistent=0;
+
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Test counter "metadata_table_handles_closed",
+# create index will close the old handle
+set global innodb_monitor_enable = metadata_table_handles_closed;
+
+create index idx on monitor_test(col);
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_closed";
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+# Reset counters only in "module_metadata" module
+set global innodb_monitor_disable = module_metadata;
+
+set global innodb_monitor_reset = module_metadata;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+set global innodb_monitor_reset_all = module_metadata;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+# Test Transaction Module
+set global innodb_monitor_enable = module_trx;
+
+begin;
+insert into monitor_test values(9);
+commit;
+
+begin;
+insert into monitor_test values(9);
+rollback;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "trx_rollbacks" or name like "trx_active_transactions";
+
+set global innodb_monitor_disable = module_trx;
+
+# Test DML Module
+set global innodb_monitor_enable = module_dml;
+
+insert into monitor_test values(9);
+
+update monitor_test set col = 10 where col = 9;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+delete from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+ from information_schema.innodb_metrics
+ where name like "dml%";
+
+# test reset counter while the counter is on
+set global innodb_monitor_reset = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# insert/delete some rows after the reset
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+
+delete from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# We do not allow reset_all while the counter is on, nothing
+# should be reset here
+set global innodb_monitor_reset_all = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Turn off the counter
+set global innodb_monitor_disable = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Reset all counter values
+set global innodb_monitor_reset_all = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Open individual counter "dml_inserts"
+set global innodb_monitor_enable = dml_inserts;
+
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+
+delete from monitor_test;
+
+# Only counter "dml_inserts" should be updated
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+set global innodb_monitor_disable = module_dml;
+
+drop table monitor_test;
+
+set global innodb_monitor_enable = file_num_open_files;
+
+# Counters are unpredictable when innodb-file-per-table is on
+--replace_column 2 # 3 # 4 # 5 # 6 # 7 #
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "file_num_open_files";
+
+set global innodb_monitor_disable = file_num_open_files;
+
+# Test ICP module counters
+set global innodb_monitor_enable = "icp%";
+
+create table monitor_test(a char(3), b int, c char(2),
+primary key (a(1), c(1)), key(b)) engine = innodb;
+
+insert into monitor_test values("13", 2, "aa");
+
+select a from monitor_test where b < 1 for update;
+
+# should have icp_attempts = 1 and icp_out_of_range = 1
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+
+# should have icp_attempts = 2 and icp_match = 1
+select a from monitor_test where b < 3 for update;
+
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+
+drop table monitor_test;
+set global innodb_monitor_disable = All;
+set global innodb_monitor_reset_all = all;
+
+-- disable_warnings
+set global innodb_monitor_enable = default;
+set global innodb_monitor_disable = default;
+set global innodb_monitor_reset = default;
+set global innodb_monitor_reset_all = default;
+-- enable_warnings
diff --git a/mysql-test/suite/sys_vars/t/innodb_monitor_reset_all_basic.test b/mysql-test/suite/sys_vars/t/innodb_monitor_reset_all_basic.test
new file mode 100644
index 00000000000..868f69300fa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_monitor_reset_all_basic.test
@@ -0,0 +1,383 @@
+# This is the test for Metrics Monitor Table feature.
+# Test the metrics monitor system's control system
+# and counter accuracy.
+
+if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip not fixed in innodb 5.6.10 or earlier
+}
+
+--source include/have_innodb.inc
+set global innodb_monitor_disable = All;
+# Test turn on/off the monitor counter with "all" option
+# By default, they will be off
+select name, status from information_schema.innodb_metrics;
+
+# Turn on all monitor counters
+set global innodb_monitor_enable = all;
+
+# status should all change to "enabled"
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Test wrong argument to the global configure option
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable = aaa;
+
+# We require a valid monitor counter/module name. There is no default
+# counter name or module. A warning will be printed asking user to
+# specify a valid counter name.
+#--disable_warnings
+#set global innodb_monitor_enable = default;
+#--enable_warnings
+
+# Turn off all monitor counters, option name should be case
+# insensitive
+set global innodb_monitor_disable = All;
+
+# status should all change to "disabled"
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# Reset all counter values
+set global innodb_monitor_reset_all = all;
+
+# count should all change to 0
+select name from information_schema.innodb_metrics where count!=0;
+
+# Test wildcard match, turn on all counters contain string "lock"
+set global innodb_monitor_enable = "%lock%";
+
+# All lock related counter should be enabled
+select name from information_schema.innodb_metrics
+where status != IF(name like "%lock%", 'enabled', 'disabled');
+
+# Disable them
+set global innodb_monitor_disable = "%lock%";
+
+# All lock related counter should be disabled
+select name, status from information_schema.innodb_metrics
+where name like "%lock%";
+
+# No match for "%lock*"
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable = "%lock*";
+
+# All counters will be turned on with wildcard match string with all "%"
+set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
+
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Turn off all counters
+set global innodb_monitor_disable="%%%%%";
+
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# One more round testing. All counters will be turned on with
+# single wildcard character "%"
+set global innodb_monitor_enable="%";
+
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Turn off all the counters with "%_%"
+set global innodb_monitor_disable="%_%";
+
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# Turn on all counters start with "log"
+set global innodb_monitor_enable="log%%%%";
+
+select name from information_schema.innodb_metrics
+where status != IF(name like "log%", 'enabled', 'disabled');
+
+# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
+# is single character wildcard match word
+set global innodb_monitor_enable="os_%a_fs_ncs";
+
+# Turn on counters whose name contains "os" and "pending" with
+# wildcard match "os%pending%"
+set global innodb_monitor_enable="os%pending%";
+
+select name, status from information_schema.innodb_metrics
+where name like "os%";
+
+# Empty string is an invalid option
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable="";
+
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable="_";
+
+SET global innodb_monitor_disable = module_metadata;
+SET global innodb_monitor_reset_all = module_metadata;
+
+# Only turn on "table_open" counter
+set global innodb_monitor_enable = metadata_table_handles_opened;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+# This will open the monitor_test table
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment by 1
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Reset the counter value while counter is still on (started)
+# This will reset value "count_reset" but not
+# "count"
+set global innodb_monitor_reset = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# re-create table again to increment "metadata_table_handles_opened" again
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Cannot reset all monitor value while the counter is on
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Turn off the counter "metadata_table_handles_opened"
+set global innodb_monitor_disable = metadata_table_handles_opened;
+
+# Reset the counter value while counter is off (disabled)
+set global innodb_monitor_reset = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# re-create table again. Since monitor is off, "metadata_table_handles_opened"
+# should not be incremented
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+# "metadata_table_handles_opened" should increment
+select * from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Reset all the counters, include those counter *_since_start
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Turn on "table_open" counter again
+set global innodb_monitor_enable = metadata_table_handles_opened;
+
+# Test metadata_table_handles_opened again to see if it is working correctly
+# after above round of turning on/off/reset
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb stats_persistent=0;
+
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Test counter "metadata_table_handles_closed",
+# create index will close the old handle
+set global innodb_monitor_enable = metadata_table_handles_closed;
+
+create index idx on monitor_test(col);
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_closed";
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+# Reset counters only in "module_metadata" module
+set global innodb_monitor_disable = module_metadata;
+
+set global innodb_monitor_reset = module_metadata;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+set global innodb_monitor_reset_all = module_metadata;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+# Test Transaction Module
+set global innodb_monitor_enable = module_trx;
+
+begin;
+insert into monitor_test values(9);
+commit;
+
+begin;
+insert into monitor_test values(9);
+rollback;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "trx_rollbacks" or name like "trx_active_transactions";
+
+set global innodb_monitor_disable = module_trx;
+
+# Test DML Module
+set global innodb_monitor_enable = module_dml;
+
+insert into monitor_test values(9);
+
+update monitor_test set col = 10 where col = 9;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+delete from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+ from information_schema.innodb_metrics
+ where name like "dml%";
+
+# test reset counter while the counter is on
+set global innodb_monitor_reset = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# insert/delete some rows after the reset
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+
+delete from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# We do not allow reset_all while the counter is on, nothing
+# should be reset here
+set global innodb_monitor_reset_all = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Turn off the counter
+set global innodb_monitor_disable = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Reset all counter values
+set global innodb_monitor_reset_all = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Open individual counter "dml_inserts"
+set global innodb_monitor_enable = dml_inserts;
+
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+
+delete from monitor_test;
+
+# Only counter "dml_inserts" should be updated
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+set global innodb_monitor_disable = module_dml;
+
+drop table monitor_test;
+
+set global innodb_monitor_enable = file_num_open_files;
+
+# Counters are unpredictable when innodb-file-per-table is on
+--replace_column 2 # 3 # 4 # 5 # 6 # 7 #
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "file_num_open_files";
+
+set global innodb_monitor_disable = file_num_open_files;
+
+# Test ICP module counters
+set global innodb_monitor_enable = "icp%";
+
+create table monitor_test(a char(3), b int, c char(2),
+primary key (a(1), c(1)), key(b)) engine = innodb;
+
+insert into monitor_test values("13", 2, "aa");
+
+select a from monitor_test where b < 1 for update;
+
+# should have icp_attempts = 1 and icp_out_of_range = 1
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+
+# should have icp_attempts = 2 and icp_match = 1
+select a from monitor_test where b < 3 for update;
+
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+
+drop table monitor_test;
+set global innodb_monitor_disable = All;
+set global innodb_monitor_reset_all = all;
+
+-- disable_warnings
+set global innodb_monitor_enable = default;
+set global innodb_monitor_disable = default;
+set global innodb_monitor_reset = default;
+set global innodb_monitor_reset_all = default;
+-- enable_warnings
diff --git a/mysql-test/suite/sys_vars/t/innodb_monitor_reset_basic.test b/mysql-test/suite/sys_vars/t/innodb_monitor_reset_basic.test
new file mode 100644
index 00000000000..868f69300fa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_monitor_reset_basic.test
@@ -0,0 +1,383 @@
+# This is the test for Metrics Monitor Table feature.
+# Test the metrics monitor system's control system
+# and counter accuracy.
+
+if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip not fixed in innodb 5.6.10 or earlier
+}
+
+--source include/have_innodb.inc
+set global innodb_monitor_disable = All;
+# Test turn on/off the monitor counter with "all" option
+# By default, they will be off
+select name, status from information_schema.innodb_metrics;
+
+# Turn on all monitor counters
+set global innodb_monitor_enable = all;
+
+# status should all change to "enabled"
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Test wrong argument to the global configure option
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable = aaa;
+
+# We require a valid monitor counter/module name. There is no default
+# counter name or module. A warning will be printed asking user to
+# specify a valid counter name.
+#--disable_warnings
+#set global innodb_monitor_enable = default;
+#--enable_warnings
+
+# Turn off all monitor counters, option name should be case
+# insensitive
+set global innodb_monitor_disable = All;
+
+# status should all change to "disabled"
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# Reset all counter values
+set global innodb_monitor_reset_all = all;
+
+# count should all change to 0
+select name from information_schema.innodb_metrics where count!=0;
+
+# Test wildcard match, turn on all counters contain string "lock"
+set global innodb_monitor_enable = "%lock%";
+
+# All lock related counter should be enabled
+select name from information_schema.innodb_metrics
+where status != IF(name like "%lock%", 'enabled', 'disabled');
+
+# Disable them
+set global innodb_monitor_disable = "%lock%";
+
+# All lock related counter should be disabled
+select name, status from information_schema.innodb_metrics
+where name like "%lock%";
+
+# No match for "%lock*"
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable = "%lock*";
+
+# All counters will be turned on with wildcard match string with all "%"
+set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
+
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Turn off all counters
+set global innodb_monitor_disable="%%%%%";
+
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# One more round testing. All counters will be turned on with
+# single wildcard character "%"
+set global innodb_monitor_enable="%";
+
+select name from information_schema.innodb_metrics where status!='enabled';
+
+# Turn off all the counters with "%_%"
+set global innodb_monitor_disable="%_%";
+
+select name from information_schema.innodb_metrics where status!='disabled';
+
+# Turn on all counters start with "log"
+set global innodb_monitor_enable="log%%%%";
+
+select name from information_schema.innodb_metrics
+where status != IF(name like "log%", 'enabled', 'disabled');
+
+# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
+# is single character wildcard match word
+set global innodb_monitor_enable="os_%a_fs_ncs";
+
+# Turn on counters whose name contains "os" and "pending" with
+# wildcard match "os%pending%"
+set global innodb_monitor_enable="os%pending%";
+
+select name, status from information_schema.innodb_metrics
+where name like "os%";
+
+# Empty string is an invalid option
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable="";
+
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_monitor_enable="_";
+
+SET global innodb_monitor_disable = module_metadata;
+SET global innodb_monitor_reset_all = module_metadata;
+
+# Only turn on "table_open" counter
+set global innodb_monitor_enable = metadata_table_handles_opened;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+# This will open the monitor_test table
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment by 1
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Reset the counter value while counter is still on (started)
+# This will reset value "count_reset" but not
+# "count"
+set global innodb_monitor_reset = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# re-create table again to increment "metadata_table_handles_opened" again
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Cannot reset all monitor value while the counter is on
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Turn off the counter "metadata_table_handles_opened"
+set global innodb_monitor_disable = metadata_table_handles_opened;
+
+# Reset the counter value while counter is off (disabled)
+set global innodb_monitor_reset = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# re-create table again. Since monitor is off, "metadata_table_handles_opened"
+# should not be incremented
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb;
+
+# "metadata_table_handles_opened" should increment
+select * from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Reset all the counters, include those counter *_since_start
+set global innodb_monitor_reset_all = metadata_table_handles_opened;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Turn on "table_open" counter again
+set global innodb_monitor_enable = metadata_table_handles_opened;
+
+# Test metadata_table_handles_opened again to see if it is working correctly
+# after above round of turning on/off/reset
+drop table monitor_test;
+
+# Create a new table to test "metadata_table_handles_opened" counter
+create table monitor_test(col int) engine = innodb stats_persistent=0;
+
+select * from monitor_test;
+
+# "metadata_table_handles_opened" should increment
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_opened";
+
+# Test counter "metadata_table_handles_closed",
+# create index will close the old handle
+set global innodb_monitor_enable = metadata_table_handles_closed;
+
+create index idx on monitor_test(col);
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name = "metadata_table_handles_closed";
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+# Reset counters only in "module_metadata" module
+set global innodb_monitor_disable = module_metadata;
+
+set global innodb_monitor_reset = module_metadata;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+set global innodb_monitor_reset_all = module_metadata;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "metadata%";
+
+# Test Transaction Module
+set global innodb_monitor_enable = module_trx;
+
+begin;
+insert into monitor_test values(9);
+commit;
+
+begin;
+insert into monitor_test values(9);
+rollback;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "trx_rollbacks" or name like "trx_active_transactions";
+
+set global innodb_monitor_disable = module_trx;
+
+# Test DML Module
+set global innodb_monitor_enable = module_dml;
+
+insert into monitor_test values(9);
+
+update monitor_test set col = 10 where col = 9;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+delete from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+ from information_schema.innodb_metrics
+ where name like "dml%";
+
+# test reset counter while the counter is on
+set global innodb_monitor_reset = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# insert/delete some rows after the reset
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+
+delete from monitor_test;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# We do not allow reset_all while the counter is on, nothing
+# should be reset here
+set global innodb_monitor_reset_all = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Turn off the counter
+set global innodb_monitor_disable = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Reset all counter values
+set global innodb_monitor_reset_all = module_dml;
+
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+# Open individual counter "dml_inserts"
+set global innodb_monitor_enable = dml_inserts;
+
+insert into monitor_test values(9);
+insert into monitor_test values(1);
+
+delete from monitor_test;
+
+# Only counter "dml_inserts" should be updated
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "dml%";
+
+set global innodb_monitor_disable = module_dml;
+
+drop table monitor_test;
+
+set global innodb_monitor_enable = file_num_open_files;
+
+# Counters are unpredictable when innodb-file-per-table is on
+--replace_column 2 # 3 # 4 # 5 # 6 # 7 #
+select name, max_count, min_count, count,
+ max_count_reset, min_count_reset, count_reset, status
+from information_schema.innodb_metrics
+where name like "file_num_open_files";
+
+set global innodb_monitor_disable = file_num_open_files;
+
+# Test ICP module counters
+set global innodb_monitor_enable = "icp%";
+
+create table monitor_test(a char(3), b int, c char(2),
+primary key (a(1), c(1)), key(b)) engine = innodb;
+
+insert into monitor_test values("13", 2, "aa");
+
+select a from monitor_test where b < 1 for update;
+
+# should have icp_attempts = 1 and icp_out_of_range = 1
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+
+# should have icp_attempts = 2 and icp_match = 1
+select a from monitor_test where b < 3 for update;
+
+select name, count from information_schema.innodb_metrics
+where name like "icp%";
+
+drop table monitor_test;
+set global innodb_monitor_disable = All;
+set global innodb_monitor_reset_all = all;
+
+-- disable_warnings
+set global innodb_monitor_enable = default;
+set global innodb_monitor_disable = default;
+set global innodb_monitor_reset = default;
+set global innodb_monitor_reset_all = default;
+-- enable_warnings
diff --git a/mysql-test/suite/sys_vars/t/innodb_online_alter_log_max_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_online_alter_log_max_size_basic.test
new file mode 100644
index 00000000000..aa1cc83819e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_online_alter_log_max_size_basic.test
@@ -0,0 +1,51 @@
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_online_alter_log_max_size;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.innodb_online_alter_log_max_size >= 524288;
+select @@global.innodb_online_alter_log_max_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_online_alter_log_max_size;
+show global variables like 'innodb_online_alter_log_max_size';
+show session variables like 'innodb_online_alter_log_max_size';
+select * from information_schema.global_variables where variable_name='innodb_online_alter_log_max_size';
+select * from information_schema.session_variables where variable_name='innodb_online_alter_log_max_size';
+
+#
+# show that it's writable
+#
+set global innodb_online_alter_log_max_size=1048576;
+select @@global.innodb_online_alter_log_max_size;
+select * from information_schema.global_variables where variable_name='innodb_online_alter_log_max_size';
+select * from information_schema.session_variables where variable_name='innodb_online_alter_log_max_size';
+set @@global.innodb_online_alter_log_max_size=524288;
+select @@global.innodb_online_alter_log_max_size;
+select * from information_schema.global_variables where variable_name='innodb_online_alter_log_max_size';
+select * from information_schema.session_variables where variable_name='innodb_online_alter_log_max_size';
+--error ER_GLOBAL_VARIABLE
+set session innodb_online_alter_log_max_size='some';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_online_alter_log_max_size='some';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_online_alter_log_max_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_online_alter_log_max_size='foo';
+set global innodb_online_alter_log_max_size=-2;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_online_alter_log_max_size=1e1;
+set global innodb_online_alter_log_max_size=2;
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_online_alter_log_max_size = @start_global_value;
+SELECT @@global.innodb_online_alter_log_max_size;
diff --git a/mysql-test/suite/sys_vars/t/innodb_optimize_fulltext_only_basic.test b/mysql-test/suite/sys_vars/t/innodb_optimize_fulltext_only_basic.test
new file mode 100644
index 00000000000..e9ff8a651bc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_optimize_fulltext_only_basic.test
@@ -0,0 +1,70 @@
+
+
+# 2011-11-16 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_optimize_fulltext_only;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_optimize_fulltext_only in (0, 1);
+select @@global.innodb_optimize_fulltext_only;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_optimize_fulltext_only;
+show global variables like 'innodb_optimize_fulltext_only';
+show session variables like 'innodb_optimize_fulltext_only';
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+
+#
+# show that it's writable
+#
+set global innodb_optimize_fulltext_only='ON';
+select @@global.innodb_optimize_fulltext_only;
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+set @@global.innodb_optimize_fulltext_only=0;
+select @@global.innodb_optimize_fulltext_only;
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+set global innodb_optimize_fulltext_only=1;
+select @@global.innodb_optimize_fulltext_only;
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+set @@global.innodb_optimize_fulltext_only='OFF';
+select @@global.innodb_optimize_fulltext_only;
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+--error ER_GLOBAL_VARIABLE
+set session innodb_optimize_fulltext_only='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_optimize_fulltext_only='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_optimize_fulltext_only=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_optimize_fulltext_only=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_optimize_fulltext_only=2;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_optimize_fulltext_only=-3;
+select @@global.innodb_optimize_fulltext_only;
+select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
+select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_optimize_fulltext_only='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_optimize_fulltext_only = @start_global_value;
+SELECT @@global.innodb_optimize_fulltext_only;
diff --git a/mysql-test/suite/sys_vars/t/innodb_page_hash_locks_basic.test b/mysql-test/suite/sys_vars/t/innodb_page_hash_locks_basic.test
new file mode 100644
index 00000000000..1479cbad744
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_page_hash_locks_basic.test
@@ -0,0 +1,22 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+#
+# exists as global only
+#
+select @@global.innodb_page_hash_locks between 1 and 1024;
+select @@global.innodb_page_hash_locks;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_page_hash_locks;
+show global variables like 'innodb_page_hash_locks';
+show session variables like 'innodb_page_hash_locks';
+select * from information_schema.global_variables where variable_name='innodb_page_hash_locks';
+select * from information_schema.session_variables where variable_name='innodb_page_hash_locks';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_page_hash_locks=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set @@session.innodb_page_hash_locks='some';
diff --git a/mysql-test/suite/sys_vars/t/innodb_persistent_stats_root_page_basic.test b/mysql-test/suite/sys_vars/t/innodb_persistent_stats_root_page_basic.test
deleted file mode 100644
index 2e216e10521..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_persistent_stats_root_page_basic.test
+++ /dev/null
@@ -1,26 +0,0 @@
---source include/have_debug.inc
---source include/have_xtradb.inc
-
-SELECT @@global.innodb_persistent_stats_root_page;
-SELECT COUNT(@@global.innodb_persistent_stats_root_page);
-
-# Read-only variable
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@global.innodb_persistent_stats_root_page=100;
-
-# Check if INFORMATION_SCHEMA agrees with the var
-SELECT @@global.innodb_persistent_stats_root_page = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_persistent_stats_root_page';
-
-SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_persistent_stats_root_page';
-
-# Check if accessing the var without GLOBAL points to the same
-SELECT @@innodb_persistent_stats_root_page = @@global.innodb_persistent_stats_root_page;
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.innodb_persistent_stats_root_page);
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@session.innodb_persistent_stats_root_page);
diff --git a/mysql-test/suite/sys_vars/t/innodb_print_all_deadlocks_basic.test b/mysql-test/suite/sys_vars/t/innodb_print_all_deadlocks_basic.test
index 5ad0ae485e0..4cbd7062108 100644
--- a/mysql-test/suite/sys_vars/t/innodb_print_all_deadlocks_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_print_all_deadlocks_basic.test
@@ -1,48 +1,81 @@
-#
-# innodb_print_all_deadlocks
-#
-
--- source include/have_innodb.inc
-
-SELECT @@innodb_print_all_deadlocks;
-
-SET GLOBAL innodb_print_all_deadlocks=1;
-CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB;
-INSERT INTO t1 VALUES (123);
-
-CREATE TABLE t2 (c2 INT, PRIMARY KEY (c2)) ENGINE=INNODB;
-INSERT INTO t2 VALUES (456);
-
--- connect (con1,localhost,root,,)
--- connect (con2,localhost,root,,)
-
--- connection con1
-BEGIN;
-SELECT * FROM t1 FOR UPDATE;
+# 2010-01-25 - Added
+#
--- connection con2
-BEGIN;
-SELECT * FROM t2 FOR UPDATE;
+--source include/have_innodb.inc
--- connection con1
--- send
-SELECT * FROM t2 FOR UPDATE;
+SET @start_global_value = @@global.innodb_print_all_deadlocks;
+SELECT @start_global_value;
--- connection con2
-let $wait_condition=
-SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
-WHERE state = 'Sending data' AND info = 'SELECT * FROM t2 FOR UPDATE';
--- source include/wait_condition.inc
--- error ER_LOCK_DEADLOCK
-SELECT * FROM t1 FOR UPDATE;
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+SELECT @@global.innodb_print_all_deadlocks in (0, 1);
+SELECT @@global.innodb_print_all_deadlocks;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_print_all_deadlocks;
+SHOW global variables LIKE 'innodb_print_all_deadlocks';
+SHOW session variables LIKE 'innodb_print_all_deadlocks';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
--- connection default
+#
+# SHOW that it's writable
+#
+SET global innodb_print_all_deadlocks='OFF';
+SELECT @@global.innodb_print_all_deadlocks;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+SET @@global.innodb_print_all_deadlocks=1;
+SELECT @@global.innodb_print_all_deadlocks;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+SET global innodb_print_all_deadlocks=0;
+SELECT @@global.innodb_print_all_deadlocks;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+SET @@global.innodb_print_all_deadlocks='ON';
+SELECT @@global.innodb_print_all_deadlocks;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+--error ER_GLOBAL_VARIABLE
+SET session innodb_print_all_deadlocks='OFF';
+--error ER_GLOBAL_VARIABLE
+SET @@session.innodb_print_all_deadlocks='ON';
--- disconnect con1
--- disconnect con2
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_print_all_deadlocks=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_print_all_deadlocks=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_print_all_deadlocks=2;
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_print_all_deadlocks=-3;
+SELECT @@global.innodb_print_all_deadlocks;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_print_all_deadlocks';
+--error ER_WRONG_VALUE_FOR_VAR
+SET global innodb_print_all_deadlocks='AUTO';
-DROP TABLE t2;
-DROP TABLE t1;
+#
+# Cleanup
+#
-SET GLOBAL innodb_print_all_deadlocks=default;
+SET @@global.innodb_print_all_deadlocks = @start_global_value;
+SELECT @@global.innodb_print_all_deadlocks;
diff --git a/mysql-test/suite/sys_vars/t/innodb_priority_cleaner_basic.test b/mysql-test/suite/sys_vars/t/innodb_priority_cleaner_basic.test
new file mode 100644
index 00000000000..a305978a280
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_priority_cleaner_basic.test
@@ -0,0 +1,36 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+--source include/linux.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_priority_cleaner;
+
+# Default value
+SELECT @@GLOBAL.innodb_priority_cleaner;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_priority_cleaner;
+
+# Correct values
+SET GLOBAL innodb_priority_cleaner='OFF';
+SELECT @@GLOBAL.innodb_priority_cleaner;
+SET GLOBAL innodb_priority_cleaner='ON';
+SELECT @@GLOBAL.innodb_priority_cleaner;
+SET GLOBAL innodb_priority_cleaner=0;
+SELECT @@GLOBAL.innodb_priority_cleaner;
+SET GLOBAL innodb_priority_cleaner=1;
+SELECT @@GLOBAL.innodb_priority_cleaner;
+
+# Incorrect values
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_priority_cleaner=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_priority_cleaner=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_priority_cleaner=2;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_priority_cleaner='foo';
+
+SET GLOBAL innodb_priority_cleaner = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_priority_io_basic.test b/mysql-test/suite/sys_vars/t/innodb_priority_io_basic.test
new file mode 100644
index 00000000000..d8a04cccf1e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_priority_io_basic.test
@@ -0,0 +1,36 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+--source include/linux.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_priority_io;
+
+# Default value
+SELECT @@GLOBAL.innodb_priority_io;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_priority_io;
+
+# Correct values
+SET GLOBAL innodb_priority_io='OFF';
+SELECT @@GLOBAL.innodb_priority_io;
+SET GLOBAL innodb_priority_io='ON';
+SELECT @@GLOBAL.innodb_priority_io;
+SET GLOBAL innodb_priority_io=0;
+SELECT @@GLOBAL.innodb_priority_io;
+SET GLOBAL innodb_priority_io=1;
+SELECT @@GLOBAL.innodb_priority_io;
+
+# Incorrect values
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_priority_io=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_priority_io=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_priority_io=2;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_priority_io='foo';
+
+SET GLOBAL innodb_priority_io = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_priority_master_basic.test b/mysql-test/suite/sys_vars/t/innodb_priority_master_basic.test
new file mode 100644
index 00000000000..f202738f4e1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_priority_master_basic.test
@@ -0,0 +1,36 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+--source include/linux.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_priority_master;
+
+# Default value
+SELECT @@GLOBAL.innodb_priority_master;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_priority_master;
+
+# Correct values
+SET GLOBAL innodb_priority_master='OFF';
+SELECT @@GLOBAL.innodb_priority_master;
+SET GLOBAL innodb_priority_master='ON';
+SELECT @@GLOBAL.innodb_priority_master;
+SET GLOBAL innodb_priority_master=0;
+SELECT @@GLOBAL.innodb_priority_master;
+SET GLOBAL innodb_priority_master=1;
+SELECT @@GLOBAL.innodb_priority_master;
+
+# Incorrect values
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_priority_master=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_priority_master=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_priority_master=2;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_priority_master='foo';
+
+SET GLOBAL innodb_priority_master = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_priority_purge_basic.test b/mysql-test/suite/sys_vars/t/innodb_priority_purge_basic.test
new file mode 100644
index 00000000000..b17a97838a5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_priority_purge_basic.test
@@ -0,0 +1,36 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+--source include/linux.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_priority_purge;
+
+# Default value
+SELECT @@GLOBAL.innodb_priority_purge;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_priority_purge;
+
+# Correct values
+SET GLOBAL innodb_priority_purge='OFF';
+SELECT @@GLOBAL.innodb_priority_purge;
+SET GLOBAL innodb_priority_purge='ON';
+SELECT @@GLOBAL.innodb_priority_purge;
+SET GLOBAL innodb_priority_purge=0;
+SELECT @@GLOBAL.innodb_priority_purge;
+SET GLOBAL innodb_priority_purge=1;
+SELECT @@GLOBAL.innodb_priority_purge;
+
+# Incorrect values
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_priority_purge=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_priority_purge=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_priority_purge=2;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_priority_purge='foo';
+
+SET GLOBAL innodb_priority_purge = @start_value;
diff --git a/mysql-test/suite/sys_vars/t/innodb_purge_run_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_purge_run_now_basic.test
new file mode 100644
index 00000000000..0704784dbcc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_purge_run_now_basic.test
@@ -0,0 +1,53 @@
+#
+# Basic test for innodb_purge_run_now, note it is a duplicate of
+# innodb_purge_stop_now.
+#
+
+-- source include/have_innodb.inc
+
+# The config variable is a debug variable for now
+-- source include/have_debug.inc
+
+--disable_query_log
+# Enable metrics for the counters we are going to use
+set global innodb_monitor_enable = purge_stop_count;
+set global innodb_monitor_enable = purge_resume_count;
+--enable_query_log
+
+# Should be 0 for both
+SELECT name, count
+ FROM information_schema.innodb_metrics
+ WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+
+# Check the default value
+SET @orig = @@global.innodb_purge_run_now;
+SELECT @orig;
+
+# Stop of purge
+SET GLOBAL innodb_purge_stop_now = ON;
+
+# Stop count should now be 1
+SELECT name, count
+ FROM information_schema.innodb_metrics
+ WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+
+SET GLOBAL innodb_purge_run_now = ON;
+
+# Should always be OFF
+SELECT @@global.innodb_purge_run_now;
+
+# Both should be 1 now
+SELECT name, count
+ FROM information_schema.innodb_metrics
+ WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+
+--disable_query_log
+set global innodb_monitor_disable = all;
+set global innodb_monitor_reset_all = all;
+
+-- disable_warnings
+set global innodb_monitor_enable = default;
+set global innodb_monitor_disable = default;
+set global innodb_monitor_reset = default;
+set global innodb_monitor_reset_all = default;
+-- enable_warnings
diff --git a/mysql-test/suite/sys_vars/t/innodb_purge_stop_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_purge_stop_now_basic.test
new file mode 100644
index 00000000000..0704784dbcc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_purge_stop_now_basic.test
@@ -0,0 +1,53 @@
+#
+# Basic test for innodb_purge_run_now, note it is a duplicate of
+# innodb_purge_stop_now.
+#
+
+-- source include/have_innodb.inc
+
+# The config variable is a debug variable for now
+-- source include/have_debug.inc
+
+--disable_query_log
+# Enable metrics for the counters we are going to use
+set global innodb_monitor_enable = purge_stop_count;
+set global innodb_monitor_enable = purge_resume_count;
+--enable_query_log
+
+# Should be 0 for both
+SELECT name, count
+ FROM information_schema.innodb_metrics
+ WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+
+# Check the default value
+SET @orig = @@global.innodb_purge_run_now;
+SELECT @orig;
+
+# Stop of purge
+SET GLOBAL innodb_purge_stop_now = ON;
+
+# Stop count should now be 1
+SELECT name, count
+ FROM information_schema.innodb_metrics
+ WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+
+SET GLOBAL innodb_purge_run_now = ON;
+
+# Should always be OFF
+SELECT @@global.innodb_purge_run_now;
+
+# Both should be 1 now
+SELECT name, count
+ FROM information_schema.innodb_metrics
+ WHERE name = 'purge_stop_count' OR name = 'purge_resume_count';
+
+--disable_query_log
+set global innodb_monitor_disable = all;
+set global innodb_monitor_reset_all = all;
+
+-- disable_warnings
+set global innodb_monitor_enable = default;
+set global innodb_monitor_disable = default;
+set global innodb_monitor_reset = default;
+set global innodb_monitor_reset_all = default;
+-- enable_warnings
diff --git a/mysql-test/suite/sys_vars/t/innodb_read_only_basic.test b/mysql-test/suite/sys_vars/t/innodb_read_only_basic.test
new file mode 100644
index 00000000000..581eb3538b8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_read_only_basic.test
@@ -0,0 +1,20 @@
+--source include/have_innodb.inc
+
+# Can only be set from the command line.
+# show the global and session values;
+
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_read_only;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_read_only;
+show global variables like 'innodb_read_only';
+show session variables like 'innodb_read_only';
+select * from information_schema.global_variables where variable_name='innodb_read_only';
+select * from information_schema.session_variables where variable_name='innodb_read_only';
+
+# Show that it's read-only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_read_only=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session innodb_read_only=1;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_saved_page_number_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_saved_page_number_debug_basic.test
new file mode 100644
index 00000000000..74ce3ffc049
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_saved_page_number_debug_basic.test
@@ -0,0 +1,35 @@
+--echo #
+--echo # Basic test for innodb_saved_page_number_debug.
+--echo #
+
+--source include/have_innodb.inc
+
+# The config variable is a debug variable
+-- source include/have_debug.inc
+
+SELECT @@global.innodb_saved_page_number_debug;
+
+set global innodb_saved_page_number_debug = 10;
+
+SELECT @@global.innodb_saved_page_number_debug;
+
+set global innodb_saved_page_number_debug = 100;
+
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_saved_page_number_debug = dummy;
+
+--error ER_GLOBAL_VARIABLE
+set innodb_saved_page_number_debug = ON;
+
+--echo # An example usage.
+create table t1 (f1 int primary key) engine = innodb;
+select space from information_schema.innodb_sys_tables
+where name = 'test/t1' into @space_id;
+set global innodb_saved_page_number_debug = 0;
+set global innodb_fil_make_page_dirty_debug = @space_id;
+drop table t1;
+
+set global innodb_saved_page_number_debug = 0;
+
+SELECT @@global.innodb_saved_page_number_debug;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test b/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test
new file mode 100644
index 00000000000..b2382fd7844
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_sched_priority_cleaner_basic.test
@@ -0,0 +1,43 @@
+--source include/have_xtradb.inc
+--source include/linux.inc
+--source include/not_embedded.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_sched_priority_cleaner;
+
+# Default value
+SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_sched_priority_cleaner;
+
+# Correct values
+# The high priority values may need permissions, thus do not test them
+# SET GLOBAL innodb_sched_priority_cleaner=39;
+# SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+#SET GLOBAL innodb_sched_priority_cleaner=34;
+# SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+SET GLOBAL innodb_sched_priority_cleaner=19;
+SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+SET GLOBAL innodb_sched_priority_cleaner=5;
+SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+SET GLOBAL innodb_sched_priority_cleaner=0;
+SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+
+# Incorrect values
+SET GLOBAL innodb_sched_priority_cleaner=-1;
+SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+#SET GLOBAL innodb_sched_priority_cleaner=40;
+#SELECT @@GLOBAL.innodb_sched_priority_cleaner;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_cleaner=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_cleaner=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_cleaner='foo';
+
+# If we are lacking permissions, then we cannot restore the startup value
+# at the end.
+--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test b/mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test
new file mode 100644
index 00000000000..f77816e84c2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_sched_priority_io_basic.test
@@ -0,0 +1,44 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+--source include/linux.inc
+--source include/not_embedded.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_sched_priority_io;
+
+# Default value
+SELECT @@GLOBAL.innodb_sched_priority_io;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_sched_priority_io;
+
+# Correct values
+# The high priority values may need permissions, thus do not test them
+# SET GLOBAL innodb_sched_priority_io=39;
+# SELECT @@GLOBAL.innodb_sched_priority_io;
+#SET GLOBAL innodb_sched_priority_io=34;
+# SELECT @@GLOBAL.innodb_sched_priorit_io;
+SET GLOBAL innodb_sched_priority_io=19;
+SELECT @@GLOBAL.innodb_sched_priority_io;
+SET GLOBAL innodb_sched_priority_io=5;
+SELECT @@GLOBAL.innodb_sched_priority_io;
+SET GLOBAL innodb_sched_priority_io=0;
+SELECT @@GLOBAL.innodb_sched_priority_io;
+
+# Incorrect values
+SET GLOBAL innodb_sched_priority_io=-1;
+SELECT @@GLOBAL.innodb_sched_priority_io;
+#SET GLOBAL innodb_sched_priority_io=40;
+#SELECT @@GLOBAL.innodb_sched_priority_io;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_io=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_io=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_io='foo';
+
+# If we are lacking permissions, then we cannot restore the startup value
+# at the end.
+--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test b/mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test
new file mode 100644
index 00000000000..150e7e5793d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_sched_priority_master_basic.test
@@ -0,0 +1,44 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+--source include/linux.inc
+--source include/not_embedded.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_sched_priority_master;
+
+# Default value
+SELECT @@GLOBAL.innodb_sched_priority_master;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_sched_priority_master;
+
+# Correct values
+# The high priority values may need permissions, thus do not test them
+# SET GLOBAL innodb_sched_priority_master=39;
+# SELECT @@GLOBAL.innodb_sched_priority_master;
+#SET GLOBAL innodb_sched_priority_master=34;
+# SELECT @@GLOBAL.innodb_sched_priority_master;
+SET GLOBAL innodb_sched_priority_master=19;
+SELECT @@GLOBAL.innodb_sched_priority_master;
+SET GLOBAL innodb_sched_priority_master=5;
+SELECT @@GLOBAL.innodb_sched_priority_master;
+SET GLOBAL innodb_sched_priority_master=0;
+SELECT @@GLOBAL.innodb_sched_priority_master;
+
+# Incorrect values
+SET GLOBAL innodb_sched_priority_master=-1;
+SELECT @@GLOBAL.innodb_sched_priority_master;
+#SET GLOBAL innodb_sched_priority_master=40;
+#SELECT @@GLOBAL.innodb_sched_priority_master;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_master=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_master=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_master='foo';
+
+# If we are lacking permissions, then we cannot restore the startup value
+# at the end.
+--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test b/mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test
new file mode 100644
index 00000000000..bc37e4ee568
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_sched_priority_purge_basic.test
@@ -0,0 +1,44 @@
+--source include/have_debug.inc
+--source include/have_xtradb.inc
+--source include/linux.inc
+--source include/not_embedded.inc
+
+# A dynamic, global variable
+
+SET @start_value = @@GLOBAL.innodb_sched_priority_purge;
+
+# Default value
+SELECT @@GLOBAL.innodb_sched_priority_purge;
+
+# Global only
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_sched_priority_purge;
+
+# Correct values
+# The high priority values may need permissions, thus do not test them
+# SET GLOBAL innodb_sched_priority_purge=39;
+# SELECT @@GLOBAL.innodb_sched_priority_purge;
+#SET GLOBAL innodb_sched_priority_purge=34;
+# SELECT @@GLOBAL.innodb_sched_priority_purge;
+SET GLOBAL innodb_sched_priority_purge=19;
+SELECT @@GLOBAL.innodb_sched_priority_purge;
+SET GLOBAL innodb_sched_priority_purge=5;
+SELECT @@GLOBAL.innodb_sched_priority_purge;
+SET GLOBAL innodb_sched_priority_purge=0;
+SELECT @@GLOBAL.innodb_sched_priority_purge;
+
+# Incorrect values
+SET GLOBAL innodb_sched_priority_purge=-1;
+SELECT @@GLOBAL.innodb_sched_priority_purge;
+#SET GLOBAL innodb_sched_priority_purge=40;
+#SELECT @@GLOBAL.innodb_sched_priority_purge;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_purge=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_purge=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_sched_priority_purge='foo';
+
+# If we are lacking permissions, then we cannot restore the startup value
+# at the end.
+--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/sys_vars/t/innodb_sort_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_sort_buffer_size_basic.test
new file mode 100644
index 00000000000..920c992c1f9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_sort_buffer_size_basic.test
@@ -0,0 +1,26 @@
+
+#
+# 2011-11-17 - Added
+#
+
+--source include/have_innodb.inc
+
+#
+# show the global and session values;
+#
+select @@global.innodb_sort_buffer_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_sort_buffer_size;
+show global variables like 'innodb_sort_buffer_size';
+show session variables like 'innodb_sort_buffer_size';
+select * from information_schema.global_variables where variable_name='innodb_sort_buffer_size';
+select * from information_schema.session_variables where variable_name='innodb_sort_buffer_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_sort_buffer_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session innodb_sort_buffer_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_auto_recalc_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_auto_recalc_basic.test
new file mode 100644
index 00000000000..0020c493091
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_auto_recalc_basic.test
@@ -0,0 +1,31 @@
+#
+# innodb_stats_auto_recalc
+#
+
+-- source include/have_innodb.inc
+
+# show the default value
+SELECT @@innodb_stats_auto_recalc;
+
+# check that it is writeable
+SET GLOBAL innodb_stats_auto_recalc=ON;
+SELECT @@innodb_stats_auto_recalc;
+
+SET GLOBAL innodb_stats_auto_recalc=OFF;
+SELECT @@innodb_stats_auto_recalc;
+
+SET GLOBAL innodb_stats_auto_recalc=1;
+SELECT @@innodb_stats_auto_recalc;
+
+SET GLOBAL innodb_stats_auto_recalc=0;
+SELECT @@innodb_stats_auto_recalc;
+
+# should be a boolean
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_stats_auto_recalc=123;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_stats_auto_recalc='foo';
+
+# restore the environment
+SET GLOBAL innodb_stats_auto_recalc=default;
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_persistent_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_persistent_basic.test
new file mode 100644
index 00000000000..4277b58de00
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_persistent_basic.test
@@ -0,0 +1,31 @@
+#
+# innodb_stats_persistent
+#
+
+-- source include/have_innodb.inc
+
+# show the default value
+SELECT @@innodb_stats_persistent;
+
+# check that it is writeable
+SET GLOBAL innodb_stats_persistent=ON;
+SELECT @@innodb_stats_persistent;
+
+SET GLOBAL innodb_stats_persistent=OFF;
+SELECT @@innodb_stats_persistent;
+
+SET GLOBAL innodb_stats_persistent=1;
+SELECT @@innodb_stats_persistent;
+
+SET GLOBAL innodb_stats_persistent=0;
+SELECT @@innodb_stats_persistent;
+
+# should be a boolean
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_stats_persistent=123;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_stats_persistent='foo';
+
+# restore the environment
+SET GLOBAL innodb_stats_persistent=off;
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_persistent_sample_pages_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_persistent_sample_pages_basic.test
new file mode 100644
index 00000000000..cf223c02090
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_persistent_sample_pages_basic.test
@@ -0,0 +1,57 @@
+
+#
+# 2010-01-25 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_stats_persistent_sample_pages;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are zero or above
+SELECT @@global.innodb_stats_persistent_sample_pages >=0;
+SELECT @@global.innodb_stats_persistent_sample_pages;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_stats_persistent_sample_pages;
+SHOW global variables LIKE 'innodb_stats_persistent_sample_pages';
+SHOW session variables LIKE 'innodb_stats_persistent_sample_pages';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_persistent_sample_pages';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_persistent_sample_pages';
+
+#
+# SHOW that it's writable
+#
+SET global innodb_stats_persistent_sample_pages=10;
+SELECT @@global.innodb_stats_persistent_sample_pages;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_persistent_sample_pages';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_persistent_sample_pages';
+--error ER_GLOBAL_VARIABLE
+SET session innodb_stats_persistent_sample_pages=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_persistent_sample_pages=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_persistent_sample_pages=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_persistent_sample_pages="foo";
+
+SET global innodb_stats_persistent_sample_pages=-7;
+SELECT @@global.innodb_stats_persistent_sample_pages;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_persistent_sample_pages';
+
+#
+# cleanup
+#
+SET @@global.innodb_stats_persistent_sample_pages = @start_global_value;
+SELECT @@global.innodb_stats_persistent_sample_pages;
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_transient_sample_pages_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_transient_sample_pages_basic.test
new file mode 100644
index 00000000000..ff3a50efa1f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_transient_sample_pages_basic.test
@@ -0,0 +1,57 @@
+
+#
+# 2010-01-25 - Added
+#
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_stats_transient_sample_pages;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are zero or above
+SELECT @@global.innodb_stats_transient_sample_pages >=0;
+SELECT @@global.innodb_stats_transient_sample_pages;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_stats_transient_sample_pages;
+SHOW global variables LIKE 'innodb_stats_transient_sample_pages';
+SHOW session variables LIKE 'innodb_stats_transient_sample_pages';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_transient_sample_pages';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_transient_sample_pages';
+
+#
+# SHOW that it's writable
+#
+SET global innodb_stats_transient_sample_pages=10;
+SELECT @@global.innodb_stats_transient_sample_pages;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_transient_sample_pages';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_stats_transient_sample_pages';
+--error ER_GLOBAL_VARIABLE
+SET session innodb_stats_transient_sample_pages=1;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_transient_sample_pages=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_transient_sample_pages=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_transient_sample_pages="foo";
+
+SET global innodb_stats_transient_sample_pages=-7;
+SELECT @@global.innodb_stats_transient_sample_pages;
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_stats_transient_sample_pages';
+
+#
+# cleanup
+#
+SET @@global.innodb_stats_transient_sample_pages = @start_global_value;
+SELECT @@global.innodb_stats_transient_sample_pages;
diff --git a/mysql-test/suite/sys_vars/t/innodb_status_output_basic.test b/mysql-test/suite/sys_vars/t/innodb_status_output_basic.test
new file mode 100644
index 00000000000..4459632134d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_status_output_basic.test
@@ -0,0 +1,69 @@
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_status_output;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_status_output in (0, 1);
+select @@global.innodb_status_output;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_status_output;
+show global variables like 'innodb_status_output';
+show session variables like 'innodb_status_output';
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+
+#
+# show that it's writable
+#
+set global innodb_status_output='OFF';
+select @@global.innodb_status_output;
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+set @@global.innodb_status_output=1;
+select @@global.innodb_status_output;
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+set global innodb_status_output=0;
+select @@global.innodb_status_output;
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+set @@global.innodb_status_output='ON';
+select @@global.innodb_status_output;
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+--error ER_GLOBAL_VARIABLE
+set session innodb_status_output='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_status_output='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_status_output=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_status_output=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_status_output=2;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_status_output=-3;
+select @@global.innodb_status_output;
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+set global innodb_status_output=DEFAULT;
+select @@global.innodb_status_output;
+select * from information_schema.global_variables where variable_name='innodb_status_output';
+select * from information_schema.session_variables where variable_name='innodb_status_output';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_status_output='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_status_output = @start_global_value;
+SELECT @@global.innodb_status_output;
diff --git a/mysql-test/suite/sys_vars/t/innodb_status_output_locks_basic.test b/mysql-test/suite/sys_vars/t/innodb_status_output_locks_basic.test
new file mode 100644
index 00000000000..92c82b2ddbf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_status_output_locks_basic.test
@@ -0,0 +1,69 @@
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_status_output_locks;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_status_output_locks in (0, 1);
+select @@global.innodb_status_output_locks;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_status_output_locks;
+show global variables like 'innodb_status_output_locks';
+show session variables like 'innodb_status_output_locks';
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+
+#
+# show that it's writable
+#
+set global innodb_status_output_locks='OFF';
+select @@global.innodb_status_output_locks;
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+set @@global.innodb_status_output_locks=1;
+select @@global.innodb_status_output_locks;
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+set global innodb_status_output_locks=0;
+select @@global.innodb_status_output_locks;
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+set @@global.innodb_status_output_locks='ON';
+select @@global.innodb_status_output_locks;
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+--error ER_GLOBAL_VARIABLE
+set session innodb_status_output_locks='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_status_output_locks='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_status_output_locks=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_status_output_locks=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_status_output_locks=2;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_status_output_locks=-3;
+select @@global.innodb_status_output_locks;
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+set global innodb_status_output_locks=DEFAULT;
+select @@global.innodb_status_output_locks;
+select * from information_schema.global_variables where variable_name='innodb_status_output_locks';
+select * from information_schema.session_variables where variable_name='innodb_status_output_locks';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_status_output_locks='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_status_output_locks = @start_global_value;
+SELECT @@global.innodb_status_output_locks;
diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_array_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_sync_array_size_basic.test
new file mode 100644
index 00000000000..53011acb576
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_sync_array_size_basic.test
@@ -0,0 +1,31 @@
+# 2010-01-27 - Added
+
+--source include/have_innodb.inc
+
+if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in InnoDB 5.6.10 or earlier
+}
+
+# Exists as global only
+#
+--echo Valid values are between 0 and 1024
+SELECT @@global.innodb_sync_array_size between 0 and 1024;
+SELECT @@global.innodb_sync_array_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_sync_array_size;
+SHOW GLOBAL variables LIKE 'innodb_sync_array_size';
+SHOW SESSION variables LIKE 'innodb_sync_array_size';
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_sync_array_size';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_sync_array_size';
+
+#
+# Show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL innodb_sync_array_size=10;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET SESSION innodb_sync_array_size=10;
+SELECT @@global.innodb_sync_array_size;
diff --git a/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test b/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test
new file mode 100644
index 00000000000..3c547152e27
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_tmpdir_basic.test
@@ -0,0 +1,48 @@
+--source include/have_innodb.inc
+
+if (`select plugin_auth_version <= "5.6.28-MariaDB-76.1" from information_schema.plugins where plugin_name='innodb'`)
+{
+ --skip Not fixed in XtraDB as of 5.6.28-MariaDB-76.1 or earlier
+}
+
+SET @start_global_value = @@global.innodb_tmpdir;
+SELECT @start_global_value;
+
+#
+# exists as global and session
+#
+select @@session.innodb_tmpdir;
+
+show global variables like 'innodb_tmpdir';
+show session variables like 'innodb_tmpdir';
+
+select * from information_schema.global_variables where variable_name='innodb_tmpdir';
+select * from information_schema.session_variables where variable_name='innodb_tmpdir';
+#
+# Show that it is writable
+#
+
+set global innodb_tmpdir=@@global.tmpdir;
+set session innodb_tmpdir=@@global.tmpdir;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_tmpdir=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_tmpdir=1e1;
+
+#
+# path len more than 512
+#
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_tmpdir=repeat('a',1000);
+show warnings;
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_tmpdir = @start_global_value;
+SELECT @@global.innodb_tmpdir;
diff --git a/mysql-test/suite/sys_vars/t/innodb_undo_directory_basic.test b/mysql-test/suite/sys_vars/t/innodb_undo_directory_basic.test
new file mode 100644
index 00000000000..583dbe6aa03
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_undo_directory_basic.test
@@ -0,0 +1,85 @@
+################## mysql-test/t/innodb_undo_directory_basic.test ##############
+# #
+# Variable Name: innodb_undo_directory #
+# Scope: Global #
+# Access Type: Static #
+# Data Type: string #
+# #
+# #
+# Creation Date: 2011-07-05 #
+# Author : Sunny Bains #
+# #
+# #
+# Description: Read-only config global variable innodb_undo_directory #
+# * Value check #
+# * Scope check #
+# #
+###############################################################################
+
+--source include/have_innodb.inc
+
+####################################################################
+# Display the default value #
+####################################################################
+SELECT @@GLOBAL.innodb_undo_directory;
+--echo . Expected
+
+
+####################################################################
+# Check if Value can set #
+####################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_undo_directory="/tmp";
+--echo Expected error 'Read only variable'
+
+SELECT COUNT(@@GLOBAL.innodb_undo_directory);
+--echo 1 Expected
+
+
+################################################################################
+# Check if the value in GLOBAL table matches value in variable #
+################################################################################
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_directory';
+--echo . Expected
+
+SELECT COUNT(@@GLOBAL.innodb_undo_directory);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_directory';
+--echo 1 Expected
+
+
+################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+################################################################################
+SELECT @@innodb_undo_directory = @@GLOBAL.innodb_undo_directory;
+--echo 1 Expected
+
+
+################################################################################
+# Check if innodb_undo_directory can be accessed with and without @@ sign #
+################################################################################
+
+SELECT COUNT(@@innodb_undo_directory);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_undo_directory);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_undo_directory);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_undo_directory);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_undo_directory = @@SESSION.innodb_undo_directory;
+--echo Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/innodb_undo_logs_basic.test b/mysql-test/suite/sys_vars/t/innodb_undo_logs_basic.test
new file mode 100644
index 00000000000..77b6af6909c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_undo_logs_basic.test
@@ -0,0 +1,95 @@
+################## mysql-test/t/innodb_undo_logs_basic.test ############
+# #
+# Variable Name: innodb_undo_logs #
+# Scope: Global #
+# Access Type: Static #
+# Data Type: numeric #
+# #
+# #
+# Creation Date: 2011-07-05 #
+# Author : Sunny Bains #
+# #
+# #
+# Description: Read-only config global variable innodb_undo_logs #
+# * Value check #
+# * Scope check #
+# #
+###############################################################################
+
+--source include/have_innodb.inc
+
+####################################################################
+# Display default value #
+####################################################################
+SELECT @@GLOBAL.innodb_undo_logs;
+--echo 128 Expected
+
+
+####################################################################
+# Check if value can be set #
+####################################################################
+
+SET @@GLOBAL.innodb_undo_logs=128;
+
+SELECT COUNT(@@GLOBAL.innodb_undo_logs);
+--echo 1 Expected
+
+
+################################################################################
+# Check if the value in GLOBAL table matches value in variable #
+################################################################################
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_logs';
+--echo 128 Expected
+
+
+################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+################################################################################
+SELECT @@innodb_undo_logs = @@GLOBAL.innodb_undo_logs;
+--echo 1 Expected
+
+
+################################################################################
+# Check if innodb_undo_logs can be accessed with and without @@ sign #
+################################################################################
+
+SELECT COUNT(@@innodb_undo_logs);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_undo_logs);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_undo_logs);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_undo_logs = @@SESSION.innodb_undo_logs;
+
+# Begin Bug 13604034
+# SET GLOBAL INNODB_UNDO_LOGS=0 SUCCEEDS BUT LEADS TO AN ASSERT
+# MAX_UNDO_LOGS > 0
+--echo Begin bug 13604034
+select @@innodb_undo_logs;
+--echo 128 Expected
+set global innodb_undo_logs = 129;
+select @@innodb_undo_logs;
+--echo 128 Expected
+set global innodb_undo_logs = 0;
+select @@innodb_undo_logs;
+--echo 1 Expected
+set global innodb_undo_logs = -1;
+select @@innodb_undo_logs;
+--echo 1 Expected
+set global innodb_undo_logs = 50;
+select @@innodb_undo_logs;
+--echo 50 Expected
+set global innodb_undo_logs = default;
+select @@innodb_undo_logs;
+--echo 128 Expected
+--echo End bug 13604034
+# End Bug 13604034
diff --git a/mysql-test/suite/sys_vars/t/innodb_undo_tablespaces_basic.test b/mysql-test/suite/sys_vars/t/innodb_undo_tablespaces_basic.test
new file mode 100644
index 00000000000..53396249e03
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_undo_tablespaces_basic.test
@@ -0,0 +1,77 @@
+################## mysql-test/t/innodb_undo_tablespaces_basic.test ############
+# #
+# Variable Name: innodb_undo_tablespaces #
+# Scope: Global #
+# Access Type: Static #
+# Data Type: string #
+# #
+# #
+# Creation Date: 2011-07-05 #
+# Author : Sunny Bains #
+# #
+# #
+# Description: Read-only config global variable innodb_undo_tablespaces #
+# * Value check #
+# * Scope check #
+# #
+###############################################################################
+
+--source include/have_innodb.inc
+
+####################################################################
+# Display default value #
+####################################################################
+SELECT @@GLOBAL.innodb_undo_tablespaces;
+--echo 0 Expected
+
+
+####################################################################
+# Check if value can be set #
+####################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_undo_tablespaces=128;
+--echo Expected error 'Read only variable'
+
+SELECT COUNT(@@GLOBAL.innodb_undo_tablespaces);
+--echo 1 Expected
+
+
+################################################################################
+# Check if the value in GLOBAL table matches value in variable #
+################################################################################
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_tablespaces';
+--echo 0 Expected
+
+
+################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+################################################################################
+SELECT @@innodb_undo_tablespaces = @@GLOBAL.innodb_undo_tablespaces;
+--echo 1 Expected
+
+
+################################################################################
+# Check if innodb_undo_tablespaces can be accessed with and without @@ sign #
+################################################################################
+
+SELECT COUNT(@@innodb_undo_tablespaces);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_undo_tablespaces);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_undo_tablespaces);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_undo_tablespaces);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_undo_tablespaces = @@SESSION.innodb_undo_tablespaces;
+--echo Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test b/mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test
new file mode 100644
index 00000000000..deebe708d3d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test
@@ -0,0 +1,168 @@
+################# mysql-test\t\key_cache_file_hash_size.test ##################
+# #
+# Variable Name: key_cache_file_hash_size #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# Default Value: 300 #
+# Range: 100-4294967295 #
+# #
+# #
+# Creation Date: 2008-02-07 #
+# Author: Salman #
+# #
+# Description: Test Cases of Dynamic System Variable key_cache_file_hash_size #
+# that checks the 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-system-variables.html #
+# #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+########################################################################
+# START OF key_cache_file_hash_size TESTS #
+########################################################################
+
+
+#############################################################################
+# Saving initial value of key_cache_file_hash_size in a temporary variable #
+#############################################################################
+
+SET @start_value = @@global.key_cache_file_hash_size;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_056_01------------------------#'
+################################################################################
+# Display the DEFAULT value of key_cache_file_hash_size #
+################################################################################
+
+SET @@global.key_cache_file_hash_size = DEFAULT;
+SELECT @@global.key_cache_file_hash_size;
+
+
+--echo '#---------------------FN_DYNVARS_056_02-------------------------#'
+###############################################
+# Verify default value of variable #
+###############################################
+
+SET @@global.key_cache_file_hash_size = @start_value;
+SELECT @@global.key_cache_file_hash_size = 300;
+
+
+--echo '#--------------------FN_DYNVARS_056_03------------------------#'
+###############################################################################
+# Change the value of key_cache_file_hash_size to a valid value #
+###############################################################################
+
+SET @@global.key_cache_file_hash_size = 128;
+SET @@global.key_cache_file_hash_size = 16384;
+SELECT @@global.key_cache_file_hash_size;
+
+--echo '#--------------------FN_DYNVARS_056_04-------------------------#'
+###########################################################################
+# Change the value of key_cache_file_hash_size to invalid value #
+###########################################################################
+
+SET @@global.key_cache_file_hash_size = -1;
+SELECT @@global.key_cache_file_hash_size;
+SET @@global.key_cache_file_hash_size = 42949672951;
+SELECT @@global.key_cache_file_hash_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_file_hash_size = 10000.01;
+SELECT @@global.key_cache_file_hash_size;
+SET @@global.key_cache_file_hash_size = -1024;
+SELECT @@global.key_cache_file_hash_size;
+SET @@global.key_cache_file_hash_size = 99;
+SELECT @@global.key_cache_file_hash_size;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_file_hash_size = ON;
+SELECT @@global.key_cache_file_hash_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_file_hash_size = 'test';
+SELECT @@global.key_cache_file_hash_size;
+
+
+--echo '#-------------------FN_DYNVARS_056_05----------------------------#'
+###########################################################################
+# Test if accessing session key_cache_file_hash_size gives error #
+###########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.key_cache_file_hash_size = 0;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.key_cache_file_hash_size;
+
+
+--echo '#----------------------FN_DYNVARS_056_06------------------------#'
+##############################################################################
+# Check if the value in GLOBAL & SESSION Tables matches values in variable #
+##############################################################################
+
+SELECT @@global.key_cache_file_hash_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='key_cache_file_hash_size';
+
+SELECT @@key_cache_file_hash_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='key_cache_file_hash_size';
+
+
+--echo '#---------------------FN_DYNVARS_056_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+SET @@global.key_cache_file_hash_size = TRUE;
+SELECT @@global.key_cache_file_hash_size;
+SET @@global.key_cache_file_hash_size = FALSE;
+SELECT @@global.key_cache_file_hash_size;
+
+
+--echo '#---------------------FN_DYNVARS_056_08----------------------#'
+########################################################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
+########################################################################################################
+
+SET @@global.key_cache_file_hash_size = 150;
+SELECT @@key_cache_file_hash_size = @@global.key_cache_file_hash_size;
+
+
+--echo '#---------------------FN_DYNVARS_056_09----------------------#'
+########################################################################## #######
+# Check if key_cache_file_hash_size can be accessed with and without @@ sign #
+##################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET key_cache_file_hash_size = 8000;
+SELECT @@key_cache_file_hash_size;
+--Error ER_PARSE_ERROR
+SET local.key_cache_file_hash_size = 10;
+--Error ER_UNKNOWN_TABLE
+SELECT local.key_cache_file_hash_size;
+--Error ER_PARSE_ERROR
+SET global.key_cache_file_hash_size = 10;
+--Error ER_UNKNOWN_TABLE
+SELECT global.key_cache_file_hash_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT key_cache_file_hash_size = @@session.key_cache_file_hash_size;
+
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.key_cache_file_hash_size = @start_value;
+SELECT @@global.key_cache_file_hash_size;
+
+
+########################################################################
+# END OF key_cache_file_hash_size TESTS #
+########################################################################
diff --git a/mysql-test/suite/sys_vars/t/last_gtid_basic.test b/mysql-test/suite/sys_vars/t/last_gtid_basic.test
new file mode 100644
index 00000000000..85fbf079bfb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/last_gtid_basic.test
@@ -0,0 +1,11 @@
+--source include/not_embedded.inc
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@global.last_gtid;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL last_gtid= 10;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET SESSION last_gtid= 20;
+
+SELECT @@session.last_gtid;
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 68ee00b6ee0..c66bdc40a02 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
@@ -622,8 +622,10 @@ SET @@lc_time_names = 108;
SELECT @@lc_time_names;
SET @@lc_time_names = 109;
SELECT @@lc_time_names;
---Error ER_UNKNOWN_LOCALE
SET @@lc_time_names = 110;
+SELECT @@lc_time_names;
+--Error ER_UNKNOWN_LOCALE
+SET @@lc_time_names = 111;
--echo '#--------------------FN_DYNVARS_060_10-------------------------#'
#############################################################################
diff --git a/mysql-test/suite/sys_vars/t/log_basic.test b/mysql-test/suite/sys_vars/t/log_basic.test
deleted file mode 100644
index 74b344cff6d..00000000000
--- a/mysql-test/suite/sys_vars/t/log_basic.test
+++ /dev/null
@@ -1,62 +0,0 @@
-###################### mysql-test\t\log_basic.test ############################
-# #
-# Variable Name: log_basic #
-# Scope: GLOBAL #
-# Access Type: Dynamic #
-# Data Type: string #
-# Default Value: #
-# Range: #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author: Rizwan #
-# #
-# Description: #
-# Test Cases of Dynamic System Variable log that checks the 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-system-variables.html #
-# #
-###############################################################################
-
---source include/load_sysvars.inc
-
-#####################################
-## START OF log TESTS ##
-#####################################
-
---echo '#--------------------FN_DYNVARS_062_01------------------#'
-#############################################################
-# Accessing variable #
-#############################################################
-
-SET @start_log= @@global.log;
-
-SELECT @@global.log AS INIT_VALUE;
-
-SELECT @@log AS INIT_VALUE;
-
-SET @@global.log = ON;
-
-SET global log = 0;
-
---echo '#--------------------FN_DYNVARS_062_02-------------------------#'
-################################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-################################################################################
-# We can only access log value from information schema global_variables table
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='log';
-
-SET @@global.log= @start_log;
-
-############################################
-# END OF log TESTS #
-############################################
-
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
deleted file mode 100644
index 22fe4dfaa6e..00000000000
--- a/mysql-test/suite/sys_vars/t/log_slow_queries_basic.test
+++ /dev/null
@@ -1,186 +0,0 @@
-##################### 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 #
-# #
-# #
-# 2010-01-20 OBN - Added check for variable value matching I_S tables after #
-# variable value change #
-# #
-################################################################################
-
---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;
-SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='log_slow_queries';
-SET @@global.log_slow_queries = 1;
-SELECT @@global.log_slow_queries;
-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_07----------------------#'
-###################################################################
-# Check if TRUE and FALSE values can be used on variable #
-###################################################################
-
-SET @@global.log_slow_queries = TRUE;
-SELECT @@global.log_slow_queries;
-SELECT IF(@@global.log_slow_queries, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='log_slow_queries';
-SET @@global.log_slow_queries = FALSE;
-SELECT @@global.log_slow_queries;
-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_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/log_slow_verbosity_basic.test b/mysql-test/suite/sys_vars/t/log_slow_verbosity_basic.test
index 9302d5f1210..f45fa5da9c5 100644
--- a/mysql-test/suite/sys_vars/t/log_slow_verbosity_basic.test
+++ b/mysql-test/suite/sys_vars/t/log_slow_verbosity_basic.test
@@ -29,12 +29,26 @@ set session log_slow_verbosity=2;
select @@session.log_slow_verbosity;
set session log_slow_verbosity=3;
select @@session.log_slow_verbosity;
+set session log_slow_verbosity=4;
+select @@session.log_slow_verbosity;
+set session log_slow_verbosity=5;
+select @@session.log_slow_verbosity;
+set session log_slow_verbosity=6;
+select @@session.log_slow_verbosity;
+set session log_slow_verbosity=7;
+select @@session.log_slow_verbosity;
+
+
set session log_slow_verbosity='innodb';
select @@session.log_slow_verbosity;
set session log_slow_verbosity='query_plan';
select @@session.log_slow_verbosity;
set session log_slow_verbosity='innodb,query_plan';
select @@session.log_slow_verbosity;
+set session log_slow_verbosity='explain';
+select @@session.log_slow_verbosity;
+set session log_slow_verbosity='innodb,query_plan,explain';
+select @@session.log_slow_verbosity;
set session log_slow_verbosity='';
select @@session.log_slow_verbosity;
@@ -48,6 +62,6 @@ set session log_slow_verbosity=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set session log_slow_verbosity="foo";
--error ER_WRONG_VALUE_FOR_VAR
-set session log_slow_verbosity=4;
+set session log_slow_verbosity=8;
SET @@global.log_slow_verbosity = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/t/max_digest_length_basic.test b/mysql-test/suite/sys_vars/t/max_digest_length_basic.test
new file mode 100644
index 00000000000..b5e1d834d7e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_digest_length_basic.test
@@ -0,0 +1,46 @@
+# Copyright (C) 2010 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
+
+--source include/not_embedded.inc
+
+#
+# Only global
+#
+
+select @@global.max_digest_length;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.max_digest_length;
+
+show global variables like 'max_digest_length';
+
+show session variables like 'max_digest_length';
+
+select * from information_schema.global_variables
+ where variable_name='max_digest_length';
+
+select * from information_schema.session_variables
+ where variable_name='max_digest_length';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global max_digest_length=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session max_digest_length=1;
+
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 e39778baca8..05d0fd1be82 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
@@ -24,7 +24,7 @@
###############################################################################
--source include/load_sysvars.inc
-
+--source include/not_embedded.inc
###################################################################
# START OF max_relay_log_size TESTS #
@@ -105,9 +105,7 @@ SELECT @@global.max_relay_log_size;
# Test if accessing session max_relay_log_size gives error #
########################################################################
---Error ER_GLOBAL_VARIABLE
SET @@session.max_relay_log_size = 4096;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.max_relay_log_size;
@@ -150,7 +148,6 @@ SELECT @@max_relay_log_size = @@global.max_relay_log_size;
# Check if max_relay_log_size can be accessed with and without @@ sign #
#############################################################################
---Error ER_GLOBAL_VARIABLE
SET max_relay_log_size = 6000;
SELECT @@max_relay_log_size;
--Error ER_PARSE_ERROR
diff --git a/mysql-test/suite/sys_vars/t/metadata_locks_hash_instances_basic.test b/mysql-test/suite/sys_vars/t/metadata_locks_hash_instances_basic.test
new file mode 100644
index 00000000000..5fcf1d956d0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/metadata_locks_hash_instances_basic.test
@@ -0,0 +1,60 @@
+########## mysql-test\t\metadata_locks_hash_instances_basic.test ##############
+# #
+# Variable Name: metadata_locks_hash_instances #
+# Scope: Global #
+# Access Type: Static #
+# Data Type: Integer #
+# #
+###############################################################################
+
+
+--echo ####################################################################
+--echo # Displaying default value #
+--echo ####################################################################
+SELECT @@GLOBAL.metadata_locks_hash_instances;
+
+
+--echo ####################################################################
+--echo # Check that value cannot be set (this variable is settable only #
+--echo # at start-up). #
+--echo ####################################################################
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.metadata_locks_hash_instances=1;
+
+SELECT @@GLOBAL.metadata_locks_hash_instances;
+
+
+--echo #################################################################
+--echo # Check if the value in GLOBAL Table matches value in variable #
+--echo #################################################################
+SELECT @@GLOBAL.metadata_locks_hash_instances = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='metadata_locks_hash_instances';
+
+SELECT @@GLOBAL.metadata_locks_hash_instances;
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='metadata_locks_hash_instances';
+
+
+--echo ######################################################################
+--echo # Check if accessing variable with and without GLOBAL point to same #
+--echo # variable #
+--echo ######################################################################
+SELECT @@metadata_locks_hash_instances = @@GLOBAL.metadata_locks_hash_instances;
+
+
+--echo ######################################################################
+--echo # Check if variable has only the GLOBAL scope #
+--echo ######################################################################
+
+SELECT @@metadata_locks_hash_instances;
+
+SELECT @@GLOBAL.metadata_locks_hash_instances;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@local.metadata_locks_hash_instances;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.metadata_locks_hash_instances;
diff --git a/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test
index c35949ac5f3..1aa25fa2c8e 100644
--- a/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test
@@ -60,10 +60,10 @@ SELECT @@session.myisam_sort_buffer_size ;
########################################################################
SET @@global.myisam_sort_buffer_size = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size = 8388608;
+SELECT @@global.myisam_sort_buffer_size = 134216704;
SET @@session.myisam_sort_buffer_size = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size = 8388608;
+SELECT @@session.myisam_sort_buffer_size = 134216704;
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/old_mode_basic.test b/mysql-test/suite/sys_vars/t/old_mode_basic.test
index 6770219887d..93a93960836 100644
--- a/mysql-test/suite/sys_vars/t/old_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/old_mode_basic.test
@@ -168,10 +168,13 @@ SELECT @@global.old_mode;
SET @@global.old_mode = 2;
SELECT @@global.old_mode;
---Error ER_WRONG_VALUE_FOR_VAR
SET @@global.old_mode = 4;
SELECT @@global.old_mode;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.old_mode = 8;
+SELECT @@global.old_mode;
+
# use of decimal values
--Error ER_WRONG_TYPE_FOR_VAR
diff --git a/mysql-test/suite/sys_vars/t/optimizer_selectivity_sampling_limit_basic.test b/mysql-test/suite/sys_vars/t/optimizer_selectivity_sampling_limit_basic.test
new file mode 100644
index 00000000000..232ff99db74
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/optimizer_selectivity_sampling_limit_basic.test
@@ -0,0 +1,154 @@
+
+--source include/load_sysvars.inc
+
+#################################################################
+# START OF optimizer_selectivity_sampling_limit TESTS #
+#################################################################
+
+
+#############################################################
+# Save initial value #
+#############################################################
+
+SET @start_global_value = @@global.optimizer_selectivity_sampling_limit;
+SELECT @start_global_value;
+SET @start_session_value = @@session.optimizer_selectivity_sampling_limit;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_115_01-------------------------#'
+#########################################################################
+# Display the DEFAULT value of optimizer_selectivity_sampling_limit #
+#########################################################################
+
+SET @@global.optimizer_selectivity_sampling_limit = DEFAULT;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+
+SET @@session.optimizer_selectivity_sampling_limit = DEFAULT;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+
+
+--echo '#--------------------FN_DYNVARS_115_02-------------------------#'
+#########################################################################
+# Check the DEFAULT value of optimizer_selectivity_sampling_limit #
+#########################################################################
+
+SET @@global.optimizer_selectivity_sampling_limit = DEFAULT;
+SELECT @@global.optimizer_selectivity_sampling_limit = 100;
+
+SET @@session.optimizer_selectivity_sampling_limit = DEFAULT;
+SELECT @@session.optimizer_selectivity_sampling_limit = 100;
+
+
+--echo '#--------------------FN_DYNVARS_115_03-------------------------#'
+#############################################################################################
+# Change the value of optimizer_selectivity_sampling_limit to a valid value for GLOBAL Scope #
+#############################################################################################
+
+SELECT @@global.optimizer_selectivity_sampling_limit;
+SET @@global.optimizer_selectivity_sampling_limit = 9;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+SET @@global.optimizer_selectivity_sampling_limit = 10;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+SET @@global.optimizer_selectivity_sampling_limit = 11;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+SET @@global.optimizer_selectivity_sampling_limit = 7777;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+SET @@global.optimizer_selectivity_sampling_limit = 4294967294;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+SET @@global.optimizer_selectivity_sampling_limit = 4294967295;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+SET @@global.optimizer_selectivity_sampling_limit = 4294967296;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+
+
+--echo '#--------------------FN_DYNVARS_115_04-------------------------#'
+#############################################################################################
+# Change the value of optimizer_selectivity_sampling_limit to a valid value for SESSION Scope#
+#############################################################################################
+
+SELECT @@session.optimizer_selectivity_sampling_limit;
+SET @@session.optimizer_selectivity_sampling_limit = 9;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+SET @@session.optimizer_selectivity_sampling_limit = 10;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+SET @@session.optimizer_selectivity_sampling_limit = 11;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+SET @@session.optimizer_selectivity_sampling_limit = 7777;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+SET @@session.optimizer_selectivity_sampling_limit = 4294967294;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+SET @@session.optimizer_selectivity_sampling_limit = 4294967295;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+SET @@session.optimizer_selectivity_sampling_limit = 4294967296;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+
+
+--echo '#------------------FN_DYNVARS_115_05-----------------------#'
+###############################################################################
+# Change the value of optimizer_selectivity_sampling_limit to an invalid value #
+##############################################################################
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.optimizer_selectivity_sampling_limit = ON;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.optimizer_selectivity_sampling_limit = OFF;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.optimizer_selectivity_sampling_limit = 65530.34;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.optimizer_selectivity_sampling_limit = test;
+
+--echo '#------------------FN_DYNVARS_115_06-----------------------#'
+####################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+####################################################################
+
+
+SELECT @@global.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='optimizer_selectivity_sampling_limit';
+
+--echo '#------------------FN_DYNVARS_115_07-----------------------#'
+####################################################################
+# Check if the value in SESSION Table matches value in variable #
+####################################################################
+
+SELECT @@session.optimizer_selectivity_sampling_limit = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='optimizer_selectivity_sampling_limit';
+
+
+--echo '#---------------------FN_DYNVARS_115_08----------------------#'
+###############################################################################
+# Check if global and session variable are independent of each other #
+###############################################################################
+
+SET @@optimizer_selectivity_sampling_limit = 10;
+SET @@global.optimizer_selectivity_sampling_limit = 30;
+SELECT @@optimizer_selectivity_sampling_limit = @@global.optimizer_selectivity_sampling_limit;
+
+
+--echo '#---------------------FN_DYNVARS_115_09----------------------#'
+###############################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points #
+# to same session variable #
+###############################################################################
+
+SET @@optimizer_selectivity_sampling_limit = 20;
+SELECT @@optimizer_selectivity_sampling_limit = @@local.optimizer_selectivity_sampling_limit;
+SELECT @@local.optimizer_selectivity_sampling_limit = @@session.optimizer_selectivity_sampling_limit;
+
+
+####################################
+# Restore initial value #
+####################################
+
+SET @@global.optimizer_selectivity_sampling_limit = @start_global_value;
+SELECT @@global.optimizer_selectivity_sampling_limit;
+SET @@session.optimizer_selectivity_sampling_limit = @start_session_value;
+SELECT @@session.optimizer_selectivity_sampling_limit;
+
+########################################################################
+# END OF optimizer_selectivity_sampling_limit TESTS #
+########################################################################
+
diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown1-master.opt b/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown1-master.opt
deleted file mode 100644
index 89aa07976ac..00000000000
--- a/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown1-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---optimizer-switch=engine_condition_pushdown=off --engine-condition-pushdown=1
diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown1.test b/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown1.test
deleted file mode 100644
index 187aa145408..00000000000
--- a/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown1.test
+++ /dev/null
@@ -1,5 +0,0 @@
-# check how --engine-condition-pushdown and --optimizer-switch
-# influence each other when used together (last wins).
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown2-master.opt b/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown2-master.opt
deleted file mode 100644
index f48ab5b963b..00000000000
--- a/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown2-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---engine-condition-pushdown=1 --optimizer-switch=engine_condition_pushdown=off
diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown2.test b/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown2.test
deleted file mode 100644
index 187aa145408..00000000000
--- a/mysql-test/suite/sys_vars/t/optimizer_switch_eng_cond_pushdown2.test
+++ /dev/null
@@ -1,5 +0,0 @@
-# check how --engine-condition-pushdown and --optimizer-switch
-# influence each other when used together (last wins).
-select @@session.engine_condition_pushdown,
-@@global.engine_condition_pushdown,
-@@session.optimizer_switch, @@global.optimizer_switch;
diff --git a/mysql-test/suite/sys_vars/t/optimizer_use_condition_selectivity_basic.test b/mysql-test/suite/sys_vars/t/optimizer_use_condition_selectivity_basic.test
new file mode 100644
index 00000000000..c409abd0d1b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/optimizer_use_condition_selectivity_basic.test
@@ -0,0 +1,154 @@
+
+--source include/load_sysvars.inc
+
+#################################################################
+# START OF optimizer_use_condition_selectivity TESTS #
+#################################################################
+
+
+#############################################################
+# Save initial value #
+#############################################################
+
+SET @start_global_value = @@global.optimizer_use_condition_selectivity;
+SELECT @start_global_value;
+SET @start_session_value = @@session.optimizer_use_condition_selectivity;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_115_01-------------------------#'
+#########################################################################
+# Display the DEFAULT value of optimizer_use_condition_selectivity #
+#########################################################################
+
+SET @@global.optimizer_use_condition_selectivity = DEFAULT;
+SELECT @@global.optimizer_use_condition_selectivity;
+
+SET @@session.optimizer_use_condition_selectivity = DEFAULT;
+SELECT @@session.optimizer_use_condition_selectivity;
+
+
+--echo '#--------------------FN_DYNVARS_115_02-------------------------#'
+#########################################################################
+# Check the DEFAULT value of optimizer_use_condition_selectivity #
+#########################################################################
+
+SET @@global.optimizer_use_condition_selectivity = DEFAULT;
+SELECT @@global.optimizer_use_condition_selectivity = 1;
+
+SET @@session.optimizer_use_condition_selectivity = DEFAULT;
+SELECT @@session.optimizer_use_condition_selectivity = 1;
+
+
+--echo '#--------------------FN_DYNVARS_115_03-------------------------#'
+#############################################################################################
+# Change the value of optimizer_use_condition_selectivity to a valid value for GLOBAL Scope #
+#############################################################################################
+
+SELECT @@global.optimizer_use_condition_selectivity;
+SET @@global.optimizer_use_condition_selectivity = 0;
+SELECT @@global.optimizer_use_condition_selectivity;
+SET @@global.optimizer_use_condition_selectivity = 1;
+SELECT @@global.optimizer_use_condition_selectivity;
+SET @@global.optimizer_use_condition_selectivity = 2;
+SELECT @@global.optimizer_use_condition_selectivity;
+SET @@global.optimizer_use_condition_selectivity = 3;
+SELECT @@global.optimizer_use_condition_selectivity;
+SET @@global.optimizer_use_condition_selectivity = 4;
+SELECT @@global.optimizer_use_condition_selectivity;
+SET @@global.optimizer_use_condition_selectivity = 5;
+SELECT @@global.optimizer_use_condition_selectivity;
+SET @@global.optimizer_use_condition_selectivity = 6;
+SELECT @@global.optimizer_use_condition_selectivity;
+
+
+--echo '#--------------------FN_DYNVARS_115_04-------------------------#'
+#############################################################################################
+# Change the value of optimizer_use_condition_selectivity to a valid value for SESSION Scope#
+#############################################################################################
+
+SELECT @@session.optimizer_use_condition_selectivity;
+SET @@session.optimizer_use_condition_selectivity = 0;
+SELECT @@session.optimizer_use_condition_selectivity;
+SET @@session.optimizer_use_condition_selectivity = 1;
+SELECT @@session.optimizer_use_condition_selectivity;
+SET @@session.optimizer_use_condition_selectivity = 2;
+SELECT @@session.optimizer_use_condition_selectivity;
+SET @@session.optimizer_use_condition_selectivity = 3;
+SELECT @@session.optimizer_use_condition_selectivity;
+SET @@session.optimizer_use_condition_selectivity = 4;
+SELECT @@session.optimizer_use_condition_selectivity;
+SET @@session.optimizer_use_condition_selectivity = 5;
+SELECT @@session.optimizer_use_condition_selectivity;
+SET @@session.optimizer_use_condition_selectivity = 6;
+SELECT @@session.optimizer_use_condition_selectivity;
+
+
+--echo '#------------------FN_DYNVARS_115_05-----------------------#'
+###############################################################################
+# Change the value of optimizer_use_condition_selectivity to an invalid value #
+##############################################################################
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.optimizer_use_condition_selectivity = ON;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.optimizer_use_condition_selectivity = OFF;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.optimizer_use_condition_selectivity = 65530.34;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.optimizer_use_condition_selectivity = test;
+
+--echo '#------------------FN_DYNVARS_115_06-----------------------#'
+####################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+####################################################################
+
+
+SELECT @@global.optimizer_use_condition_selectivity = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='optimizer_use_condition_selectivity';
+
+--echo '#------------------FN_DYNVARS_115_07-----------------------#'
+####################################################################
+# Check if the value in SESSION Table matches value in variable #
+####################################################################
+
+SELECT @@session.optimizer_use_condition_selectivity = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='optimizer_use_condition_selectivity';
+
+
+--echo '#---------------------FN_DYNVARS_115_08----------------------#'
+###############################################################################
+# Check if global and session variable are independent of each other #
+###############################################################################
+
+SET @@optimizer_use_condition_selectivity = 1;
+SET @@global.optimizer_use_condition_selectivity = 3;
+SELECT @@optimizer_use_condition_selectivity = @@global.optimizer_use_condition_selectivity;
+
+
+--echo '#---------------------FN_DYNVARS_115_09----------------------#'
+###############################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points #
+# to same session variable #
+###############################################################################
+
+SET @@optimizer_use_condition_selectivity = 2;
+SELECT @@optimizer_use_condition_selectivity = @@local.optimizer_use_condition_selectivity;
+SELECT @@local.optimizer_use_condition_selectivity = @@session.optimizer_use_condition_selectivity;
+
+
+####################################
+# Restore initial value #
+####################################
+
+SET @@global.optimizer_use_condition_selectivity = @start_global_value;
+SELECT @@global.optimizer_use_condition_selectivity;
+SET @@session.optimizer_use_condition_selectivity = @start_session_value;
+SELECT @@session.optimizer_use_condition_selectivity;
+
+########################################################################
+# END OF optimizer_use_condition_selectivity TESTS #
+########################################################################
+
diff --git a/mysql-test/suite/sys_vars/t/oqgraph_allow_create_integer_latch_basic.test b/mysql-test/suite/sys_vars/t/oqgraph_allow_create_integer_latch_basic.test
new file mode 100644
index 00000000000..62e4d570f71
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/oqgraph_allow_create_integer_latch_basic.test
@@ -0,0 +1 @@
+--echo Oqgraph extention
diff --git a/mysql-test/suite/sys_vars/t/pfs_accounts_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_accounts_size_basic-master.opt
new file mode 100644
index 00000000000..a51860b00fa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_accounts_size_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-accounts-size=123
diff --git a/mysql-test/suite/sys_vars/t/pfs_accounts_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_accounts_size_basic.test
new file mode 100644
index 00000000000..b055805d773
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_accounts_size_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_accounts_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_accounts_size;
+
+show global variables like 'performance_schema_accounts_size';
+
+show session variables like 'performance_schema_accounts_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_accounts_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_accounts_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_accounts_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_accounts_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt b/mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt
new file mode 100644
index 00000000000..d0a5cbebdd7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_digests_size-master_basic.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-digests-size=200
diff --git a/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test
new file mode 100644
index 00000000000..29b4232b7fa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test
@@ -0,0 +1,47 @@
+# Copyright (C) 2010 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
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_digests_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_digests_size;
+
+show global variables like 'performance_schema_digests_size';
+
+show session variables like 'performance_schema_digests_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_digests_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_digests_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_digests_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_digests_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_events_stages_history_long_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_events_stages_history_long_size_basic-master.opt
new file mode 100644
index 00000000000..b3aa4a08e1e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_events_stages_history_long_size_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-events-stages-history-long-size=15000
diff --git a/mysql-test/suite/sys_vars/t/pfs_events_stages_history_long_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_events_stages_history_long_size_basic.test
new file mode 100644
index 00000000000..ab17ccf676e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_events_stages_history_long_size_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_events_stages_history_long_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_events_stages_history_long_size;
+
+show global variables like 'performance_schema_events_stages_history_long_size';
+
+show session variables like 'performance_schema_events_stages_history_long_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_events_stages_history_long_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_events_stages_history_long_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_events_stages_history_long_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_events_stages_history_long_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_events_stages_history_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_events_stages_history_size_basic-master.opt
new file mode 100644
index 00000000000..a0ba6e81943
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_events_stages_history_size_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-events-stages-history-size=15
diff --git a/mysql-test/suite/sys_vars/t/pfs_events_stages_history_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_events_stages_history_size_basic.test
new file mode 100644
index 00000000000..2b85c97a96f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_events_stages_history_size_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_events_stages_history_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_events_stages_history_size;
+
+show global variables like 'performance_schema_events_stages_history_size';
+
+show session variables like 'performance_schema_events_stages_history_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_events_stages_history_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_events_stages_history_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_events_stages_history_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_events_stages_history_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_events_statements_history_long_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_events_statements_history_long_size_basic-master.opt
new file mode 100644
index 00000000000..4ea716e3835
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_events_statements_history_long_size_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-events-statements-history-long-size=15000
diff --git a/mysql-test/suite/sys_vars/t/pfs_events_statements_history_long_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_events_statements_history_long_size_basic.test
new file mode 100644
index 00000000000..116fd738d4e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_events_statements_history_long_size_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_events_statements_history_long_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_events_statements_history_long_size;
+
+show global variables like 'performance_schema_events_statements_history_long_size';
+
+show session variables like 'performance_schema_events_statements_history_long_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_events_statements_history_long_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_events_statements_history_long_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_events_statements_history_long_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_events_statements_history_long_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_events_statements_history_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_events_statements_history_size_basic-master.opt
new file mode 100644
index 00000000000..70e70d56b6e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_events_statements_history_size_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-events-statements-history-size=15
diff --git a/mysql-test/suite/sys_vars/t/pfs_events_statements_history_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_events_statements_history_size_basic.test
new file mode 100644
index 00000000000..60839714202
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_events_statements_history_size_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_events_statements_history_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_events_statements_history_size;
+
+show global variables like 'performance_schema_events_statements_history_size';
+
+show session variables like 'performance_schema_events_statements_history_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_events_statements_history_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_events_statements_history_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_events_statements_history_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_events_statements_history_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_hosts_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_hosts_size_basic-master.opt
new file mode 100644
index 00000000000..4f122ac72f4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_hosts_size_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-hosts-size=123
diff --git a/mysql-test/suite/sys_vars/t/pfs_hosts_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_hosts_size_basic.test
new file mode 100644
index 00000000000..4830757fc72
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_hosts_size_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_hosts_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_hosts_size;
+
+show global variables like 'performance_schema_hosts_size';
+
+show session variables like 'performance_schema_hosts_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_hosts_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_hosts_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_hosts_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_hosts_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_digest_length-master_basic.opt b/mysql-test/suite/sys_vars/t/pfs_max_digest_length-master_basic.opt
new file mode 100644
index 00000000000..a98eb86d2e6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_max_digest_length-master_basic.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-max_digest_length=1024
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test
new file mode 100644
index 00000000000..5c89dbda07f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test
@@ -0,0 +1,47 @@
+# Copyright (C) 2010 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
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_max_digest_length;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_max_digest_length;
+
+show global variables like 'performance_schema_max_digest_length';
+
+show session variables like 'performance_schema_max_digest_length';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_max_digest_length';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_max_digest_length';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_max_digest_length=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_max_digest_length=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_socket_classes_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_socket_classes_basic-master.opt
new file mode 100644
index 00000000000..eb8cd536056
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_max_socket_classes_basic-master.opt
@@ -0,0 +1 @@
+--loose-enable-performance-schema --loose-performance-schema-max-socket-classes=123
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_socket_classes_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_socket_classes_basic.test
new file mode 100644
index 00000000000..01251be419e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_max_socket_classes_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_max_socket_classes;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_max_socket_classes;
+
+show global variables like 'performance_schema_max_socket_classes';
+
+show session variables like 'performance_schema_max_socket_classes';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_max_socket_classes';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_max_socket_classes';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_max_socket_classes=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_max_socket_classes=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_socket_instances_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_socket_instances_basic-master.opt
new file mode 100644
index 00000000000..e3c3d0690fb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_max_socket_instances_basic-master.opt
@@ -0,0 +1 @@
+--loose-enable-performance-schema --loose-performance-schema-max-socket-instances=123
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_socket_instances_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_socket_instances_basic.test
new file mode 100644
index 00000000000..e370d6c064e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_max_socket_instances_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_max_socket_instances;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_max_socket_instances;
+
+show global variables like 'performance_schema_max_socket_instances';
+
+show session variables like 'performance_schema_max_socket_instances';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_max_socket_instances';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_max_socket_instances';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_max_socket_instances=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_max_socket_instances=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_stage_classes_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_stage_classes_basic-master.opt
new file mode 100644
index 00000000000..0e2130c3408
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_max_stage_classes_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-max-stage_classes=123
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_stage_classes_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_stage_classes_basic.test
new file mode 100644
index 00000000000..19bc8d09fe2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_max_stage_classes_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_max_stage_classes;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_max_stage_classes;
+
+show global variables like 'performance_schema_max_stage_classes';
+
+show session variables like 'performance_schema_max_stage_classes';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_max_stage_classes';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_max_stage_classes';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_max_stage_classes=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_max_stage_classes=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_statement_classes_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_statement_classes_basic-master.opt
new file mode 100644
index 00000000000..1041dce704b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_max_statement_classes_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-max-statement_classes=123
diff --git a/mysql-test/suite/sys_vars/t/pfs_max_statement_classes_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_statement_classes_basic.test
new file mode 100644
index 00000000000..f83aa317123
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_max_statement_classes_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_max_statement_classes;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_max_statement_classes;
+
+show global variables like 'performance_schema_max_statement_classes';
+
+show session variables like 'performance_schema_max_statement_classes';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_max_statement_classes';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_max_statement_classes';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_max_statement_classes=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_max_statement_classes=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic-master.opt
new file mode 100644
index 00000000000..dcbb8a0bef2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-session-connect-attrs-size=2048
diff --git a/mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic.test
new file mode 100644
index 00000000000..c10700b8903
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_session_connect_attrs_size_basic.test
@@ -0,0 +1,47 @@
+# Copyright (C) 2012 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_session_connect_attrs_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_session_connect_attrs_size;
+
+show global variables like 'performance_schema_session_connect_attrs_size';
+
+show session variables like 'performance_schema_session_connect_attrs_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_session_connect_attrs_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_session_connect_attrs_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_session_connect_attrs_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_session_connect_attrs_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_setup_actors_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_setup_actors_size_basic-master.opt
new file mode 100644
index 00000000000..33157f9f82e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_setup_actors_size_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-setup-actors-size=123
diff --git a/mysql-test/suite/sys_vars/t/pfs_setup_actors_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_setup_actors_size_basic.test
new file mode 100644
index 00000000000..6cfb38b4036
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_setup_actors_size_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_setup_actors_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_setup_actors_size;
+
+show global variables like 'performance_schema_setup_actors_size';
+
+show session variables like 'performance_schema_setup_actors_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_setup_actors_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_setup_actors_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_setup_actors_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_setup_actors_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_setup_objects_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_setup_objects_size_basic-master.opt
new file mode 100644
index 00000000000..b2ecaa079fb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_setup_objects_size_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-setup-objects-size=123
diff --git a/mysql-test/suite/sys_vars/t/pfs_setup_objects_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_setup_objects_size_basic.test
new file mode 100644
index 00000000000..9f21a7e3b97
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_setup_objects_size_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_setup_objects_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_setup_objects_size;
+
+show global variables like 'performance_schema_setup_objects_size';
+
+show session variables like 'performance_schema_setup_objects_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_setup_objects_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_setup_objects_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_setup_objects_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_setup_objects_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/pfs_users_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_users_size_basic-master.opt
new file mode 100644
index 00000000000..b64162b4e79
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_users_size_basic-master.opt
@@ -0,0 +1,2 @@
+--loose-enable-performance-schema
+--loose-performance-schema-users-size=123
diff --git a/mysql-test/suite/sys_vars/t/pfs_users_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_users_size_basic.test
new file mode 100644
index 00000000000..15012227614
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/pfs_users_size_basic.test
@@ -0,0 +1,32 @@
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+#
+# Only global
+#
+
+select @@global.performance_schema_users_size;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.performance_schema_users_size;
+
+show global variables like 'performance_schema_users_size';
+
+show session variables like 'performance_schema_users_size';
+
+select * from information_schema.global_variables
+ where variable_name='performance_schema_users_size';
+
+select * from information_schema.session_variables
+ where variable_name='performance_schema_users_size';
+
+#
+# Read-only
+#
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global performance_schema_users_size=1;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session performance_schema_users_size=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
index 903289230bd..dfe64dd4e8d 100644
--- a/mysql-test/suite/sys_vars/t/report_port_basic.test
+++ b/mysql-test/suite/sys_vars/t/report_port_basic.test
@@ -2,7 +2,7 @@
#
# only global
#
---replace_regex s/[0-9]+/DEFAULT_MASTER_PORT/
+--replace_regex /[0-9]+/DEFAULT_MASTER_PORT/
select @@global.report_port;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.report_port;
diff --git a/mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func-master.opt b/mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func-master.opt
index bff213dfb0b..89d47e66948 100644
--- a/mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/rpl_max_binlog_size_func-master.opt
@@ -1,2 +1,3 @@
---log --log-bin=mylog.log
+--general-log
+--log-bin=mylog.log
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test
index ded489f36ff..2ff03a53c42 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test
@@ -6,10 +6,7 @@
#
#
source include/not_embedded.inc;
-source include/have_semisync_plugin.inc;
-# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
---replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
+source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_enabled;
SET @start_global_value = @@global.rpl_semi_sync_master_enabled;
@@ -61,5 +58,3 @@ set global rpl_semi_sync_master_enabled="some text";
#
SET @@global.rpl_semi_sync_master_enabled = @start_global_value;
select @@global.rpl_semi_sync_master_enabled;
-UNINSTALL PLUGIN rpl_semi_sync_master;
-
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test
index 5258894150d..74d3c41150b 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test
@@ -5,10 +5,7 @@
# 2010-01-21 OBN - Added
#
source include/not_embedded.inc;
-source include/have_semisync_plugin.inc;
-# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
---replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
+source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_timeout;
SET @start_global_value = @@global.rpl_semi_sync_master_timeout;
@@ -51,5 +48,3 @@ set global rpl_semi_sync_master_timeout="some text";
#
SET @@global.rpl_semi_sync_master_timeout = @start_global_value;
select @@global.rpl_semi_sync_master_timeout;
-UNINSTALL PLUGIN rpl_semi_sync_master;
-
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test
index d9b1d860b35..c41b53fe5e6 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test
@@ -5,10 +5,7 @@
# 2010-01-21 OBN - Added
#
source include/not_embedded.inc;
-source include/have_semisync_plugin.inc;
-# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
---replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
+source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_trace_level;
SET @start_global_value = @@global.rpl_semi_sync_master_trace_level;
@@ -59,5 +56,3 @@ set global rpl_semi_sync_master_trace_level="some text";
#
SET @@global.rpl_semi_sync_master_trace_level = @start_global_value;
select @@global.rpl_semi_sync_master_trace_level;
-UNINSTALL PLUGIN rpl_semi_sync_master;
-
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test
index 896bd50d156..d4a46a08140 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test
@@ -6,10 +6,7 @@
#
#
source include/not_embedded.inc;
-source include/have_semisync_plugin.inc;
-# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
---replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
+source include/have_semisync.inc;
select @@global.rpl_semi_sync_master_wait_no_slave;
SET @start_global_value = @@global.rpl_semi_sync_master_wait_no_slave;
@@ -61,5 +58,4 @@ set global rpl_semi_sync_master_wait_no_slave="some text";
#
SET @@global.rpl_semi_sync_master_wait_no_slave = @start_global_value;
select @@global.rpl_semi_sync_master_wait_no_slave;
-UNINSTALL PLUGIN rpl_semi_sync_master;
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test
index 030b0827a11..c7ce371970d 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test
@@ -6,10 +6,7 @@
#
#
source include/not_embedded.inc;
-source include/have_semisync_plugin.inc;
-# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
---replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
+source include/have_semisync.inc;
select @@global.rpl_semi_sync_slave_enabled;
SET @start_global_value = @@global.rpl_semi_sync_slave_enabled;
@@ -62,5 +59,3 @@ set global rpl_semi_sync_slave_enabled="some text";
#
SET @@global.rpl_semi_sync_slave_enabled = @start_global_value;
select @@global.rpl_semi_sync_slave_enabled;
-UNINSTALL PLUGIN rpl_semi_sync_slave;
-
diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test
index 64c935ee957..d7e001b7322 100644
--- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test
+++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test
@@ -5,10 +5,7 @@
# 2010-01-21 OBN - Added
#
source include/not_embedded.inc;
-source include/have_semisync_plugin.inc;
-# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll'
---replace_regex /\.dll/.so/
-eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
+source include/have_semisync.inc;
select @@global.rpl_semi_sync_slave_trace_level;
SET @start_global_value = @@global.rpl_semi_sync_slave_trace_level;
@@ -59,5 +56,3 @@ set global rpl_semi_sync_slave_trace_level="some text";
#
SET @@global.rpl_semi_sync_slave_trace_level = @start_global_value;
select @@global.rpl_semi_sync_slave_trace_level;
-UNINSTALL PLUGIN rpl_semi_sync_slave;
-
diff --git a/mysql-test/suite/sys_vars/t/server_id_basic.test b/mysql-test/suite/sys_vars/t/server_id_basic.test
index 9d41823053a..6940270c12e 100644
--- a/mysql-test/suite/sys_vars/t/server_id_basic.test
+++ b/mysql-test/suite/sys_vars/t/server_id_basic.test
@@ -82,14 +82,15 @@ SELECT @@global.server_id;
# Check if variable can be access with session scope #
#################################################################################
---Error ER_GLOBAL_VARIABLE
+SELECT @@server_id;
SET @@server_id = 2;
+SELECT @@server_id;
---Error ER_GLOBAL_VARIABLE
SET @@session.server_id = 3;
+SELECT @@server_id;
---Error ER_GLOBAL_VARIABLE
SET @@local.server_id = 4;
+--Error ER_GLOBAL_VARIABLE
@@ -163,7 +164,6 @@ SELECT @@server_id = @@global.server_id;
# Check if server_id can be accessed without @@ sign and scope #
##################################################################################
---Error ER_GLOBAL_VARIABLE
SET server_id = 2048;
--Error ER_BAD_FIELD_ERROR
SELECT server_id;
diff --git a/mysql-test/suite/sys_vars/t/slave_ddl_exec_mode_basic.test b/mysql-test/suite/sys_vars/t/slave_ddl_exec_mode_basic.test
new file mode 100644
index 00000000000..64f8a75f443
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_ddl_exec_mode_basic.test
@@ -0,0 +1,67 @@
+############## mysql-test\t\slave_ddl_exec_mode_basic.test ####################
+# #
+# Variable Name: slave_ddl_exec_mode #
+# Scope: GLOBAL & SESSION #
+# Access Type: Dynamic #
+# Data Type: Numeric #
+# Default Value: 1 #
+# Range: 1 - 65536 #
+# #
+# #
+# Description: Test Cases of Dynamic System Variable slave_ddl_exec_mode #
+# that checks the behavior of this variable in the following ways#
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity #
+# #
+###############################################################################
+
+--source include/not_embedded.inc
+--source include/load_sysvars.inc
+
+########################################################################
+# START OF slave_ddl_exec_mode TESTS #
+########################################################################
+
+SET @start_value = @@global.slave_ddl_exec_mode;
+
+SELECT @@global.slave_ddl_exec_mode;
+
+SELECT @@slave_ddl_exec_mode = @@GLOBAL.slave_ddl_exec_mode;
+--echo 1 Expected
+
+SELECT COUNT(@@slave_ddl_exec_mode);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.slave_ddl_exec_mode);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.slave_ddl_exec_mode);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.slave_ddl_exec_mode);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT slave_ddl_exec_mode = @@SESSION.version;
+--echo Expected error 'Readonly variable'
+
+
+SET @@GLOBAL.slave_ddl_exec_mode=STRICT;
+SELECT @@GLOBAL.slave_ddl_exec_mode;
+
+SET @@GLOBAL.slave_ddl_exec_mode=IDEMPOTENT;
+SELECT @@GLOBAL.slave_ddl_exec_mode;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@GLOBAL.slave_ddl_exec_mode=XXX;
+SELECT @@GLOBAL.slave_ddl_exec_mode;
+
+SET @@global.slave_ddl_exec_mode= @start_value;
+
+########################################################################
+# END OF slave_ddl_exec_mode TESTS #
+########################################################################
diff --git a/mysql-test/suite/sys_vars/t/slave_domain_parallel_threads_basic.test b/mysql-test/suite/sys_vars/t/slave_domain_parallel_threads_basic.test
new file mode 100644
index 00000000000..7be48fbd4c5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_domain_parallel_threads_basic.test
@@ -0,0 +1,14 @@
+--source include/not_embedded.inc
+
+SET @save_slave_domain_parallel_threads= @@GLOBAL.slave_domain_parallel_threads;
+
+SELECT @@GLOBAL.slave_domain_parallel_threads as 'must be zero because of default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.slave_domain_parallel_threads as 'no session var';
+
+SET GLOBAL slave_domain_parallel_threads= 0;
+SET GLOBAL slave_domain_parallel_threads= DEFAULT;
+SET GLOBAL slave_domain_parallel_threads= 10;
+SELECT @@GLOBAL.slave_domain_parallel_threads;
+
+SET GLOBAL slave_domain_parallel_threads = @save_slave_domain_parallel_threads;
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_max_queued_basic.test b/mysql-test/suite/sys_vars/t/slave_parallel_max_queued_basic.test
new file mode 100644
index 00000000000..e3d3a9365f1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_max_queued_basic.test
@@ -0,0 +1,14 @@
+--source include/not_embedded.inc
+
+SET @save_slave_parallel_max_queued= @@GLOBAL.slave_parallel_max_queued;
+
+SELECT @@GLOBAL.slave_parallel_max_queued as 'Check default';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.slave_parallel_max_queued as 'no session var';
+
+SET GLOBAL slave_parallel_max_queued= 0;
+SET GLOBAL slave_parallel_max_queued= DEFAULT;
+SET GLOBAL slave_parallel_max_queued= 65536;
+SELECT @@GLOBAL.slave_parallel_max_queued;
+
+SET GLOBAL slave_parallel_max_queued = @save_slave_parallel_max_queued;
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf
new file mode 100644
index 00000000000..02bdb44e1de
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf
@@ -0,0 +1,5 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld.1]
+slave_parallel_threads=20
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test
new file mode 100644
index 00000000000..b567b7f8854
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test
@@ -0,0 +1,21 @@
+--source include/not_embedded.inc
+
+SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads;
+
+# Check that we don't spawn worker threads at server startup, when no
+# slave is configured (MDEV-5289).
+SELECT IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 20 because of .cnf';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.slave_parallel_threads as 'no session var';
+
+SET GLOBAL slave_parallel_threads= 0;
+SET GLOBAL slave_parallel_threads= DEFAULT;
+SELECT @@GLOBAL.slave_parallel_threads as 'must be 0 because of default';
+SET GLOBAL slave_parallel_threads= 10;
+SELECT @@GLOBAL.slave_parallel_threads;
+# Check that we don't spawn worker threads when no slave is started.
+SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user";
+
+SET GLOBAL slave_parallel_threads = @save_slave_parallel_threads;
diff --git a/mysql-test/suite/sys_vars/t/sql_big_selects_func.test b/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
index 4aefda5e15e..6cff8cfe553 100644
--- a/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
@@ -28,7 +28,7 @@
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;
+SET MAX_JOIN_SIZE=9;
#
# Create tables
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
deleted file mode 100644
index 373ae06c850..00000000000
--- a/mysql-test/suite/sys_vars/t/sql_big_tables_basic.test
+++ /dev/null
@@ -1,170 +0,0 @@
-###################### mysql-test\t\sql_big_tables_basic.test #################
-# #
-# Variable Name: sql_big_tables #
-# Scope: SESSION #
-# Access Type: Dynamic #
-# Data Type: boolean #
-# Default Value: #
-# Valid Values : 0,1 #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author: Rizwan #
-# #
-# Description: Test Cases of Dynamic System Variable sql_big_tables #
-# that checks the 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-system-variables.html #
-# #
-###############################################################################
-
---source include/load_sysvars.inc
-########################################################################
-# START OF sql_big_tables TESTS #
-########################################################################
-
-
-##############################################################################
-# Saving initial value of sql_big_tables in a temporary variable #
-##############################################################################
-
-SET @session_start_value = @@session.sql_big_tables;
-SELECT @session_start_value;
-
---echo '#--------------------FN_DYNVARS_154_01------------------------#'
-########################################################################
-# Display the DEFAULT value of sql_big_tables #
-########################################################################
-
-SET @@session.sql_big_tables = 0;
-SET @@session.sql_big_tables = DEFAULT;
-SELECT @@session.sql_big_tables;
-
-SET @@session.sql_big_tables = 1;
-SET @@session.sql_big_tables = DEFAULT;
-SELECT @@session.sql_big_tables;
-
-
---echo '#---------------------FN_DYNVARS_154_02-------------------------#'
-#############################################################################
-# Check if sql_big_tables can be accessed with and without @@ sign #
-#############################################################################
-
-SET sql_big_tables = 1;
-SELECT @@sql_big_tables;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.sql_big_tables;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.sql_big_tables;
-
-SET session sql_big_tables = 0;
-SELECT @@session.sql_big_tables;
-
-
---echo '#--------------------FN_DYNVARS_154_03------------------------#'
-########################################################################
-# change the value of sql_big_tables to a valid value #
-########################################################################
-
-SET @@session.sql_big_tables = 0;
-SELECT @@session.sql_big_tables;
-SET @@session.sql_big_tables = 1;
-SELECT @@session.sql_big_tables;
-
-
---echo '#--------------------FN_DYNVARS_154_04-------------------------#'
-###########################################################################
-# Change the value of sql_big_tables to invalid value #
-###########################################################################
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_big_tables = -1;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_big_tables = 2;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_big_tables = "T";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_big_tables = "Y";
---Error ER_WRONG_VALUE_FOR_VAR
-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;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_big_tables = ÓFF;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_big_tables = '¹';
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_big_tables = NO;
-
-
---echo '#-------------------FN_DYNVARS_154_05----------------------------#'
-###########################################################################
-# Test if accessing global sql_big_tables gives error #
-###########################################################################
-
-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------------------------#'
-#########################################################################
-# Check if the value in GLOBAL Table contains variable value #
-#########################################################################
-
-SELECT count(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='sql_big_tables';
-
---echo '#----------------------FN_DYNVARS_154_07------------------------#'
-#########################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-#########################################################################
-
-SELECT IF(@@session.sql_big_tables, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='sql_big_tables';
-SELECT @@session.sql_big_tables;
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='sql_big_tables';
-
---echo '#---------------------FN_DYNVARS_154_08-------------------------#'
-###################################################################
-# Check if ON and OFF values can be used on variable #
-###################################################################
-
-SET @@session.sql_big_tables = OFF;
-SELECT @@session.sql_big_tables;
-SET @@session.sql_big_tables = ON;
-SELECT @@session.sql_big_tables;
-
---echo '#---------------------FN_DYNVARS_154_09----------------------#'
-###################################################################
-# Check if TRUE and FALSE values can be used on variable #
-###################################################################
-
-SET @@session.sql_big_tables = TRUE;
-SELECT @@session.sql_big_tables;
-SET @@session.sql_big_tables = FALSE;
-SELECT @@session.sql_big_tables;
-
-##############################
-# Restore initial value #
-##############################
-
-SET @@session.sql_big_tables = @session_start_value;
-SELECT @@session.sql_big_tables;
-
-###############################################################
-# END OF sql_big_tables TESTS #
-###############################################################
diff --git a/mysql-test/suite/sys_vars/t/sql_big_tables_func.test b/mysql-test/suite/sys_vars/t/sql_big_tables_func.test
deleted file mode 100644
index 8bbec202efa..00000000000
--- a/mysql-test/suite/sys_vars/t/sql_big_tables_func.test
+++ /dev/null
@@ -1,145 +0,0 @@
-############# mysql-test\t\sql_big_tables_func.test ########################
-# #
-# Variable Name: sql_big_tables #
-# Scope: SESSION #
-# Access Type: Dynamic #
-# Data Type: BOOLEAN #
-# Default Value: 0 FALSE #
-# Values: 1 TRUE, 0 FALSE #
-# #
-# #
-# Creation Date: 2008-02-25 #
-# Author: Sharique Abdullah #
-# #
-# Description: Test Cases of Dynamic System Variable "sql_big_tables" #
-# that checks behavior of this variable in the following ways #
-# * Functionality based on different values #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html #
-# #
-############################################################################
-
-# Due to difference in the result the ps-protocol is disabled
---disable_ps_protocol
-
---echo ** Setup **
---echo
-#
-# Setup
-#
-
-SET @old_big_tables = @@SESSION.sql_big_tables;
-
-#
-# Create tables
-#
-
-CREATE TABLE t1(a varchar(20), b varchar(20));
-
-INSERT INTO t1 VALUES('aa','bb');
-INSERT INTO t1 VALUES('aa','bb');
-INSERT INTO t1 VALUES('aa','bb');
-INSERT INTO t1 VALUES('aa','bb');
-INSERT INTO t1 VALUES('aa','bb');
-
---echo '#--------------------FN_DYNVARS_155_01-------------------------#'
-#
-# TRUE mode
-#
-
-SET SESSION sql_big_tables = 1;
-
-let $diskTablesBig = query_get_value(SHOW STATUS LIKE 'Created_tmp_disk_tables', Value, 1);
-let $totalTablesBig = query_get_value(SHOW STATUS LIKE 'Created_tmp_tables', Value, 1);
-
-eval SET @diskTableCount = $diskTablesBig;
-eval SET @tempTableCount = $totalTablesBig;
-
-select count(a), b from t1 group by b;
-
-let $newDiskTablesBig = query_get_value(SHOW STATUS LIKE 'Created_tmp_disk_tables', Value, 1);
-let $newTotalTablesBig = query_get_value(SHOW STATUS LIKE 'Created_tmp_tables', Value, 1);
-
-eval SET @diskTableCount = $newDiskTablesBig - @diskTableCount;
-eval SET @tempTableCount = $newTotalTablesBig - @tempTableCount;
-
-SELECT @diskTableCount;
---echo 1 Expected
-SELECT @tempTableCount;
---echo 1 Expected
-
---echo '#--------------------FN_DYNVARS_155_02-------------------------#'
-#
-# FALSE mode
-#
-
-SET SESSION sql_big_tables = 0;
-
-let $diskTables = query_get_value(SHOW STATUS LIKE 'Created_tmp_disk_tables', Value, 1);
-let $totalTables = query_get_value(SHOW STATUS LIKE 'Created_tmp_tables', Value, 1);
-
-eval SET @diskTableCount = $diskTables;
-eval SET @tempTableCount = $totalTables;
-
-SELECT * FROM (SELECT ta.b as a, tb.a as b FROM t1 as ta INNER JOIN t1 as tb ON ta.a = tb.a) sub;
-
-let $newDiskTables= query_get_value(SHOW STATUS LIKE 'Created_tmp_disk_tables', Value, 1);
-let $newTotalTables= query_get_value(SHOW STATUS LIKE 'Created_tmp_tables', Value, 1);
-
-eval SET @diskTableCount = $newDiskTables - @diskTableCount;
-eval SET @tempTableCount = $newTotalTables - @tempTableCount;
-
-SELECT @diskTableCount;
---echo 0 Expected
-SELECT @tempTableCount;
---echo 1 Expected
-
---echo '#--------------------FN_DYNVARS_155_03-------------------------#'
-#
-# Session data integrity check
-#
---echo ** Connecting con_int1 using root **
-connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
-connection con_int1;
-
-SELECT @@SESSION.sql_big_tables;
---echo 0 / FALSE Expected;
-SET SESSION sql_big_tables = FALSE;
-
---echo ** Connecting con_int2 using root **
-connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
-connection con_int2;
-
-SELECT @@SESSION.sql_big_tables;
---echo 0 / FALSE Expected;
-
-SET SESSION sql_big_tables = TRUE;
-
---echo ** Connection con_int1 **
-connection con_int1;
-SELECT @@SESSION.sql_big_tables;
---echo 0 / FALSE Expected;
-
---echo ** Connection con_int2 **
-connection con_int2;
-SELECT @@SESSION.sql_big_tables;
---echo 1 / TRUE Expected;
-
---echo ** Connection default **
-connection default;
---echo Disconnecting Connections con_int1, con_int2
-disconnect con_int1;
-disconnect con_int2;
-
-#
-# Cleanup
-#
-
-SET SESSION sql_big_tables = @old_big_tables;
-
-DROP TABLE t1;
-
---enable_ps_protocol
-
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
deleted file mode 100644
index 5b21bd4c79a..00000000000
--- a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_basic.test
+++ /dev/null
@@ -1,221 +0,0 @@
-############## mysql-test\t\sql_low_priority_updates_basic.test ###############
-# #
-# Variable Name: sql_low_priority_updates #
-# Scope: GLOBAL | SESSION #
-# Access Type: Dynamic #
-# Data Type: boolean #
-# Default Value: #
-# Valid Values: 0,1 #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author: Rizwan #
-# #
-# Description: Test Cases of Dynamic System Variable sql_low_priority_updates #
-# that checks the 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-system-variables.html #
-# #
-###############################################################################
-
---source include/load_sysvars.inc
-
-########################################################################
-# START OF sql_low_priority_updates TESTS #
-########################################################################
-
-
-###############################################################################
-# Saving initial value of sql_low_priority_updates in a temporary variable #
-###############################################################################
-
-SET @session_start_value = @@session.sql_low_priority_updates;
-SELECT @session_start_value;
-
-SET @global_start_value = @@global.sql_low_priority_updates;
-SELECT @global_start_value;
-
---echo '#--------------------FN_DYNVARS_159_01------------------------#'
-########################################################################
-# Display the DEFAULT value of sql_low_priority_updates #
-########################################################################
-
-SET @@session.sql_low_priority_updates = 1;
-SET @@session.sql_low_priority_updates = DEFAULT;
-SELECT @@session.sql_low_priority_updates;
-
-SET @@global.sql_low_priority_updates = 1;
-SET @@global.sql_low_priority_updates = DEFAULT;
-
---echo '#---------------------FN_DYNVARS_159_02-------------------------#'
-####################################################################################
-# Check if sql_low_priority_updates can be accessed with and without @@ sign #
-####################################################################################
-
-SET sql_low_priority_updates = 1;
-SELECT @@sql_low_priority_updates;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.sql_low_priority_updates;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.sql_low_priority_updates;
-
---Error ER_UNKNOWN_TABLE
-SELECT global.sql_low_priority_updates;
-
-#using another syntax for accessing system variables
-SET session sql_low_priority_updates = 0;
-SELECT @@session.sql_low_priority_updates;
-
-SET global sql_low_priority_updates = 0;
-SELECT @@global.sql_low_priority_updates;
-
-
---echo '#--------------------FN_DYNVARS_159_03------------------------#'
-##########################################################################
-# change the value of sql_low_priority_updates to a valid value #
-##########################################################################
-# for session
-SET @@session.sql_low_priority_updates = 0;
-SELECT @@session.sql_low_priority_updates;
-SET @@session.sql_low_priority_updates = 1;
-SELECT @@session.sql_low_priority_updates;
-
-# for global
-SET @@global.sql_low_priority_updates = 0;
-SELECT @@global.sql_low_priority_updates;
-SET @@global.sql_low_priority_updates = 1;
-SELECT @@global.sql_low_priority_updates;
-
-
---echo '#--------------------FN_DYNVARS_159_04-------------------------#'
-###########################################################################
-# Change the value of sql_low_priority_updates to invalid value #
-###########################################################################
-
-# for session
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_low_priority_updates = -1;
---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";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_low_priority_updates = "Y";
---Error ER_WRONG_VALUE_FOR_VAR
-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;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_low_priority_updates = ÓFF;
-
-# for global
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.sql_low_priority_updates = -1;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.sql_low_priority_updates = 2;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.sql_low_priority_updates = "T";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.sql_low_priority_updates = "Y";
---Error ER_WRONG_VALUE_FOR_VAR
-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;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.sql_low_priority_updates = ÓFF;
-
-
---echo '#-------------------FN_DYNVARS_159_05----------------------------#'
-###########################################################################
-# Test if changing global variable effects session and vice versa #
-###########################################################################
-
-SET @@global.sql_low_priority_updates = 0;
-SET @@session.sql_low_priority_updates = 1;
-SELECT @@global.sql_low_priority_updates AS res_is_0;
-
-SET @@global.sql_low_priority_updates = 0;
-SELECT @@session.sql_low_priority_updates AS res_is_1;
-
---echo '#----------------------FN_DYNVARS_159_06------------------------#'
-#########################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-#########################################################################
-
-SELECT IF(@@global.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='sql_low_priority_updates';
-SELECT @@global.sql_low_priority_updates;
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='sql_low_priority_updates';
-
---echo '#----------------------FN_DYNVARS_159_07------------------------#'
-#########################################################################
-# Check if the value in SESSION Table matches value in variable #
-#########################################################################
-
-SELECT IF(@@session.sql_low_priority_updates, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='sql_low_priority_updates';
-SELECT @@session.sql_low_priority_updates;
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='sql_low_priority_updates';
-
---echo '#---------------------FN_DYNVARS_159_08-------------------------#'
-###################################################################
-# Check if ON and OFF values can be used on variable #
-###################################################################
-
-SET @@session.sql_low_priority_updates = OFF;
-SELECT @@session.sql_low_priority_updates;
-SET @@session.sql_low_priority_updates = ON;
-SELECT @@session.sql_low_priority_updates;
-
-SET @@global.sql_low_priority_updates = OFF;
-SELECT @@global.sql_low_priority_updates;
-SET @@global.sql_low_priority_updates = ON;
-SELECT @@global.sql_low_priority_updates;
-
---echo '#---------------------FN_DYNVARS_159_09----------------------#'
-###################################################################
-# Check if TRUE and FALSE values can be used on variable #
-###################################################################
-
-SET @@session.sql_low_priority_updates = TRUE;
-SELECT @@session.sql_low_priority_updates;
-SET @@session.sql_low_priority_updates = FALSE;
-SELECT @@session.sql_low_priority_updates;
-
-SET @@global.sql_low_priority_updates = TRUE;
-SELECT @@global.sql_low_priority_updates;
-SET @@global.sql_low_priority_updates = FALSE;
-SELECT @@global.sql_low_priority_updates;
-
-##############################
-# Restore initial value #
-##############################
-
-SET @@session.sql_low_priority_updates = @session_start_value;
-SELECT @@session.sql_low_priority_updates;
-
-SET @@global.sql_low_priority_updates = @global_start_value;
-SELECT @@global.sql_low_priority_updates;
-
-###########################################################
-# END OF sql_low_priority_updates TESTS #
-###########################################################
-
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
deleted file mode 100644
index 9a72846b29c..00000000000
--- a/mysql-test/suite/sys_vars/t/sql_max_join_size_basic.test
+++ /dev/null
@@ -1,51 +0,0 @@
-
-#
-# 2010-01-20 OBN - Added check of I_S values after variable value change
-#
-
-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;
-set session sql_max_join_size=20;
-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';
-
-#
-# 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_max_join_size_func.test b/mysql-test/suite/sys_vars/t/sql_max_join_size_func.test
deleted file mode 100644
index 17b7d911b94..00000000000
--- a/mysql-test/suite/sys_vars/t/sql_max_join_size_func.test
+++ /dev/null
@@ -1,133 +0,0 @@
-############# mysql-test\t\sql_max_join_size_func.test ####################
-# #
-# Variable Name: sql_max_join_size #
-# Scope: GLOBAL & SESSION #
-# Access Type: Dynamic #
-# Data Type: BOOLEAN #
-# Default Value: 4294967295 #
-# Values: 1-4294967295 #
-# #
-# #
-# Creation Date: 2008-02-25 #
-# Author: Sharique Abdullah #
-# #
-# Description: Test Cases of Dynamic System Variable "sql_max_join_size" #
-# that checks behavior of this variable in the following ways#
-# * Functionality based on different values #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system #
-# -variables.html#option_mysqld_max_join_size #
-# #
-###########################################################################
-
---echo ** Setup **
-#
-# Setup
-#
-
-SET @session_max_join_size = @@SESSION.sql_max_join_size;
-SET @global_max_join_size = @@GLOBAL.sql_max_join_size;
-SET @session_sql_big_selects = @@SESSION.sql_big_selects;
-
-#
-# Create tables
-#
-
-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');
-INSERT INTO t1 VALUES('aa1','bb');
-INSERT INTO t1 VALUES('aa2','bb');
-INSERT INTO t1 VALUES('aa3','bb');
-INSERT INTO t1 VALUES('aa4','bb');
-
-INSERT INTO t2 VALUES('aa','bb');
-INSERT INTO t2 VALUES('aa1','bb');
-INSERT INTO t2 VALUES('aa2','bb');
-INSERT INTO t2 VALUES('aa3','bb');
-INSERT INTO t2 VALUES('aa4','bb');
-
---echo '#--------------------FN_DYNVARS_161_01-------------------------#'
-#
-# Testing fail condition
-#
-
-SET SESSION sql_max_join_size=9;
---error ER_TOO_BIG_SELECT
-SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
---echo Expected error The SELECT would examine more than MAX_JOIN_SIZE rows.
-
---echo '#--------------------FN_DYNVARS_161_02-------------------------#'
-#
-# Testing pass conditions
-#
-
-SET SESSION SQL_BIG_SELECTS = 1;
-
-SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
---echo This should work
-
-SET SESSION sql_max_join_size=DEFAULT;
-
-DELETE FROM t2 WHERE a = 'aa4';
-SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
---echo This should work
-
---echo '#----------------------------FN_DYNVARS_136_05-------------------------#'
-#
-# Session data integrity check & GLOBAL Value check
-#
-
-SET GLOBAL sql_max_join_size = 4;
---echo ** Connecting con_int1 using root **
-connect (con_int1,localhost,root,,);
-
---echo ** Connection con_int1 **
-connection con_int1;
-SELECT @@SESSION.sql_max_join_size;
---echo 4 Expected
-
-SET SESSION sql_max_join_size = 2;
---echo ** Connecting con_int2 using root **
-connect (con_int2,localhost,root,,);
-
---echo ** Connection con_int2 **
-connection con_int2;
-SELECT @@SESSION.sql_max_join_size;
---echo 4 Expected
-
-SET SESSION sql_max_join_size = 10;
-
---echo ** Connection con_int2 **
-connection con_int2;
-SELECT @@SESSION.sql_max_join_size;
---echo 10 Expected
-
---echo ** Connection con_int1 **
-connection con_int1;
-SELECT @@SESSION.sql_max_join_size;
---echo 2 Expected
-
-
-SELECT @@GLOBAL.sql_max_join_size;
---echo 4 Expected
-
---echo ** Connection default **
-connection default;
-
---echo Disconnecting Connections con_int1, con_int2
-disconnect con_int1;
-disconnect con_int2;
-
-
-#
-# Cleanup
-#
-
-SET @@SESSION.sql_max_join_size = @session_max_join_size;
-SET @@GLOBAL.sql_max_join_size = @global_max_join_size ;
-SET @@SESSION.sql_big_selects = @session_sql_big_selects;
-
-DROP TABLE t1;
-DROP TABLE t2;
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 10ca47133b7..e1ea74f33c3 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
@@ -22,6 +22,11 @@
# server-system-variables.html #
# #
###############################################################################
+# #
+# Modification date: 2012-09-30 #
+# With implementation of MDEV-253, the variable scope can be session #
+# #
+###############################################################################
--source include/not_embedded.inc
--source include/load_sysvars.inc
@@ -88,11 +93,8 @@ WHERE VARIABLE_NAME='sql_slave_skip_counter';
# Checking if variable is accessible with session scope #
###################################################################
---Error ER_GLOBAL_VARIABLE
SET @@sql_slave_skip_counter = 10;
---Error ER_GLOBAL_VARIABLE
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;
diff --git a/mysql-test/suite/sys_vars/t/ssl_ca_basic.test b/mysql-test/suite/sys_vars/t/ssl_ca_basic.test
index c369f1f0894..e7a7d6f6a4b 100644
--- a/mysql-test/suite/sys_vars/t/ssl_ca_basic.test
+++ b/mysql-test/suite/sys_vars/t/ssl_ca_basic.test
@@ -22,7 +22,7 @@
# #
###############################################################################
--- source include/have_ssl.inc
+-- source include/have_ssl_communication.inc
--echo '#---------------------BS_STVARS_045_01----------------------#'
####################################################################
diff --git a/mysql-test/suite/sys_vars/t/ssl_cert_basic.test b/mysql-test/suite/sys_vars/t/ssl_cert_basic.test
index c3b69bd495f..56d24c11742 100644
--- a/mysql-test/suite/sys_vars/t/ssl_cert_basic.test
+++ b/mysql-test/suite/sys_vars/t/ssl_cert_basic.test
@@ -22,7 +22,7 @@
# #
###############################################################################
--- source include/have_ssl.inc
+-- source include/have_ssl_communication.inc
--echo '#---------------------BS_STVARS_047_01----------------------#'
####################################################################
diff --git a/mysql-test/suite/sys_vars/t/ssl_crl_basic.test b/mysql-test/suite/sys_vars/t/ssl_crl_basic.test
new file mode 100644
index 00000000000..ec1564917d1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/ssl_crl_basic.test
@@ -0,0 +1,3 @@
+--echo # a simplified test to keep the suite happy.
+--echo # the real test is in main.
+select @@ssl_crl;
diff --git a/mysql-test/suite/sys_vars/t/ssl_crlpath_basic.test b/mysql-test/suite/sys_vars/t/ssl_crlpath_basic.test
new file mode 100644
index 00000000000..c0d86010e07
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/ssl_crlpath_basic.test
@@ -0,0 +1,3 @@
+--echo # a simplified test to keep the suite happy.
+--echo # the real test is in main.
+select @@ssl_crlpath;
diff --git a/mysql-test/suite/sys_vars/t/ssl_key_basic.test b/mysql-test/suite/sys_vars/t/ssl_key_basic.test
index 4616f281c27..8d755b4650b 100644
--- a/mysql-test/suite/sys_vars/t/ssl_key_basic.test
+++ b/mysql-test/suite/sys_vars/t/ssl_key_basic.test
@@ -22,7 +22,7 @@
# #
###############################################################################
--- source include/have_ssl.inc
+-- source include/have_ssl_communication.inc
--echo '#---------------------BS_STVARS_049_01----------------------#'
####################################################################
diff --git a/mysql-test/suite/sys_vars/t/table_open_cache_instances_basic.test b/mysql-test/suite/sys_vars/t/table_open_cache_instances_basic.test
new file mode 100644
index 00000000000..f7616c2c4e9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/table_open_cache_instances_basic.test
@@ -0,0 +1 @@
+select @@table_open_cache_instances;
diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_bug27322.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_bug27322.test
index 58098f4c879..c83f3dc2507 100644
--- a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_bug27322.test
+++ b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_bug27322.test
@@ -42,35 +42,24 @@ SET @def_var= @@session.transaction_prealloc_size;
--disable_warnings
SET SESSION transaction_prealloc_size=1024*1024*1024*1;
-# Embedded server is hardcoded to show "Writing to net" as STATE.
---replace_result "Writing to net" "NULL"
---replace_column 1 <Id> 3 <Host> 6 <Time>
-# Embedded server is hardcoded to show "Writing to net" as STATE.
---replace_result "Writing to net" "NULL"
+# Embedded server is shows "cleaning up" as STATE, while non-embedded shows "init"
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
--replace_regex /localhost[:0-9]*/localhost/
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*2;
---replace_result "Writing to net" "NULL"
---replace_column 1 <Id> 3 <Host> 6 <Time>
---replace_result "Writing to net" "NULL"
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
--replace_regex /localhost[:0-9]*/localhost/
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*3;
---replace_result "Writing to net" "NULL"
---replace_column 1 <Id> 3 <Host> 6 <Time>
---replace_result "Writing to net" "NULL"
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
--replace_regex /localhost[:0-9]*/localhost/
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*4;
---replace_result "Writing to net" "NULL"
---replace_column 1 <Id> 3 <Host> 6 <Time>
---replace_result "Writing to net" "NULL"
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
--replace_regex /localhost[:0-9]*/localhost/
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*5;
---replace_result "Writing to net" "NULL"
---replace_column 1 <Id> 3 <Host> 6 <Time>
---replace_result "Writing to net" "NULL"
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
SHOW PROCESSLIST;
--enable_warnings
diff --git a/mysql-test/suite/sys_vars/t/tx_read_only_basic.test b/mysql-test/suite/sys_vars/t/tx_read_only_basic.test
new file mode 100644
index 00000000000..0ebfcc31a89
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/tx_read_only_basic.test
@@ -0,0 +1,199 @@
+############## mysql-test\t\tx_read_only_basic.test ###########################
+# #
+# Variable Name: tx_read_only #
+# Scope: GLOBAL & SESSION #
+# Access Type: Dynamic #
+# Data Type: boolean #
+# Default Value: OFF #
+# Range: #
+# #
+# #
+# Creation Date: 2012-01-12 #
+# Author: joh #
+# #
+# Description: Test Cases of Dynamic System Variable tx_read_only #
+# that checks the 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.6/en/ #
+# server-system-variables.html #
+# #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+--echo ####################################################################
+--echo # START OF tx_read_only TESTS #
+--echo ####################################################################
+
+
+--echo #############################################################
+--echo # Save initial value #
+--echo #############################################################
+
+SET @start_global_value = @@global.tx_read_only;
+SELECT @start_global_value;
+SET @start_session_value = @@session.tx_read_only;
+SELECT @start_session_value;
+
+
+--echo ########################################################################
+--echo # Display the DEFAULT value of tx_read_only #
+--echo ########################################################################
+
+SET @@global.tx_read_only = ON;
+SET @@global.tx_read_only = DEFAULT;
+SELECT @@global.tx_read_only;
+
+SET @@session.tx_read_only = ON;
+SET @@session.tx_read_only = DEFAULT;
+SELECT @@session.tx_read_only;
+
+
+--echo ##############################################################################
+--echo # Change the value of tx_read_only to a valid value for GLOBAL Scope #
+--echo ##############################################################################
+
+SET @@global.tx_read_only = ON;
+SELECT @@global.tx_read_only;
+SET @@global.tx_read_only = OFF;
+SELECT @@global.tx_read_only;
+SET @@global.tx_read_only = 0;
+SELECT @@global.tx_read_only;
+SET @@global.tx_read_only = 1;
+SELECT @@global.tx_read_only;
+SET @@global.tx_read_only = TRUE;
+SELECT @@global.tx_read_only;
+SET @@global.tx_read_only = FALSE;
+SELECT @@global.tx_read_only;
+
+
+
+--echo ###############################################################################
+--echo # Change the value of tx_read_only to a valid value for SESSION Scope #
+--echo ###############################################################################
+
+SET @@session.tx_read_only = ON;
+SELECT @@session.tx_read_only;
+SET @@session.tx_read_only = OFF;
+SELECT @@session.tx_read_only;
+SET @@session.tx_read_only = 0;
+SELECT @@session.tx_read_only;
+SET @@session.tx_read_only = 1;
+SELECT @@session.tx_read_only;
+SET @@session.tx_read_only = TRUE;
+SELECT @@session.tx_read_only;
+SET @@session.tx_read_only = FALSE;
+SELECT @@session.tx_read_only;
+
+
+--echo ################################################################
+--echo # Change the value of tx_read_only to an invalid value #
+--echo ################################################################
+
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.tx_read_only = 'ONN';
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.tx_read_only = "OFFF";
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.tx_read_only = TTRUE;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.tx_read_only = FELSE;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.tx_read_only = -1024;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.tx_read_only = 65536;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.tx_read_only = 65530.34;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.tx_read_only = test;
+
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.tx_read_only = ONN;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.tx_read_only = ONF;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.tx_read_only = OF;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.tx_read_only = 'OFN';
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.tx_read_only = -2;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.tx_read_only = 65530.34;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.tx_read_only = 65550;
+
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.tx_read_only = test;
+SELECT @@session.tx_read_only;
+
+
+--echo ####################################################################
+--echo # Check if the value in GLOBAL Table matches value in variable #
+--echo ####################################################################
+
+
+SELECT IF(@@global.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='tx_read_only';
+
+--echo ####################################################################
+--echo # Check if the value in SESSION Table matches value in variable #
+--echo ####################################################################
+
+SELECT IF(@@session.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='tx_read_only';
+
+
+--echo ###############################################################################
+--echo # Check if accessing variable with and without GLOBAL point to same variable #
+--echo ###############################################################################
+
+SET @@tx_read_only = OFF;
+SET @@global.tx_read_only = ON;
+SELECT @@tx_read_only = @@global.tx_read_only;
+
+
+--echo ##############################################################################
+--echo # Check if accessing variable with SESSION,LOCAL and without SCOPE points #
+--echo # to same session variable #
+--echo ##############################################################################
+
+SET @@tx_read_only = ON;
+SELECT @@tx_read_only = @@local.tx_read_only;
+SELECT @@local.tx_read_only = @@session.tx_read_only;
+
+
+--echo ###############################################################################
+--echo # Check if tx_read_only can be accessed with and without @@ sign #
+--echo ###############################################################################
+
+--echo # @@session is synonym for SESSION
+SET @@session.tx_read_only= 0;
+
+--echo # Without modifier, SET changes session variable
+SET tx_read_only = 1;
+SELECT @@tx_read_only;
+
+--echo # name1.name2 refers to database_name.table_name
+--Error ER_UNKNOWN_TABLE
+SELECT session.tx_read_only;
+
+--echo ####################################
+--echo # Restore initial value #
+--echo ####################################
+
+SET @@global.tx_read_only = @start_global_value;
+SELECT @@global.tx_read_only;
+SET @@session.tx_read_only = @start_session_value;
+SELECT @@session.tx_read_only;
+
+
+--echo #########################################################
+--echo # END OF tx_read_only TESTS #
+--echo #########################################################
+
diff --git a/mysql-test/suite/sys_vars/t/use_stat_tables_basic.test b/mysql-test/suite/sys_vars/t/use_stat_tables_basic.test
new file mode 100644
index 00000000000..7f526edf206
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/use_stat_tables_basic.test
@@ -0,0 +1,100 @@
+--source include/load_sysvars.inc
+
+#############################################################
+# Save initial value #
+#############################################################
+
+SET @start_global_value = @@global.use_stat_tables;
+SELECT @start_global_value;
+SET @start_session_value = @@session.use_stat_tables;
+SELECT @start_session_value;
+
+###############################################################
+# Display the DEFAULT value of use_stat_tables #
+###############################################################
+
+SET @@global.use_stat_tables = 2;
+SET @@global.use_stat_tables = DEFAULT;
+SELECT @@global.use_stat_tables;
+
+
+##################################################################################
+# Change the value of use_stat_tables to a valid value for GLOBAL Scope #
+##################################################################################
+
+SET @@global.use_stat_tables = 0;
+SELECT @@global.use_stat_tables;
+SET @@global.use_stat_tables = 1;
+SELECT @@global.use_stat_tables;
+SET @@global.use_stat_tables = 2;
+SELECT @@global.use_stat_tables;
+
+SET @@global.use_stat_tables = NEVER;
+SELECT @@global.use_stat_tables;
+SET @@global.use_stat_tables = COMPLEMENTARY;
+SELECT @@global.use_stat_tables;
+SET @@global.use_stat_tables = PREFERABLY;
+SELECT @@global.use_stat_tables;
+
+####################################################################################
+# Change the value of use_stat_tables to a valid value for SESSION Scope #
+####################################################################################
+
+SET @@session.use_stat_tables = 0;
+SELECT @@session.use_stat_tables;
+SET @@session.use_stat_tables = 1;
+SELECT @@session.use_stat_tables;
+SET @@session.use_stat_tables = 2;
+SELECT @@session.use_stat_tables;
+
+SET @@session.use_stat_tables = NEVER;
+SELECT @@session.use_stat_tables;
+SET @@session.use_stat_tables = PREFERABLY;
+SELECT @@session.use_stat_tables;
+SET @@session.use_stat_tables = COMPLEMENTARY;
+SELECT @@session.use_stat_tables;
+
+#####################################################################
+# Change the value of use_stat_tables to an invalid value #
+#####################################################################
+set sql_mode=TRADITIONAL;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.use_stat_tables = 10;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.use_stat_tables = -1024;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.use_stat_tables = 2.4;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@global.use_stat_tables = OFF;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.use_stat_tables = 10;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.use_stat_tables = -2;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.use_stat_tables = 1.2;
+--Error ER_WRONG_VALUE_FOR_VAR
+SET @@session.use_stat_tables = ON;
+
+###############################################################################
+# Check if the value in GLOBAL & SESSION Tables matches value in variable #
+###############################################################################
+
+SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='use_stat_tables';
+
+SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='use_stat_tables';
+
+####################################
+# Restore initial value #
+####################################
+
+SET @@global.use_stat_tables = @start_global_value;
+SELECT @@global.use_stat_tables;
+SET @@session.use_stat_tables = @start_session_value;
+SELECT @@session.use_stat_tables;
+set sql_mode='';
+
+######################################################
+# END OF use_stat_tables TESTS #
+###################################################### \ No newline at end of file
diff --git a/mysql-test/suite/sys_vars/t/have_partitioning_basic.test b/mysql-test/suite/sys_vars/t/version_malloc_library_basic.test
index b37abdb1498..6318ca4abd5 100644
--- a/mysql-test/suite/sys_vars/t/have_partitioning_basic.test
+++ b/mysql-test/suite/sys_vars/t/version_malloc_library_basic.test
@@ -1,100 +1,90 @@
-
-
-################## mysql-test\t\have_partitioning_basic.test ##################
+################## mysql-test\t\version_malloc_library.test ###################
# #
-# Variable Name: have_partitioning #
+# Variable Name: version_malloc_library #
# Scope: Global #
# Access Type: Static #
-# Data Type: boolean #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author : Sharique Abdullah #
-# #
+# Data Type: String #
# #
-# Description:Test Cases of Dynamic System Variable have_partitioning #
+# Description:Test Cases of Dynamic System Variable version #
# that checks the behavior of this variable in the following ways #
# * Value Check #
# * Scope Check #
# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
-# #
###############################################################################
---echo '#---------------------BS_STVARS_014_01----------------------#'
+--echo '#---------------------BS_STVARS_053_01----------------------#'
####################################################################
# Displaying default value #
####################################################################
-SELECT COUNT(@@GLOBAL.have_partitioning);
+SELECT COUNT(@@GLOBAL.version_malloc_library);
--echo 1 Expected
---echo '#---------------------BS_STVARS_014_02----------------------#'
+--echo '#---------------------BS_STVARS_053_02----------------------#'
####################################################################
# Check if Value can set #
####################################################################
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.have_partitioning=1;
+SET @@GLOBAL.version_malloc_library=1;
--echo Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.have_partitioning);
+SELECT COUNT(@@GLOBAL.version_malloc_library);
--echo 1 Expected
---echo '#---------------------BS_STVARS_014_03----------------------#'
+--echo '#---------------------BS_STVARS_053_03----------------------#'
#################################################################
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
-SELECT @@GLOBAL.have_partitioning = VARIABLE_VALUE
+SELECT @@GLOBAL.version_malloc_library = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_partitioning';
+WHERE VARIABLE_NAME='version_malloc_library';
--echo 1 Expected
-SELECT COUNT(@@GLOBAL.have_partitioning);
+SELECT COUNT(@@GLOBAL.version_malloc_library);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='have_partitioning';
+WHERE VARIABLE_NAME='version_malloc_library';
--echo 1 Expected
---echo '#---------------------BS_STVARS_014_04----------------------#'
-################################################################################
-# Check if accessing variable with and without GLOBAL point to same variable #
-################################################################################
-SELECT @@have_partitioning = @@GLOBAL.have_partitioning;
+--echo '#---------------------BS_STVARS_053_04----------------------#'
+###############################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+###############################################################################
+SELECT @@version_malloc_library = @@GLOBAL.version_malloc_library;
--echo 1 Expected
---echo '#---------------------BS_STVARS_014_05----------------------#'
-################################################################################
-# Check if have_partitioning can be accessed with and without @@ sign #
-################################################################################
+--echo '#---------------------BS_STVARS_053_05----------------------#'
+###############################################################################
+# Check if version_malloc_library can be accessed with and without @@ sign #
+###############################################################################
-SELECT COUNT(@@have_partitioning);
+SELECT COUNT(@@version_malloc_library);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.have_partitioning);
+SELECT COUNT(@@local.version_malloc_library);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.have_partitioning);
+SELECT COUNT(@@SESSION.version_malloc_library);
--echo Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.have_partitioning);
+SELECT COUNT(@@GLOBAL.version_malloc_library);
--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
-SELECT have_partitioning = @@SESSION.have_partitioning;
+SELECT version_malloc_library = @@SESSION.version;
--echo Expected error 'Readonly variable'