[Commits] cf3175b: # This is a combination of 3 commits.

Jan Lindström jan.lindstrom at mariadb.com
Fri Sep 2 13:21:49 EEST 2016


revision-id: cf3175b0ec18da77b943375227fee3879fbd3071 (mariadb-10.2.1-4-gcf3175b)
parent(s): 848d211c5c4df00b819cd84d7530cf7d29bb0524
committer: Jan Lindström
timestamp: 2016-09-02 13:21:49 +0300
message:

# This is a combination of 3 commits.
# The first commit's message is:
Merge InnoDB 5.7 from mysql-5.7.9.

Contains also

MDEV-10547: Test multi_update_innodb fails with InnoDB 5.7

	The failure happened because 5.7 has changed the signature of
	the bool handler::primary_key_is_clustered() const
	virtual function ("const" was added). InnoDB was using the old
	signature which caused the function not to be used.

MDEV-10550: Parallel replication lock waits/deadlock handling does not work with InnoDB 5.7

	Fixed mutexing problem on lock_trx_handle_wait. Note that
	rpl_parallel and rpl_optimistic_parallel tests still
	fail.

# This is the 2nd commit message:

Fix compiler error.

# This is the 3rd commit message:

Fix compiler error.

---
 BUILD/SETUP.sh                                     |     2 +-
 configure.cmake                                    |     2 +-
 extra/CMakeLists.txt                               |     2 +
 extra/innochecksum.cc                              |  2283 +--
 include/dur_prop.h                                 |    32 +
 include/my_icp.h                                   |    48 +
 include/mysql/psi/psi_base.h                       |   147 +
 include/mysql/psi/psi_memory.h                     |   155 +
 mysql-test/disabled.def                            |     4 +
 mysql-test/include/have_numa.inc                   |    18 +
 mysql-test/include/have_xtradb.combinations        |    10 +-
 mysql-test/include/mtr_check.sql                   |     1 +
 mysql-test/mysql-test-run.pl                       |     9 +-
 mysql-test/r/alter_table.result                    |     4 +-
 mysql-test/r/group_min_max_innodb.result           |     4 +-
 mysql-test/r/innodb_icp.result                     |     2 +-
 mysql-test/r/mysqlbinlog_row_minimal.result        |    16 +-
 mysql-test/r/mysqld--help.result                   |     4 -
 mysql-test/r/order_by_optimizer_innodb.result      |     4 +-
 mysql-test/r/partition_innodb.result               |    12 +-
 mysql-test/r/partition_innodb_plugin.result        |     8 +-
 mysql-test/r/range_vs_index_merge_innodb.result    |    68 +-
 mysql-test/r/row-checksum-old.result               |     2 +-
 mysql-test/r/row-checksum.result                   |     2 +-
 mysql-test/r/selectivity_innodb.result             |    20 +-
 mysql-test/r/stat_tables_innodb.result             |     4 +-
 mysql-test/r/type_bit_innodb.result                |     2 +-
 mysql-test/suite/encryption/disabled.def           |     1 +
 .../suite/encryption/r/debug_key_management.result |     8 +-
 .../encryption/r/innodb-bad-key-change.result      |     7 +-
 .../encryption/r/innodb-bad-key-change3.result     |     9 +-
 .../encryption/r/innodb-bad-key-change4.result     |     8 +-
 .../encryption/r/innodb-bad-key-change5.result     |     6 +
 .../encryption/r/innodb-discard-import.result      |    11 +-
 .../encryption/r/innodb-encryption-alter.result    |     4 +
 .../encryption/r/innodb-encryption-disable.result  |    16 +
 .../suite/encryption/r/innodb-log-encrypt.result   |     4 +
 .../encryption/r/innodb-page_encryption.result     |     8 +
 .../r/innodb-page_encryption_compression.result    |     8 +
 .../r/innodb-page_encryption_log_encryption.result |     8 +
 .../r/innodb_encryption_discard_import.result      |    11 +-
 .../encryption/r/innodb_encryption_filekeys.result |     4 +
 .../suite/encryption/r/innodb_encryption_is.result |     4 +
 .../r/innodb_encryption_row_compressed.result      |   159 +
 .../encryption/r/innodb_encryption_tables.result   |     6 +
 .../r/innodb_onlinealter_encryption.result         |     4 +
 .../r/innodb_page_encryption_key_change.result     |     6 +
 .../suite/encryption/t/innodb-bad-key-change.test  |     2 +
 .../suite/encryption/t/innodb-bad-key-change3.test |     4 +-
 .../suite/encryption/t/innodb-discard-import.test  |     3 +-
 .../encryption/t/innodb-encryption-disable.test    |    17 +-
 .../t/innodb_encryption_discard_import.test        |     4 +-
 .../t/innodb_encryption_row_compressed.opt         |     4 +
 .../t/innodb_encryption_row_compressed.test        |   125 +
 mysql-test/suite/handler/disabled.def              |    13 +
 mysql-test/suite/innodb/disabled.def               |     6 +
 .../include/innodb_simulate_comp_failures.inc      |    10 +-
 .../suite/innodb/r/group_commit_crash.result       |     2 +
 .../r/group_commit_crash_no_optimize_thread.result |     2 +
 mysql-test/suite/innodb/r/help_url.result          |     2 -
 mysql-test/suite/innodb/r/innodb-16k.result        |    26 +-
 .../suite/innodb/r/innodb-alter-discard.result     |     8 +-
 mysql-test/suite/innodb/r/innodb-blob.result       |    42 +-
 .../suite/innodb/r/innodb-bug-14068765.result      |     4 +-
 .../suite/innodb/r/innodb-bug-14084530.result      |     4 +-
 .../innodb/r/innodb-change-buffer-recovery.result  |     9 +-
 .../suite/innodb/r/innodb-fk-warnings.result       |     2 +-
 mysql-test/suite/innodb/r/innodb-index.result      |    14 +-
 mysql-test/suite/innodb/r/innodb-mdev-7408.result  |     1 +
 mysql-test/suite/innodb/r/innodb-mdev-7513.result  |     1 +
 .../innodb/r/innodb-page_compression_bzip2.result  |     4 +
 .../innodb/r/innodb-page_compression_lz4.result    |     4 +
 .../innodb/r/innodb-page_compression_lzma.result   |     4 +
 .../innodb/r/innodb-page_compression_lzo.result    |     4 +
 .../innodb/r/innodb-page_compression_snappy.result |     4 +
 .../innodb/r/innodb-page_compression_tables.result |     6 +
 .../innodb/r/innodb-page_compression_zip.result    |     4 +
 .../suite/innodb/r/innodb-virtual-columns.result   |   118 +
 mysql-test/suite/innodb/r/innodb-wl5522-1.result   |    11 +-
 .../suite/innodb/r/innodb-wl5522-debug-zip.result  |    27 +-
 mysql-test/suite/innodb/r/innodb-wl5522-zip.result |    16 +-
 mysql-test/suite/innodb/r/innodb-wl5522.result     |    25 +-
 mysql-test/suite/innodb/r/innodb.result            |   114 +-
 .../suite/innodb/r/innodb_blob_truncate.result     |     4 +
 .../r/innodb_blob_unrecoverable_crash.result       |    24 -
 .../suite/innodb/r/innodb_bug12400341.result       |     1 +
 .../suite/innodb/r/innodb_bug12902967.result       |     3 +-
 .../suite/innodb/r/innodb_bug14147491.result       |    24 +-
 mysql-test/suite/innodb/r/innodb_bug30423.result   |    12 +-
 mysql-test/suite/innodb/r/innodb_bug34053.result   |     2 +-
 mysql-test/suite/innodb/r/innodb_bug34300.result   |    19 +-
 mysql-test/suite/innodb/r/innodb_bug46000.result   |     2 +-
 mysql-test/suite/innodb/r/innodb_bug47167.result   |    12 +-
 mysql-test/suite/innodb/r/innodb_bug54044.result   |     2 +-
 mysql-test/suite/innodb/r/innodb_bug60049.result   |     2 -
 .../suite/innodb/r/innodb_corrupt_bit.result       |    84 +-
 .../suite/innodb/r/innodb_file_format.result       |    26 +-
 mysql-test/suite/innodb/r/innodb_gis.result        |     2 +-
 .../innodb/r/innodb_information_schema.result      |     2 +-
 .../r/innodb_information_schema_buffer.result      |     1 +
 mysql-test/suite/innodb/r/innodb_monitor.result    |    29 +-
 .../r/innodb_prefix_index_restart_server.result    |    12 +-
 .../r/innodb_simulate_comp_failures_small.result   |    13 +-
 .../r/innodb_stats_create_on_corrupted.result      |     4 +-
 .../innodb/r/innodb_stats_fetch_corrupted.result   |     4 +-
 mysql-test/suite/innodb/r/strict_mode.result       |     3 +-
 mysql-test/suite/innodb/t/auto_increment_dup.opt   |     1 +
 .../suite/innodb/t/create_isl_with_direct.test     |     2 +-
 mysql-test/suite/innodb/t/innodb-16k.test          |    21 +-
 .../suite/innodb/t/innodb-alter-discard.test       |     6 +
 mysql-test/suite/innodb/t/innodb-blob.test         |    54 +-
 .../t/innodb-change-buffer-recovery-master.opt     |     1 +
 .../innodb/t/innodb-change-buffer-recovery.test    |    24 +-
 mysql-test/suite/innodb/t/innodb-mdev-7408.test    |     2 +
 mysql-test/suite/innodb/t/innodb-mdev-7513.test    |     1 +
 mysql-test/suite/innodb/t/innodb-mdev7046.test     |     1 +
 .../suite/innodb/t/innodb-virtual-columns.test     |     6 +
 mysql-test/suite/innodb/t/innodb-wl5522-1.test     |     2 +
 .../suite/innodb/t/innodb-wl5522-debug-zip.test    |     3 +
 mysql-test/suite/innodb/t/innodb-wl5522-zip.test   |     2 +
 mysql-test/suite/innodb/t/innodb-wl5522.test       |     2 +
 mysql-test/suite/innodb/t/innodb.test              |   128 +-
 .../innodb/t/innodb_blob_unrecoverable_crash.test  |    52 -
 mysql-test/suite/innodb/t/innodb_bug12400341.test  |     4 +-
 mysql-test/suite/innodb/t/innodb_bug12902967.test  |     9 +-
 .../suite/innodb/t/innodb_bug14147491-master.opt   |     5 +-
 mysql-test/suite/innodb/t/innodb_bug14147491.test  |    56 +-
 mysql-test/suite/innodb/t/innodb_bug30423.test     |     2 +
 mysql-test/suite/innodb/t/innodb_bug34053.test     |    20 +-
 mysql-test/suite/innodb/t/innodb_bug34300.test     |    28 +-
 .../suite/innodb/t/innodb_bug60049-master.opt      |     2 +-
 mysql-test/suite/innodb/t/innodb_bug60049.test     |    17 +-
 mysql-test/suite/innodb/t/innodb_corrupt_bit.test  |    22 +-
 mysql-test/suite/innodb/t/innodb_gis.test          |     5 +-
 .../innodb/t/innodb_stats_create_on_corrupted.test |     4 +-
 .../innodb/t/innodb_stats_fetch_corrupted.test     |     4 +-
 mysql-test/suite/innodb/t/strict_mode.test         |     2 +
 mysql-test/suite/rpl/disabled.def                  |     3 +
 .../innodb_adaptive_hash_index_parts_basic.result  |    48 +
 .../r/innodb_adaptive_max_sleep_delay_basic.result |    26 +
 .../r/innodb_additional_mem_pool_size_basic.result |    53 -
 .../r/innodb_api_bk_commit_interval_basic.result   |    36 +
 .../r/innodb_autoextend_increment_basic.result     |     6 +
 .../r/innodb_buffer_pool_chunk_size_basic.result   |    48 +
 ...nnodb_buffer_pool_dump_at_shutdown_basic.result |     3 +-
 .../r/innodb_buffer_pool_dump_pct_basic.result     |    41 +-
 .../r/innodb_buffer_pool_filename_basic.result     |     7 -
 ...innodb_buffer_pool_load_at_startup_basic.result |     2 +-
 .../r/innodb_buffer_pool_size_basic.result         |     7 +-
 .../r/innodb_checksum_algorithm_basic.result       |    22 +-
 .../r/innodb_cmp_per_index_enabled_basic.result    |     2 -
 .../r/innodb_commit_concurrency_basic.result       |    20 +
 ..._compression_failure_threshold_pct_basic.result |    15 +
 .../r/innodb_compression_pad_pct_max_basic.result  |    15 +
 .../r/innodb_concurrency_tickets_basic.result      |    48 +-
 .../r/innodb_default_row_format_basic.result       |    48 +
 ...b_disable_resize_buffer_pool_debug_basic.result |    60 +
 .../sys_vars/r/innodb_fast_shutdown_basic.result   |    15 +
 .../sys_vars/r/innodb_file_format_basic.result     |    20 +-
 .../sys_vars/r/innodb_file_format_max_basic.result |    20 +-
 .../sys_vars/r/innodb_fill_factor_basic.result     |    42 +
 .../r/innodb_flush_log_at_timeout_basic.result     |    15 +
 .../r/innodb_flush_log_at_trx_commit_basic.result  |    26 +
 .../sys_vars/r/innodb_flush_sync_basic.result      |    92 +
 .../r/innodb_flushing_avg_loops_basic.result       |    10 +
 .../r/innodb_ft_result_cache_limit_basic.result    |    10 +-
 .../r/innodb_ft_server_stopword_table_basic.result |     1 +
 .../r/innodb_ft_user_stopword_table_basic.result   |     2 +-
 .../sys_vars/r/innodb_large_prefix_basic.result    |    24 +-
 .../r/innodb_lock_wait_timeout_basic.result        |    98 +
 .../r/innodb_log_checkpoint_now_basic.result       |    81 +-
 .../sys_vars/r/innodb_log_checksums_basic.result   |    42 +
 .../r/innodb_log_write_ahead_size_basic.result     |    88 +
 .../r/innodb_max_dirty_pages_pct_basic.result      |   108 +-
 .../r/innodb_max_dirty_pages_pct_func.result       |     7 +
 .../r/innodb_max_dirty_pages_pct_lwm_basic.result  |    32 +-
 .../sys_vars/r/innodb_max_purge_lag_basic.result   |    50 +-
 .../r/innodb_max_undo_log_size_basic.result        |    54 +
 ...nodb_merge_threshold_set_all_debug_basic.result |    28 +
 .../r/innodb_mirrored_log_groups_basic.result      |    53 -
 .../sys_vars/r/innodb_monitor_disable_basic.result |    29 +-
 .../sys_vars/r/innodb_monitor_enable_basic.result  |    29 +-
 .../r/innodb_monitor_reset_all_basic.result        |    29 +-
 .../sys_vars/r/innodb_monitor_reset_basic.result   |    29 +-
 .../sys_vars/r/innodb_numa_interleave_basic.result |    10 +
 .../sys_vars/r/innodb_old_blocks_pct_basic.result  |     8 +
 .../sys_vars/r/innodb_page_cleaners_basic.result   |    41 +
 .../suite/sys_vars/r/innodb_page_size_basic.result |     9 +-
 .../r/innodb_purge_batch_size_basic.result         |    25 +-
 ...nodb_purge_rseg_truncate_frequency_basic.result |   113 +
 .../sys_vars/r/innodb_purge_threads_basic.result   |    38 +-
 .../r/innodb_read_ahead_threshold_basic.result     |    14 +
 .../r/innodb_replication_delay_basic.result        |    44 +
 .../sys_vars/r/innodb_spin_wait_delay_basic.result |    44 +
 .../r/innodb_stats_persistent_basic.result         |     2 +-
 ...nodb_stats_persistent_sample_pages_basic.result |    26 +-
 .../r/innodb_stats_sample_pages_basic.result       |    22 +-
 ...nnodb_stats_transient_sample_pages_basic.result |     6 +
 .../sys_vars/r/innodb_sync_debug_basic.result      |    11 +
 .../sys_vars/r/innodb_sync_spin_loops_basic.result |    56 +-
 .../sys_vars/r/innodb_table_locks_func.result      |     7 +
 .../r/innodb_temp_data_file_path_basic.result      |    53 +
 .../r/innodb_thread_concurrency_basic.result       |    15 +
 .../sys_vars/r/innodb_undo_directory_basic.result  |    16 +-
 .../r/innodb_undo_log_truncate_basic.result        |    69 +
 .../r/innodb_undo_tablespaces_basic.result         |    12 +-
 .../sys_vars/r/innodb_use_sys_malloc_basic.result  |    22 -
 mysql-test/suite/sys_vars/r/sysvars_innodb.result  |   318 +-
 .../t/innodb_adaptive_hash_index_parts_basic.test  |    75 +
 .../t/innodb_adaptive_max_sleep_delay_basic.test   |    18 +
 .../t/innodb_additional_mem_pool_size_basic.test   |   102 -
 .../t/innodb_api_bk_commit_interval_basic.test     |    27 +
 .../t/innodb_api_disable_rowlock_basic.test        |     4 +
 .../sys_vars/t/innodb_api_enable_binlog_basic.test |     4 +
 .../sys_vars/t/innodb_api_enable_mdl_basic.test    |     4 +
 .../sys_vars/t/innodb_api_trx_level_basic.test     |     6 +
 .../t/innodb_autoextend_increment_basic.test       |     7 +
 .../sys_vars/t/innodb_autoinc_lock_mode_basic.test |     4 +
 .../t/innodb_autoinc_lock_mode_func-master.opt     |     2 +-
 .../t/innodb_buffer_pool_chunk_size_basic.test     |    75 +
 .../innodb_buffer_pool_dump_at_shutdown_basic.test |     2 +
 .../t/innodb_buffer_pool_dump_pct_basic.test       |    67 +-
 .../t/innodb_buffer_pool_filename_basic.test       |    32 -
 .../t/innodb_buffer_pool_instances_basic.test      |     4 +
 .../t/innodb_buffer_pool_load_now_basic.test       |     9 +-
 .../t/innodb_buffer_pool_size_basic-master.opt     |     1 +
 .../sys_vars/t/innodb_buffer_pool_size_basic.test  |    34 +-
 .../t/innodb_change_buffer_max_size_basic.test     |     8 +
 .../sys_vars/t/innodb_change_buffering_basic.test  |     6 +
 .../t/innodb_change_buffering_debug_basic.test     |     6 +
 .../t/innodb_checksum_algorithm_basic.test         |     1 -
 .../suite/sys_vars/t/innodb_checksums_basic.test   |     4 +
 .../t/innodb_cmp_per_index_enabled_basic.test      |     3 -
 .../t/innodb_commit_concurrency_basic.test         |    12 +
 ...db_compression_failure_threshold_pct_basic.test |    14 +-
 .../sys_vars/t/innodb_compression_level_basic.test |     8 +
 .../t/innodb_compression_pad_pct_max_basic.test    |    14 +-
 .../t/innodb_concurrency_tickets_basic.test        |    48 +-
 .../sys_vars/t/innodb_data_file_path_basic.test    |     4 +
 .../sys_vars/t/innodb_data_home_dir_basic.test     |     4 +
 .../t/innodb_default_row_format_basic.test         |    41 +
 ...odb_disable_resize_buffer_pool_debug_basic.test |    72 +
 .../suite/sys_vars/t/innodb_doublewrite_basic.test |     4 +
 .../t/innodb_doublewrite_batch_size_basic.test     |     2 +
 .../sys_vars/t/innodb_fast_shutdown_basic.test     |    14 +-
 .../suite/sys_vars/t/innodb_file_format_basic.test |     6 +
 .../sys_vars/t/innodb_file_format_check_basic.test |     6 +
 .../sys_vars/t/innodb_file_format_max_basic.test   |     7 +-
 .../sys_vars/t/innodb_file_io_threads_basic.test   |     8 +
 .../t/innodb_file_per_table_basic-master.opt       |     1 +
 .../sys_vars/t/innodb_file_per_table_basic.test    |     4 +
 .../suite/sys_vars/t/innodb_fill_factor_basic.test |    41 +
 .../t/innodb_flush_log_at_timeout_basic.test       |    13 +
 .../t/innodb_flush_log_at_trx_commit_basic.test    |    22 +
 .../sys_vars/t/innodb_flush_method_basic.test      |     4 +
 .../sys_vars/t/innodb_flush_neighbors_basic.test   |    12 +
 .../suite/sys_vars/t/innodb_flush_sync_basic.test  |    77 +
 .../t/innodb_flushing_avg_loops_basic.test         |    10 +
 .../t/innodb_force_load_corrupted_basic.test       |     4 +
 .../sys_vars/t/innodb_force_recovery_basic.test    |     4 +
 .../t/innodb_force_recovery_crash_basic.test       |     2 +
 .../sys_vars/t/innodb_ft_aux_table_basic.test      |     2 +
 .../sys_vars/t/innodb_ft_cache_size_basic.test     |     2 +
 .../t/innodb_ft_enable_diag_print_basic.test       |    12 +
 .../t/innodb_ft_enable_stopword_basic.test         |    12 +
 .../sys_vars/t/innodb_ft_max_token_size_basic.test |     2 +
 .../sys_vars/t/innodb_ft_min_token_size_basic.test |     2 +
 .../t/innodb_ft_num_word_optimize_basic.test       |     6 +
 .../t/innodb_ft_result_cache_limit_basic.test      |    12 +-
 .../t/innodb_ft_server_stopword_table_basic.test   |     4 +
 .../t/innodb_ft_sort_pll_degree_basic.test         |     2 +
 .../t/innodb_ft_total_cache_size_basic.test        |    13 +-
 .../t/innodb_ft_user_stopword_table_basic.test     |     5 +-
 .../sys_vars/t/innodb_large_prefix_basic.test      |    12 +
 ...innodb_limit_optimistic_insert_debug_basic.test |     6 +
 .../sys_vars/t/innodb_lock_wait_timeout_basic.test |    71 +
 .../t/innodb_locks_unsafe_for_binlog_basic.test    |     4 +
 .../sys_vars/t/innodb_log_buffer_size_basic.test   |     4 +
 .../t/innodb_log_checkpoint_now_basic.test         |    80 +-
 .../sys_vars/t/innodb_log_checksums_basic.test     |    36 +
 .../t/innodb_log_compressed_pages_basic.test       |     9 +-
 .../sys_vars/t/innodb_log_file_size_basic.test     |     4 +
 .../t/innodb_log_files_in_group_basic.test         |     4 +
 .../t/innodb_log_group_home_dir_basic.test         |     4 +
 .../t/innodb_log_write_ahead_size_basic.test       |    93 +
 .../sys_vars/t/innodb_lru_scan_depth_basic.test    |     8 +
 .../t/innodb_max_dirty_pages_pct_basic.test        |    93 +-
 .../t/innodb_max_dirty_pages_pct_func.test         |     7 +
 .../t/innodb_max_dirty_pages_pct_lwm_basic.test    |    22 +-
 .../sys_vars/t/innodb_max_purge_lag_basic.test     |    52 +-
 .../t/innodb_max_purge_lag_delay_basic.test        |     2 +
 .../sys_vars/t/innodb_max_undo_log_size_basic.test |    99 +
 ...innodb_merge_threshold_set_all_debug_basic.test |    30 +
 .../t/innodb_mirrored_log_groups_basic.test        |   102 -
 .../sys_vars/t/innodb_monitor_disable_basic.test   |     5 -
 .../sys_vars/t/innodb_monitor_enable_basic.test    |     5 -
 .../sys_vars/t/innodb_monitor_reset_all_basic.test |     5 -
 .../sys_vars/t/innodb_monitor_reset_basic.test     |     5 -
 .../sys_vars/t/innodb_numa_interleave_basic.test   |    13 +
 .../sys_vars/t/innodb_old_blocks_pct_basic.test    |    22 +-
 .../sys_vars/t/innodb_old_blocks_time_basic.test   |     6 +
 .../t/innodb_online_alter_log_max_size_basic.test  |     6 +
 .../suite/sys_vars/t/innodb_open_files_basic.test  |     4 +
 .../t/innodb_optimize_fulltext_only_basic.test     |    12 +
 .../sys_vars/t/innodb_page_cleaners_basic.test     |    53 +
 .../sys_vars/t/innodb_page_hash_locks_basic.test   |     2 +
 .../suite/sys_vars/t/innodb_page_size_basic.test   |    17 +-
 .../t/innodb_print_all_deadlocks_basic.test        |    12 +
 .../sys_vars/t/innodb_purge_batch_size_basic.test  |    17 +-
 ...innodb_purge_rseg_truncate_frequency_basic.test |   161 +
 .../sys_vars/t/innodb_purge_threads_basic.test     |    89 +-
 .../sys_vars/t/innodb_random_read_ahead_basic.test |    12 +
 .../t/innodb_read_ahead_threshold_basic.test       |    19 +
 .../sys_vars/t/innodb_read_io_threads_basic.test   |     2 +
 .../suite/sys_vars/t/innodb_read_only_basic.test   |     2 +
 .../sys_vars/t/innodb_replication_delay_basic.test |    52 +-
 .../t/innodb_rollback_on_timeout_basic.test        |     4 +
 .../sys_vars/t/innodb_rollback_segments_basic.test |     6 +
 .../sys_vars/t/innodb_sort_buffer_size_basic.test  |     2 +
 .../sys_vars/t/innodb_spin_wait_delay_basic.test   |    51 +-
 .../sys_vars/t/innodb_stats_method_basic.test      |     8 +
 .../sys_vars/t/innodb_stats_on_metadata_basic.test |    12 +
 .../sys_vars/t/innodb_stats_persistent_basic.test  |     2 +-
 ...innodb_stats_persistent_sample_pages_basic.test |    34 +-
 .../t/innodb_stats_sample_pages_basic.test         |    28 +-
 .../innodb_stats_transient_sample_pages_basic.test |    14 +
 .../sys_vars/t/innodb_status_output_basic.test     |    14 +
 .../t/innodb_status_output_locks_basic.test        |    14 +
 .../suite/sys_vars/t/innodb_strict_mode_basic.test |    12 +
 .../suite/sys_vars/t/innodb_support_xa_basic.test  |    10 +-
 .../sys_vars/t/innodb_sync_array_size_basic.test   |     8 +-
 .../suite/sys_vars/t/innodb_sync_debug_basic.test  |    16 +
 .../sys_vars/t/innodb_sync_spin_loops_basic.test   |    50 +-
 .../suite/sys_vars/t/innodb_table_locks_basic.test |    12 +-
 .../suite/sys_vars/t/innodb_table_locks_func.test  |     7 +
 .../t/innodb_temp_data_file_path_basic.test        |   106 +
 .../t/innodb_thread_concurrency_basic.test         |    15 +-
 ...odb_trx_purge_view_update_only_debug_basic.test |     6 +
 .../t/innodb_trx_rseg_n_slots_debug_basic.test     |     6 +
 .../sys_vars/t/innodb_undo_directory_basic.test    |    12 +-
 .../sys_vars/t/innodb_undo_log_truncate_basic.test |   113 +
 .../suite/sys_vars/t/innodb_undo_logs_basic.test   |     2 +
 .../sys_vars/t/innodb_undo_tablespaces_basic.test  |    13 +-
 .../sys_vars/t/innodb_use_native_aio_basic.test    |     4 +
 .../sys_vars/t/innodb_use_sys_malloc_basic.test    |    31 -
 .../suite/sys_vars/t/innodb_version_basic.test     |     2 +
 .../sys_vars/t/innodb_write_io_threads_basic.test  |     2 +
 mysql-test/t/ctype_utf8mb4_innodb-master.opt       |     1 +
 mysql-test/t/mysqlbinlog_row_minimal.test          |     2 +-
 mysql-test/t/partition_exchange-master.opt         |     1 +
 mysql-test/t/partition_innodb-master.opt           |     1 +
 mysql-test/thou_shalt_not_kill.pm                  |    26 +
 sql/handler.h                                      |    38 +-
 storage/innobase/CMakeLists.txt                    |    36 +-
 storage/innobase/Doxyfile                          |  1419 --
 storage/innobase/api/api0api.cc                    |   776 +-
 storage/innobase/api/api0misc.cc                   |   125 +-
 storage/innobase/btr/btr0btr.cc                    |  2710 ++--
 storage/innobase/btr/btr0bulk.cc                   |   995 ++
 storage/innobase/btr/btr0cur.cc                    |  4395 ++++--
 storage/innobase/btr/btr0defragment.cc             |    53 +-
 storage/innobase/btr/btr0pcur.cc                   |   255 +-
 storage/innobase/btr/btr0scrub.cc                  |    70 +-
 storage/innobase/btr/btr0sea.cc                    |  1325 +-
 storage/innobase/buf/buf0buddy.cc                  |   253 +-
 storage/innobase/buf/buf0buf.cc                    |  4398 ++++--
 storage/innobase/buf/buf0checksum.cc               |    70 +-
 storage/innobase/buf/buf0dblwr.cc                  |   781 +-
 storage/innobase/buf/buf0dump.cc                   |   346 +-
 storage/innobase/buf/buf0flu.cc                    |  2417 +++-
 storage/innobase/buf/buf0lru.cc                    |   996 +-
 storage/innobase/buf/buf0mtflu.cc                  |    38 +-
 storage/innobase/buf/buf0rea.cc                    |   579 +-
 storage/innobase/data/data0data.cc                 |   267 +-
 storage/innobase/data/data0type.cc                 |    38 +-
 storage/innobase/dict/dict0boot.cc                 |   144 +-
 storage/innobase/dict/dict0crea.cc                 |  1290 +-
 storage/innobase/dict/dict0dict.cc                 |  2880 ++--
 storage/innobase/dict/dict0load.cc                 |  2354 ++--
 storage/innobase/dict/dict0mem.cc                  |   393 +-
 storage/innobase/dict/dict0stats.cc                |   744 +-
 storage/innobase/dict/dict0stats_bg.cc             |   141 +-
 storage/innobase/dyn/dyn0dyn.cc                    |    66 -
 storage/innobase/eval/eval0eval.cc                 |   140 +-
 storage/innobase/eval/eval0proc.cc                 |    20 +-
 storage/innobase/fil/fil0crypt.cc                  |   378 +-
 storage/innobase/fil/fil0fil.cc                    |  8278 +++++------
 storage/innobase/fil/fil0pagecompress.cc           |   226 +-
 storage/innobase/fsp/fsp0file.cc                   |  1130 ++
 storage/innobase/fsp/fsp0fsp.cc                    |  3144 ++---
 storage/innobase/fsp/fsp0space.cc                  |   291 +
 storage/innobase/fsp/fsp0sysspace.cc               |  1050 ++
 storage/innobase/fts/fts0ast.cc                    |   153 +-
 storage/innobase/fts/fts0blex.cc                   |    21 +-
 storage/innobase/fts/fts0blex.l                    |     1 +
 storage/innobase/fts/fts0config.cc                 |    84 +-
 storage/innobase/fts/fts0fts.cc                    |  1973 +--
 storage/innobase/fts/fts0opt.cc                    |   436 +-
 storage/innobase/fts/fts0pars.cc                   |    13 +-
 storage/innobase/fts/fts0pars.y                    |    17 +-
 storage/innobase/fts/fts0plugin.cc                 |   295 +
 storage/innobase/fts/fts0que.cc                    |   929 +-
 storage/innobase/fts/fts0sql.cc                    |    90 +-
 storage/innobase/fts/fts0tlex.cc                   |   389 +-
 storage/innobase/fts/fts0tlex.l                    |     1 +
 storage/innobase/fut/fut0lst.cc                    |   212 +-
 storage/innobase/gis/gis0geo.cc                    |   835 ++
 storage/innobase/gis/gis0rtree.cc                  |  2016 +++
 storage/innobase/gis/gis0sea.cc                    |  2012 +++
 storage/innobase/ha/ha0ha.cc                       |   178 +-
 storage/innobase/ha/ha0storage.cc                  |    12 +-
 storage/innobase/ha/hash0hash.cc                   |   144 +-
 storage/innobase/ha_innodb.def                     |     4 -
 storage/innobase/handler/ha_innodb.cc              | 13854 ++++++++++++-------
 storage/innobase/handler/ha_innodb.h               |   724 +-
 storage/innobase/handler/ha_innopart.cc            |  4438 ++++++
 storage/innobase/handler/ha_innopart.h             |  1330 ++
 storage/innobase/handler/handler0alter.cc          |  4399 ++++--
 storage/innobase/handler/handler0alter_innopart.cc |   307 +
 storage/innobase/handler/i_s.cc                    |  1184 +-
 storage/innobase/handler/i_s.h                     |    15 +-
 storage/innobase/ibuf/ibuf0ibuf.cc                 |  1467 +-
 storage/innobase/include/api0api.h                 |   411 +-
 storage/innobase/include/api0misc.h                |     8 +-
 storage/innobase/include/btr0btr.h                 |   439 +-
 storage/innobase/include/btr0btr.ic                |    88 +-
 storage/innobase/include/btr0bulk.h                |   392 +
 storage/innobase/include/btr0cur.h                 |   431 +-
 storage/innobase/include/btr0cur.ic                |    58 +-
 storage/innobase/include/btr0pcur.h                |   152 +-
 storage/innobase/include/btr0pcur.ic               |   151 +-
 storage/innobase/include/btr0sea.h                 |   306 +-
 storage/innobase/include/btr0sea.ic                |   155 +-
 storage/innobase/include/btr0types.h               |   195 +-
 storage/innobase/include/buf0buddy.h               |    20 +-
 storage/innobase/include/buf0buddy.ic              |    10 +-
 storage/innobase/include/buf0buf.h                 |  1202 +-
 storage/innobase/include/buf0buf.ic                |   631 +-
 storage/innobase/include/buf0checksum.h            |    32 +-
 storage/innobase/include/buf0dblwr.h               |    36 +-
 storage/innobase/include/buf0dump.h                |     7 +-
 storage/innobase/include/buf0flu.h                 |   258 +-
 storage/innobase/include/buf0flu.ic                |    96 +-
 storage/innobase/include/buf0lru.h                 |    48 +-
 storage/innobase/include/buf0rea.h                 |   112 +-
 storage/innobase/include/buf0types.h               |    41 +-
 storage/innobase/include/data0data.h               |   268 +-
 storage/innobase/include/data0data.ic              |   234 +-
 storage/innobase/include/data0type.h               |   121 +-
 storage/innobase/include/data0type.ic              |    77 +-
 storage/innobase/include/db0err.h                  |    55 +-
 storage/innobase/include/dict0boot.h               |    50 +-
 storage/innobase/include/dict0boot.ic              |    10 +-
 storage/innobase/include/dict0crea.h               |   349 +-
 storage/innobase/include/dict0crea.ic              |    54 +-
 storage/innobase/include/dict0dict.h               |  1032 +-
 storage/innobase/include/dict0dict.ic              |   955 +-
 storage/innobase/include/dict0load.h               |   247 +-
 storage/innobase/include/dict0mem.h                |  1214 +-
 storage/innobase/include/dict0mem.ic               |    33 +-
 storage/innobase/include/dict0priv.h               |     8 +-
 storage/innobase/include/dict0priv.ic              |    32 +-
 storage/innobase/include/dict0stats.h              |    25 +-
 storage/innobase/include/dict0stats.ic             |    13 +-
 storage/innobase/include/dict0stats_bg.h           |    19 +-
 storage/innobase/include/dict0types.h              |    16 +-
 storage/innobase/include/dyn0buf.h                 |   505 +
 storage/innobase/include/dyn0dyn.h                 |   199 -
 storage/innobase/include/dyn0dyn.ic                |   306 -
 storage/innobase/include/dyn0types.h               |    39 +
 storage/innobase/include/eval0eval.h               |    10 +-
 storage/innobase/include/eval0eval.ic              |    12 +-
 storage/innobase/include/eval0proc.h               |    24 +-
 storage/innobase/include/eval0proc.ic              |     6 +-
 storage/innobase/include/fil0crypt.h               |    40 +-
 storage/innobase/include/fil0crypt.ic              |    53 +-
 storage/innobase/include/fil0fil.h                 |  1732 ++-
 storage/innobase/include/fil0fil.ic                |    10 +-
 storage/innobase/include/fil0pagecompress.h        |    48 +-
 storage/innobase/include/fsp0file.h                |   590 +
 storage/innobase/include/fsp0fsp.h                 |   538 +-
 storage/innobase/include/fsp0fsp.ic                |   402 +-
 storage/innobase/include/fsp0pagecompress.h        |     2 +-
 storage/innobase/include/fsp0pagecompress.ic       |    16 +-
 storage/innobase/include/fsp0space.h               |   247 +
 storage/innobase/include/fsp0sysspace.h            |   326 +
 storage/innobase/include/fsp0types.h               |   311 +-
 storage/innobase/include/fts0ast.h                 |    53 +-
 storage/innobase/include/fts0blex.h                |     2 +-
 storage/innobase/include/fts0fts.h                 |   265 +-
 storage/innobase/include/fts0opt.h                 |     3 +-
 storage/innobase/include/fts0plugin.h              |    50 +
 storage/innobase/include/fts0priv.h                |   163 +-
 storage/innobase/include/fts0priv.ic               |    28 +-
 storage/innobase/include/fts0tlex.h                |     2 +-
 storage/innobase/include/fts0tokenize.h            |   188 +
 storage/innobase/include/fts0types.h               |   114 +-
 storage/innobase/include/fts0types.ic              |   318 +-
 storage/innobase/include/fut0fut.h                 |    30 +-
 storage/innobase/include/fut0fut.ic                |    40 +-
 storage/innobase/include/fut0lst.h                 |    40 +-
 storage/innobase/include/fut0lst.ic                |    32 +-
 storage/innobase/include/gis0geo.h                 |   162 +
 storage/innobase/include/gis0rtree.h               |   572 +
 storage/innobase/include/gis0rtree.ic              |   274 +
 storage/innobase/include/gis0type.h                |   168 +
 storage/innobase/include/ha0ha.h                   |   106 +-
 storage/innobase/include/ha0ha.ic                  |    46 +-
 storage/innobase/include/ha0storage.h              |    31 +-
 storage/innobase/include/ha0storage.ic             |     6 +-
 storage/innobase/include/ha_prototypes.h           |   396 +-
 storage/innobase/include/handler0alter.h           |    13 +-
 storage/innobase/include/hash0hash.h               |    92 +-
 storage/innobase/include/hash0hash.ic              |    76 +-
 storage/innobase/include/ib0mutex.h                |  1166 ++
 storage/innobase/include/ibuf0ibuf.h               |   199 +-
 storage/innobase/include/ibuf0ibuf.ic              |   131 +-
 storage/innobase/include/lock0iter.h               |     6 +-
 storage/innobase/include/lock0lock.h               |   389 +-
 storage/innobase/include/lock0lock.ic              |    49 +-
 storage/innobase/include/lock0prdt.h               |   224 +
 storage/innobase/include/lock0priv.h               |  1057 +-
 storage/innobase/include/lock0priv.ic              |   364 +-
 storage/innobase/include/lock0types.h              |    35 +-
 storage/innobase/include/log0log.h                 |   700 +-
 storage/innobase/include/log0log.ic                |   194 +-
 storage/innobase/include/log0recv.h                |   258 +-
 storage/innobase/include/log0recv.ic               |    25 +-
 storage/innobase/include/log0types.h               |    50 +
 storage/innobase/include/mach0data.h               |   141 +-
 storage/innobase/include/mach0data.ic              |   399 +-
 storage/innobase/include/mem0dbg.h                 |   150 -
 storage/innobase/include/mem0dbg.ic                |   109 -
 storage/innobase/include/mem0mem.h                 |   461 +-
 storage/innobase/include/mem0mem.ic                |   408 +-
 storage/innobase/include/mem0pool.h                |   121 -
 storage/innobase/include/mem0pool.ic               |    24 -
 storage/innobase/include/mtr0log.h                 |   130 +-
 storage/innobase/include/mtr0log.ic                |   204 +-
 storage/innobase/include/mtr0mtr.h                 |   953 +-
 storage/innobase/include/mtr0mtr.ic                |   391 +-
 storage/innobase/include/mtr0types.h               |   268 +-
 storage/innobase/include/os0atomic.h               |   320 +
 storage/innobase/include/os0atomic.ic              |   215 +
 storage/innobase/include/os0event.h                |   135 +
 storage/innobase/include/os0file.h                 |  2323 ++--
 storage/innobase/include/os0file.ic                |   521 +-
 storage/innobase/include/os0once.h                 |     4 +-
 storage/innobase/include/os0proc.h                 |    51 +-
 storage/innobase/include/os0sync.h                 |   914 --
 storage/innobase/include/os0sync.ic                |   266 -
 storage/innobase/include/os0thread.h               |    51 +-
 storage/innobase/include/page0cur.h                |   167 +-
 storage/innobase/include/page0cur.ic               |   127 +-
 storage/innobase/include/page0page.h               |   315 +-
 storage/innobase/include/page0page.ic              |   291 +-
 storage/innobase/include/page0size.h               |   202 +
 storage/innobase/include/page0types.h              |    65 +-
 storage/innobase/include/page0zip.h                |   224 +-
 storage/innobase/include/page0zip.ic               |    52 +-
 storage/innobase/include/pars0opt.h                |     7 +-
 storage/innobase/include/pars0pars.h               |   133 +-
 storage/innobase/include/pars0sym.h                |    25 +-
 storage/innobase/include/que0que.h                 |    99 +-
 storage/innobase/include/que0que.ic                |    21 +-
 storage/innobase/include/read0read.h               |   250 +-
 storage/innobase/include/read0read.ic              |   148 -
 storage/innobase/include/read0types.h              |   305 +-
 storage/innobase/include/rem0cmp.h                 |   353 +-
 storage/innobase/include/rem0cmp.ic                |   216 +-
 storage/innobase/include/rem0rec.h                 |   322 +-
 storage/innobase/include/rem0rec.ic                |   191 +-
 storage/innobase/include/row0ext.h                 |     9 +-
 storage/innobase/include/row0ftsort.h              |    36 +-
 storage/innobase/include/row0import.h              |     6 +-
 storage/innobase/include/row0ins.h                 |    61 +-
 storage/innobase/include/row0log.h                 |    89 +-
 storage/innobase/include/row0log.ic                |    18 +-
 storage/innobase/include/row0merge.h               |   167 +-
 storage/innobase/include/row0mysql.h               |   380 +-
 storage/innobase/include/row0purge.h               |    27 +-
 storage/innobase/include/row0quiesce.h             |     3 -
 storage/innobase/include/row0row.h                 |    78 +-
 storage/innobase/include/row0row.ic                |    11 +-
 storage/innobase/include/row0sel.h                 |   197 +-
 storage/innobase/include/row0sel.ic                |    46 +-
 storage/innobase/include/row0trunc.h               |   433 +
 storage/innobase/include/row0uins.h                |     6 +-
 storage/innobase/include/row0umod.h                |     3 +-
 storage/innobase/include/row0undo.h                |    16 +-
 storage/innobase/include/row0upd.h                 |   210 +-
 storage/innobase/include/row0upd.ic                |    67 +-
 storage/innobase/include/row0vers.h                |    47 +-
 storage/innobase/include/sess0sess.h               |   146 +
 storage/innobase/include/srv0conc.h                |    27 +-
 storage/innobase/include/srv0mon.h                 |   138 +-
 storage/innobase/include/srv0mon.ic                |    12 +-
 storage/innobase/include/srv0srv.h                 |   356 +-
 storage/innobase/include/srv0start.h               |    96 +-
 storage/innobase/include/sync0arr.h                |    67 +-
 storage/innobase/include/sync0arr.ic               |    51 +-
 storage/innobase/include/sync0debug.h              |   105 +
 storage/innobase/include/sync0policy.h             |   550 +
 storage/innobase/include/sync0policy.ic            |   100 +
 storage/innobase/include/sync0rw.h                 |   576 +-
 storage/innobase/include/sync0rw.ic                |   492 +-
 storage/innobase/include/sync0sync.h               |   794 +-
 storage/innobase/include/sync0sync.ic              |   410 -
 storage/innobase/include/sync0types.h              |  1232 +-
 storage/innobase/include/trx0i_s.h                 |    35 +-
 storage/innobase/include/trx0purge.h               |   345 +-
 storage/innobase/include/trx0purge.ic              |    27 +-
 storage/innobase/include/trx0rec.h                 |   128 +-
 storage/innobase/include/trx0rec.ic                |    26 +-
 storage/innobase/include/trx0roll.h                |   123 +-
 storage/innobase/include/trx0roll.ic               |    46 +-
 storage/innobase/include/trx0rseg.h                |   187 +-
 storage/innobase/include/trx0rseg.ic               |    94 +-
 storage/innobase/include/trx0sys.h                 |   323 +-
 storage/innobase/include/trx0sys.ic                |   214 +-
 storage/innobase/include/trx0trx.h                 |  1030 +-
 storage/innobase/include/trx0trx.ic                |   264 +-
 storage/innobase/include/trx0types.h               |   223 +-
 storage/innobase/include/trx0undo.h                |   263 +-
 storage/innobase/include/trx0undo.ic               |    63 +-
 storage/innobase/include/trx0xa.h                  |    20 +-
 storage/innobase/include/univ.i                    |   277 +-
 storage/innobase/include/usr0sess.h                |     9 +-
 storage/innobase/include/ut0bh.h                   |   152 -
 storage/innobase/include/ut0bh.ic                  |   125 -
 storage/innobase/include/ut0byte.h                 |    16 +-
 storage/innobase/include/ut0byte.ic                |    18 +-
 storage/innobase/include/ut0counter.h              |   102 +-
 storage/innobase/include/ut0crc32.h                |    25 +-
 storage/innobase/include/ut0dbg.h                  |   158 +-
 storage/innobase/include/ut0list.h                 |    23 +-
 storage/innobase/include/ut0list.ic                |     6 +-
 storage/innobase/include/ut0lst.h                  |   585 +-
 storage/innobase/include/ut0mem.h                  |   144 +-
 storage/innobase/include/ut0mem.ic                 |    58 +-
 storage/innobase/include/ut0mutex.h                |   225 +
 storage/innobase/include/ut0mutex.ic               |   108 +
 storage/innobase/include/ut0new.h                  |   922 ++
 storage/innobase/include/ut0pool.h                 |   366 +
 storage/innobase/include/ut0rbt.h                  |    59 +-
 storage/innobase/include/ut0rnd.h                  |    29 +-
 storage/innobase/include/ut0rnd.ic                 |    38 +-
 storage/innobase/include/ut0stage.h                |   594 +
 storage/innobase/include/ut0ut.h                   |   466 +-
 storage/innobase/include/ut0ut.ic                  |   105 +-
 storage/innobase/include/ut0vec.h                  |    55 +-
 storage/innobase/include/ut0vec.ic                 |    97 +-
 storage/innobase/include/ut0wqueue.h               |    41 +-
 storage/innobase/innodb.cmake                      |   285 +
 storage/innobase/lock/lock0iter.cc                 |     9 +-
 storage/innobase/lock/lock0lock.cc                 |  8957 ++++++------
 storage/innobase/lock/lock0prdt.cc                 |  1056 ++
 storage/innobase/lock/lock0wait.cc                 |   105 +-
 storage/innobase/log/log0crypt.cc                  |    56 +-
 storage/innobase/log/log0log.cc                    |  2951 ++--
 storage/innobase/log/log0recv.cc                   |  3606 ++---
 storage/innobase/mach/mach0data.cc                 |   102 +-
 storage/innobase/mem/mem0dbg.cc                    |  1050 --
 storage/innobase/mem/mem0mem.cc                    |   231 +-
 storage/innobase/mem/mem0pool.cc                   |   727 -
 storage/innobase/mtr/mtr0log.cc                    |   148 +-
 storage/innobase/mtr/mtr0mtr.cc                    |  1188 +-
 storage/innobase/os/os0event.cc                    |   550 +
 storage/innobase/os/os0file.cc                     | 11470 ++++++++-------
 storage/innobase/os/os0proc.cc                     |   146 +-
 storage/innobase/os/os0thread.cc                   |   245 +-
 storage/innobase/page/page0cur.cc                  |  1149 +-
 storage/innobase/page/page0page.cc                 |   996 +-
 storage/innobase/page/page0zip.cc                  |   861 +-
 storage/innobase/pars/lexyy.cc                     |   152 +-
 storage/innobase/pars/make_bison.sh                |     3 +-
 storage/innobase/pars/make_flex.sh                 |     1 -
 storage/innobase/pars/pars0grm.cc                  |     5 +-
 storage/innobase/pars/pars0grm.y                   |     5 +-
 storage/innobase/pars/pars0lex.l                   |     5 +-
 storage/innobase/pars/pars0opt.cc                  |    59 +-
 storage/innobase/pars/pars0pars.cc                 |   284 +-
 storage/innobase/pars/pars0sym.cc                  |    43 +-
 storage/innobase/que/que0que.cc                    |   259 +-
 storage/innobase/read/read0read.cc                 |   793 +-
 storage/innobase/rem/rem0cmp.cc                    |  1656 +--
 storage/innobase/rem/rem0rec.cc                    |   590 +-
 storage/innobase/row/row0ext.cc                    |    32 +-
 storage/innobase/row/row0ftsort.cc                 |   514 +-
 storage/innobase/row/row0import.cc                 |  1015 +-
 storage/innobase/row/row0ins.cc                    |  1387 +-
 storage/innobase/row/row0log.cc                    |   861 +-
 storage/innobase/row/row0merge.cc                  |  2321 +++-
 storage/innobase/row/row0mysql.cc                  |  3986 +++---
 storage/innobase/row/row0purge.cc                  |   269 +-
 storage/innobase/row/row0quiesce.cc                |    98 +-
 storage/innobase/row/row0row.cc                    |   471 +-
 storage/innobase/row/row0sel.cc                    |  2084 ++-
 storage/innobase/row/row0trunc.cc                  |  3060 ++++
 storage/innobase/row/row0uins.cc                   |   120 +-
 storage/innobase/row/row0umod.cc                   |   296 +-
 storage/innobase/row/row0undo.cc                   |   116 +-
 storage/innobase/row/row0upd.cc                    |  1283 +-
 storage/innobase/row/row0vers.cc                   |   728 +-
 storage/innobase/srv/srv0conc.cc                   |   442 +-
 storage/innobase/srv/srv0mon.cc                    |   230 +-
 storage/innobase/srv/srv0srv.cc                    |   925 +-
 storage/innobase/srv/srv0start.cc                  |  3088 ++---
 storage/innobase/sync/sync0arr.cc                  |  1103 +-
 storage/innobase/sync/sync0debug.cc                |  1808 +++
 storage/innobase/sync/sync0rw.cc                   |  1056 +-
 storage/innobase/sync/sync0sync.cc                 |  1671 +--
 storage/innobase/trx/trx0i_s.cc                    |   350 +-
 storage/innobase/trx/trx0purge.cc                  |  1119 +-
 storage/innobase/trx/trx0rec.cc                    |  1282 +-
 storage/innobase/trx/trx0roll.cc                   |   656 +-
 storage/innobase/trx/trx0rseg.cc                   |   276 +-
 storage/innobase/trx/trx0sys.cc                    |   683 +-
 storage/innobase/trx/trx0trx.cc                    |  2422 +++-
 storage/innobase/trx/trx0undo.cc                   |   813 +-
 storage/innobase/usr/usr0sess.cc                   |    14 +-
 storage/innobase/ut/ut0bh.cc                       |   159 -
 storage/innobase/ut/ut0crc32.cc                    |   706 +-
 storage/innobase/ut/ut0dbg.cc                      |    83 +-
 storage/innobase/ut/ut0list.cc                     |    23 +-
 storage/innobase/ut/ut0mem.cc                      |   424 +-
 storage/innobase/ut/ut0new.cc                      |   227 +
 storage/innobase/ut/ut0rbt.cc                      |    87 +-
 storage/innobase/ut/ut0rnd.cc                      |     7 +-
 storage/innobase/ut/ut0ut.cc                       |   477 +-
 storage/innobase/ut/ut0vec.cc                      |     4 +-
 storage/innobase/ut/ut0wqueue.cc                   |    35 +-
 .../mysql-test/tokudb/r/type_bit_innodb.result     |     2 +-
 storage/xtradb/CMakeLists.txt                      |     2 +-
 storage/xtradb/handler/ha_innodb.cc                |     2 +-
 storage/xtradb/row/row0upd.cc                      |     6 +-
 736 files changed, 141612 insertions(+), 80558 deletions(-)

diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 36072eb..01d654d 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -170,7 +170,7 @@ debug_cflags="-DEXTRA_DEBUG -DSAFE_MUTEX -DSAFEMALLOC"
 error_inject="--with-error-inject "
 #
 # Base C++ flags for all builds
-base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
+base_cxxflags="-felide-constructors -fexceptions -fno-rtti"
 #
 # Flags for optimizing builds.
 # Be as fast as we can be without losing our ability to backtrace.
diff --git a/configure.cmake b/configure.cmake
index 4470bee..8dffb7e 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -56,7 +56,7 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
   # MySQL "canonical" GCC flags. At least -fno-rtti flag affects
   # ABI and cannot be simply removed. 
   SET(CMAKE_CXX_FLAGS 
-    "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
+    "${CMAKE_CXX_FLAGS} -fno-rtti")
 
   IF (CMAKE_EXE_LINKER_FLAGS MATCHES " -static " 
      OR CMAKE_EXE_LINKER_FLAGS MATCHES " -static$")
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index 24090db..12f3343 100644
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -77,7 +77,9 @@ IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_XTRADB_STORAGE_ENGINE)
       ../storage/innobase/buf/buf0checksum.cc
       ../storage/innobase/ut/ut0crc32.cc
       ../storage/innobase/ut/ut0ut.cc
+      ../storage/innobase/buf/buf0buf.cc
       ../storage/innobase/page/page0zip.cc
+      ../storage/innobase/os/os0file.cc
       )
 
   IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index ae6ffdb..dd97564 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -1,6 +1,5 @@
 /*
-   Copyright (c) 2005, 2012, Oracle and/or its affiliates.
-   Copyright (c) 2014, 2015, MariaDB Corporation.
+   Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
 
    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
@@ -26,43 +25,36 @@
   Published with a permission.
 */
 
+#include <my_config.h>
 #include <my_global.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#ifndef __WIN__
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 #include <my_getopt.h>
 #include <m_string.h>
-#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+#include <welcome_copyright_notice.h>	/* ORACLE_WELCOME_COPYRIGHT_NOTICE */
 
 /* Only parts of these files are included from the InnoDB codebase.
 The parts not included are excluded by #ifndef UNIV_INNOCHECKSUM. */
 
-#include "univ.i"                /*  include all of this */
-
-#define FLST_BASE_NODE_SIZE (4 + 2 * FIL_ADDR_SIZE)
-#define FLST_NODE_SIZE (2 * FIL_ADDR_SIZE)
-#define FSEG_PAGE_DATA FIL_PAGE_DATA
-#define MLOG_1BYTE (1)
-
-#include "ut0ut.h"
-#include "ut0byte.h"
-#include "mach0data.h"
-#include "fsp0types.h"
-#include "rem0rec.h"
-#include "buf0checksum.h"        /* buf_calc_page_*() */
-#include "fil0fil.h"             /* FIL_* */
-#include "page0page.h"           /* PAGE_* */
-#include "page0zip.h"            /* page_zip_*() */
-#include "trx0undo.h"            /* TRX_* */
-#include "fsp0fsp.h"             /* fsp_flags_get_page_size() &
-                                    fsp_flags_get_zip_size() */
-#include "ut0crc32.h"            /* ut_crc32_init() */
-#include "fsp0pagecompress.h"    /* fil_get_compression_alg_name */
+#include "univ.i"			/* include all of this */
+#include "page0size.h"			/* page_size_t */
+#include "page0zip.h"			/* page_zip_calc_checksum() */
+#include "page0page.h"			/* PAGE_* */
+#include "trx0undo.h"			/* TRX_UNDO_* */
+#include "fut0lst.h"			/* FLST_NODE_SIZE */
+#include "buf0checksum.h"		/* buf_calc_page_*() */
+#include "fil0fil.h"			/* FIL_* */
+#include "os0file.h"
+#include "fsp0fsp.h"			/* fsp_flags_get_page_size() &
+					   fsp_flags_get_zip_size() */
+#include "mach0data.h"			/* mach_read_from_4() */
+#include "ut0crc32.h"			/* ut_crc32_init() */
 
 #ifdef UNIV_NONINL
 # include "fsp0fsp.ic"
@@ -71,148 +63,851 @@ The parts not included are excluded by #ifndef UNIV_INNOCHECKSUM. */
 #endif
 
 /* Global variables */
-static my_bool verbose;
-static my_bool debug;
-static my_bool skip_corrupt;
-static my_bool just_count;
-static ulong start_page;
-static ulong end_page;
-static ulong do_page;
-static my_bool use_end_page;
-static my_bool do_one_page;
-static my_bool per_page_details;
-static my_bool do_leaf;
-static ulong n_merge;
-ulong srv_page_size;              /* replaces declaration in srv0srv.c */
-static ulong physical_page_size;  /* Page size in bytes on disk. */
-static ulong logical_page_size;   /* Page size when uncompressed. */
-static bool compressed= false;    /* Is tablespace compressed */
-
-int n_undo_state_active;
-int n_undo_state_cached;
-int n_undo_state_to_free;
-int n_undo_state_to_purge;
-int n_undo_state_prepared;
-int n_undo_state_other;
-int n_undo_insert, n_undo_update, n_undo_other;
-int n_bad_checksum;
-int n_fil_page_index;
-int n_fil_page_undo_log;
-int n_fil_page_inode;
-int n_fil_page_ibuf_free_list;
-int n_fil_page_allocated;
-int n_fil_page_ibuf_bitmap;
-int n_fil_page_type_sys;
-int n_fil_page_type_trx_sys;
-int n_fil_page_type_fsp_hdr;
-int n_fil_page_type_allocated;
-int n_fil_page_type_xdes;
-int n_fil_page_type_blob;
-int n_fil_page_type_zblob;
-int n_fil_page_type_other;
-int n_fil_page_type_page_compressed;
-int n_fil_page_type_page_compressed_encrypted;
-
-int n_fil_page_max_index_id;
-
-#define SIZE_RANGES_FOR_PAGE 10
-#define NUM_RETRIES 3
-#define DEFAULT_RETRY_DELAY 1000000
-
-struct per_page_stats {
-  ulint n_recs;
-  ulint data_size;
-  ulint left_page_no;
-  ulint right_page_no;
-  per_page_stats(ulint n, ulint data, ulint left, ulint right) :
-      n_recs(n), data_size(data), left_page_no(left), right_page_no(right) {}
-  per_page_stats() : n_recs(0), data_size(0), left_page_no(0), right_page_no(0) {}
+static bool			verbose;
+static bool			just_count;
+static uintmax_t		start_page;
+static uintmax_t		end_page;
+static uintmax_t		do_page;
+static bool			use_end_page;
+static bool			do_one_page;
+/* replaces declaration in srv0srv.c */
+ulong				srv_page_size;
+page_size_t			univ_page_size(0, 0, false);
+extern ulong			srv_checksum_algorithm;
+/* Current page number (0 based). */
+uintmax_t			cur_page_num;
+/* Skip the checksum verification. */
+static bool			no_check;
+/* Enabled for strict checksum verification. */
+bool				strict_verify = 0;
+/* Enabled for rewrite checksum. */
+static bool			do_write;
+/* Mismatches count allowed (0 by default). */
+static uintmax_t		allow_mismatches;
+static bool			page_type_summary;
+static bool			page_type_dump;
+/* Store filename for page-type-dump option. */
+char*				page_dump_filename = 0;
+/* skip the checksum verification & rewrite if page is doublewrite buffer. */
+static bool			skip_page = 0;
+const char			*dbug_setting = "FALSE";
+char*				log_filename = NULL;
+/* User defined filename for logging. */
+FILE*				log_file = NULL;
+/* Enabled for log write option. */
+static bool			is_log_enabled = false;
+
+#ifndef _WIN32
+/* advisory lock for non-window system. */
+struct flock			lk;
+#endif /* _WIN32 */
+
+/* Strict check algorithm name. */
+static ulong			strict_check;
+/* Rewrite checksum algorithm name. */
+static ulong			write_check;
+
+/* Innodb page type. */
+struct innodb_page_type {
+	int n_undo_state_active;
+	int n_undo_state_cached;
+	int n_undo_state_to_free;
+	int n_undo_state_to_purge;
+	int n_undo_state_prepared;
+	int n_undo_state_other;
+	int n_undo_insert;
+	int n_undo_update;
+	int n_undo_other;
+	int n_fil_page_index;
+	int n_fil_page_undo_log;
+	int n_fil_page_inode;
+	int n_fil_page_ibuf_free_list;
+	int n_fil_page_ibuf_bitmap;
+	int n_fil_page_type_sys;
+	int n_fil_page_type_trx_sys;
+	int n_fil_page_type_fsp_hdr;
+	int n_fil_page_type_allocated;
+	int n_fil_page_type_xdes;
+	int n_fil_page_type_blob;
+	int n_fil_page_type_zblob;
+	int n_fil_page_type_other;
+	int n_fil_page_type_zblob2;
+} page_type;
+
+/* Possible values for "--strict-check" for strictly verify checksum
+and "--write" for rewrite checksum. */
+static const char *innochecksum_algorithms[] = {
+	"crc32",
+	"crc32",
+	"innodb",
+	"innodb",
+	"none",
+	"none",
+	NullS
 };
 
-struct per_index_stats {
-  unsigned long long pages;
-  unsigned long long leaf_pages;
-  ulint first_leaf_page;
-  ulint count;
-  ulint free_pages;
-  ulint max_data_size;
-  unsigned long long total_n_recs;
-  unsigned long long total_data_bytes;
-
-  /*!< first element for empty pages,
-  last element for pages with more than logical_page_size */
-  unsigned long long pages_in_size_range[SIZE_RANGES_FOR_PAGE+2];
-
-  std::map<ulint, per_page_stats> leaves;
-
-  per_index_stats():pages(0), leaf_pages(0), first_leaf_page(0),
-                    count(0), free_pages(0), max_data_size(0), total_n_recs(0),
-                    total_data_bytes(0)
-  {
-    memset(pages_in_size_range, 0, sizeof(pages_in_size_range));
-  }
+/* Used to define an enumerate type of the "innochecksum algorithm". */
+static TYPELIB innochecksum_algorithms_typelib = {
+	array_elements(innochecksum_algorithms)-1,"",
+	innochecksum_algorithms, NULL
 };
 
-std::map<unsigned long long, per_index_stats> index_ids;
+/** Get the page size of the filespace from the filespace header.
+ at param[in]	buf	buffer used to read the page.
+ at return page size */
+static
+const page_size_t
+get_page_size(
+	byte*	buf)
+{
+	const ulint	flags = mach_read_from_4(buf + FIL_PAGE_DATA
+						 + FSP_SPACE_FLAGS);
+
+	const ulint	ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags);
+
+	if (ssize == 0) {
+		srv_page_size = UNIV_PAGE_SIZE_ORIG;
+	} else {
+		srv_page_size = ((UNIV_ZIP_SIZE_MIN >> 1) << ssize);
+	}
 
-bool encrypted = false;
+	univ_page_size.copy_from(
+		page_size_t(srv_page_size, srv_page_size, false));
 
-/* Get the page size of the filespace from the filespace header. */
+	return(page_size_t(flags));
+}
+
+/** Decompress a page
+ at param[in,out]	buf		Page read from disk, uncompressed data will
+				also be copied to this page
+ at param[in, out] scratch		Page to use for temporary decompress
+ at param[in]	page_size	scratch physical size
+ at return true if decompress succeeded */
 static
-my_bool
-get_page_size(
-/*==========*/
-  FILE*  f,                     /*!< in: file pointer, must be open
-                                         and set to start of file */
-  byte* buf,                    /*!< in: buffer used to read the page */
-  ulong* logical_page_size,     /*!< out: Logical/Uncompressed page size */
-  ulong* physical_page_size)    /*!< out: Physical/Commpressed page size */
+bool page_decompress(
+	byte*		buf,
+	byte*		scratch,
+	page_size_t	page_size)
 {
-  ulong flags;
+	dberr_t		err=DB_SUCCESS;
 
-  int bytes= fread(buf, 1, UNIV_PAGE_SIZE_MIN, f);
+	/* Set the dblwr recover flag to false. */
+	/* JAN: TODO: Decompress
+	err = os_file_decompress_page(
+		false, buf, scratch, page_size.physical());
+	*/
 
-  if (ferror(f))
-  {
-    perror("Error reading file header");
-    return FALSE;
-  }
+	return(err == DB_SUCCESS);
+}
 
-  if (bytes != UNIV_PAGE_SIZE_MIN)
-  {
-    fprintf(stderr, "Error; Was not able to read the minimum page size ");
-    fprintf(stderr, "of %d bytes.  Bytes read was %d\n", UNIV_PAGE_SIZE_MIN, bytes);
-    return FALSE;
-  }
+#ifdef _WIN32
+/***********************************************//*
+ @param		[in] error	error no. from the getLastError().
 
-  rewind(f);
+ @retval error message corresponding to error no.
+*/
+static
+char*
+error_message(
+	int	error)
+{
+	static char err_msg[1024] = {'\0'};
+	FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
+		NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+		(LPTSTR)err_msg, sizeof(err_msg), NULL );
 
-  flags = mach_read_from_4(buf + FIL_PAGE_DATA + FSP_SPACE_FLAGS);
+	return (err_msg);
+}
+#endif /* _WIN32 */
 
-  /* srv_page_size is used by InnoDB code as UNIV_PAGE_SIZE */
-  srv_page_size = *logical_page_size = fsp_flags_get_page_size(flags);
+/***********************************************//*
+ @param>>_______[in] name>_____name of file.
+ @retval file pointer; file pointer is NULL when error occured.
+*/
 
-  /* fsp_flags_get_zip_size() will return zero if not compressed. */
-  *physical_page_size = fsp_flags_get_zip_size(flags);
-  if (*physical_page_size == 0)
-  {
-    *physical_page_size= *logical_page_size;
-  }
-  else
-  {
-    compressed= true;
-  }
+FILE*
+open_file(
+	const char*	name)
+{
+	int	fd;		/* file descriptor. */
+	FILE*	fil_in;
+#ifdef _WIN32
+	HANDLE		hFile;		/* handle to open file. */
+	DWORD		access;		/* define access control */
+	int		flags = 0;	/* define the mode for file
+					descriptor */
+
+	if (do_write) {
+		access =  GENERIC_READ | GENERIC_WRITE;
+		flags =  _O_RDWR | _O_BINARY;
+	} else {
+		access = GENERIC_READ;
+		flags = _O_RDONLY | _O_BINARY;
+	}
+	/* CreateFile() also provide advisory lock with the usage of
+	access and share mode of the file.*/
+	hFile = CreateFile(
+			(LPCTSTR) name, access, 0L, NULL,
+			OPEN_EXISTING, NULL, NULL);
+
+	if (hFile == INVALID_HANDLE_VALUE) {
+		/* print the error message. */
+		fprintf(stderr, "Filename::%s %s\n",
+			error_message(GetLastError()));
+
+			return (NULL);
+		}
+
+	/* get the file descriptor. */
+	fd= _open_osfhandle((intptr_t)hFile, flags);
+#else /* _WIN32 */
+
+	int	create_flag;
+	/* define the advisory lock and open file mode. */
+	if (do_write) {
+		create_flag = O_RDWR;
+		lk.l_type = F_WRLCK;
+	}
+	else {
+		create_flag = O_RDONLY;
+		lk.l_type = F_RDLCK;
+	}
+
+	fd = open(name, create_flag);
+
+	lk.l_whence = SEEK_SET;
+	lk.l_start = lk.l_len = 0;
+
+	if (fcntl(fd, F_SETLK, &lk) == -1) {
+		fprintf(stderr, "Error: Unable to lock file::"
+			" %s\n", name);
+		perror("fcntl");
+		return (NULL);
+	}
+#endif /* _WIN32 */
 
+	if (do_write) {
+		fil_in = fdopen(fd, "rb+");
+	} else {
+		fil_in = fdopen(fd, "rb");
+	}
 
-  return TRUE;
+	return (fil_in);
 }
 
+/************************************************************//*
+ Read the content of file
+
+ @param  [in,out]	buf			read the file in buffer
+ @param  [in]		partial_page_read	enable when to read the
+						remaining buffer for first page.
+ @param  [in]		physical_page_size	Physical/Commpressed page size.
+ @param  [in,out]	fil_in			file pointer created for the
+						tablespace.
+ @retval no. of bytes read.
+*/
+ulong read_file(
+	byte*	buf,
+	bool	partial_page_read,
+	ulong	physical_page_size,
+	FILE*	fil_in)
+{
+	ulong bytes = 0;
 
-/* command line argument to do page checks (that's it) */
-/* another argument to specify page ranges... seek to right spot and go from there */
+	DBUG_ASSERT(physical_page_size >= UNIV_ZIP_SIZE_MIN);
 
-static struct my_option innochecksum_options[] =
+	if (partial_page_read) {
+		buf += UNIV_ZIP_SIZE_MIN;
+		physical_page_size -= UNIV_ZIP_SIZE_MIN;
+		bytes = UNIV_ZIP_SIZE_MIN;
+	}
+
+	bytes += ulong(fread(buf, 1, physical_page_size, fil_in));
+
+	return bytes;
+}
+
+/** Check if page is corrupted or not.
+ at param[in]	buf		page frame
+ at param[in]	page_size	page size
+ at retval true if page is corrupted otherwise false. */
+static
+bool
+is_page_corrupted(
+	const byte*		buf,
+	const page_size_t&	page_size)
 {
+
+	/* enable if page is corrupted. */
+	bool is_corrupted;
+	/* use to store LSN values. */
+	ulint logseq;
+	ulint logseqfield;
+
+	if (!page_size.is_compressed()) {
+		/* check the stored log sequence numbers
+		for uncompressed tablespace. */
+		logseq = mach_read_from_4(buf + FIL_PAGE_LSN + 4);
+		logseqfield = mach_read_from_4(
+				buf + page_size.logical() -
+				FIL_PAGE_END_LSN_OLD_CHKSUM + 4);
+
+		if (is_log_enabled) {
+			fprintf(log_file,
+				"page::%lu log sequence number:first = %lu;"
+				" second = %lu\n",
+				cur_page_num, logseq, logseqfield);
+			if (logseq != logseqfield) {
+				fprintf(log_file,
+					"Fail; page %lu invalid (fails log "
+					"sequence number check)\n",
+					cur_page_num);
+			}
+		}
+	}
+
+	is_corrupted = buf_page_is_corrupted(
+		true, buf, page_size, false, cur_page_num, strict_verify,
+		is_log_enabled, log_file);
+
+	return(is_corrupted);
+}
+
+/********************************************//*
+ Check if page is doublewrite buffer or not.
+ @param [in] page	buffer page
+
+ @retval true  if page is doublewrite buffer otherwise false.
+*/
+static
+bool
+is_page_doublewritebuffer(
+	const byte*	page)
+{
+	if ((cur_page_num >= FSP_EXTENT_SIZE)
+		&& (cur_page_num < FSP_EXTENT_SIZE * 3)) {
+		/* page is doublewrite buffer. */
+		return (true);
+	}
+
+	return (false);
+}
+
+/*******************************************************//*
+Check if page is empty or not.
+ @param		[in] page		page to checked for empty.
+ @param		[in] len	size of page.
+
+ @retval true if page is empty.
+ @retval false if page is not empty.
+*/
+static
+bool
+is_page_empty(
+	const byte*	page,
+	size_t		len)
+{
+	while (len--) {
+		if (*page++) {
+			return (false);
+		}
+        }
+        return (true);
+}
+
+/********************************************************************//**
+Rewrite the checksum for the page.
+ at param	[in/out] page			page buffer
+ at param	[in] physical_page_size		page size in bytes on disk.
+ at param	[in] iscompressed		Is compressed/Uncompressed Page.
+
+ at retval true  : do rewrite
+ at retval false : skip the rewrite as checksum stored match with
+		calculated or page is doublwrite buffer.
+*/
+
+bool
+update_checksum(
+	byte*	page,
+	ulong	physical_page_size,
+	bool	iscompressed)
+{
+	ib_uint32_t	checksum = 0;
+	byte		stored1[4];	/* get FIL_PAGE_SPACE_OR_CHKSUM field checksum */
+	byte		stored2[4];	/* get FIL_PAGE_END_LSN_OLD_CHKSUM field checksum */
+
+	ut_ad(page);
+	/* If page is doublewrite buffer, skip the rewrite of checksum. */
+	if (skip_page) {
+		return (false);
+	}
+
+	memcpy(stored1, page + FIL_PAGE_SPACE_OR_CHKSUM, 4);
+	memcpy(stored2, page + physical_page_size -
+	       FIL_PAGE_END_LSN_OLD_CHKSUM, 4);
+
+	/* Check if page is empty, exclude the checksum field */
+	if (is_page_empty(page + 4, physical_page_size - 12)
+	    && is_page_empty(page + physical_page_size - 4, 4)) {
+
+		memset(page + FIL_PAGE_SPACE_OR_CHKSUM, 0, 4);
+		memset(page + physical_page_size -
+		       FIL_PAGE_END_LSN_OLD_CHKSUM, 0, 4);
+
+		goto func_exit;
+	}
+
+	if (iscompressed) {
+		/* page is compressed */
+		checksum = page_zip_calc_checksum(
+			page, physical_page_size,
+			static_cast<srv_checksum_algorithm_t>(write_check));
+
+		mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum);
+		if (is_log_enabled) {
+			fprintf(log_file, "page::%lu; Updated checksum ="
+				" %u\n", cur_page_num, checksum);
+		}
+
+	} else {
+		/* page is uncompressed. */
+
+		/* Store the new formula checksum */
+		switch ((srv_checksum_algorithm_t) write_check) {
+
+		case SRV_CHECKSUM_ALGORITHM_CRC32:
+		case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
+			checksum = buf_calc_page_crc32(page);
+			break;
+
+		case SRV_CHECKSUM_ALGORITHM_INNODB:
+		case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
+			checksum = (ib_uint32_t)
+					buf_calc_page_new_checksum(page);
+			break;
+
+		case SRV_CHECKSUM_ALGORITHM_NONE:
+		case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
+			checksum = BUF_NO_CHECKSUM_MAGIC;
+			break;
+		/* no default so the compiler will emit a warning if new
+		enum is added and not handled here */
+		}
+
+		mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM, checksum);
+		if (is_log_enabled) {
+			fprintf(log_file, "page::%lu; Updated checksum field1"
+				" = %u\n", cur_page_num, checksum);
+		}
+
+		if (write_check == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB
+		    || write_check == SRV_CHECKSUM_ALGORITHM_INNODB) {
+			checksum = (ib_uint32_t)
+					buf_calc_page_old_checksum(page);
+		}
+
+		mach_write_to_4(page + physical_page_size -
+				FIL_PAGE_END_LSN_OLD_CHKSUM,checksum);
+
+		if (is_log_enabled) {
+			fprintf(log_file, "page::%lu ; Updated checksum "
+				"field2 = %u\n", cur_page_num, checksum);
+		}
+
+	}
+
+	func_exit:
+	/* The following code is to check the stored checksum with the
+	calculated checksum. If it matches, then return FALSE to skip
+	the rewrite of checksum, otherwise return TRUE. */
+	if (iscompressed) {
+		if (!memcmp(stored1, page + FIL_PAGE_SPACE_OR_CHKSUM, 4)) {
+			return (false);
+		}
+		return (true);
+	}
+
+	if (!memcmp(stored1, page + FIL_PAGE_SPACE_OR_CHKSUM, 4)
+	    && !memcmp(stored2, page + physical_page_size -
+		       FIL_PAGE_END_LSN_OLD_CHKSUM, 4)) {
+		return (false);
+
+	}
+
+	return (true);
+}
+
+/**
+ Write the content to the file
+ at param[in]		filename	name of the file.
+ at param[in,out]		file		file pointer where content
+					have to be written
+ at param[in]		buf		file buffer read
+ at param[in]		compressed	Enabled if tablespace is
+					compressed.
+ at param[in,out]		pos		current file position.
+ at param[in]		page_size	page size in bytes on disk.
+
+ at retval true	if successfully written
+ at retval false	if a non-recoverable error occurred
+*/
+static
+bool
+write_file(
+	const char*	filename,
+	FILE*		file,
+	byte*		buf,
+	bool		compressed,
+	fpos_t*		pos,
+	ulong		page_size)
+{
+	bool	do_update;
+
+	do_update = update_checksum(buf, page_size, compressed);
+
+	if (file != stdin) {
+		if (do_update) {
+			/* Set the previous file pointer position
+			saved in pos to current file position. */
+			if (0 != fsetpos(file, pos)) {
+				perror("fsetpos");
+				return(false);
+			}
+		} else {
+			/* Store the current file position in pos */
+			if (0 != fgetpos(file, pos)) {
+				perror("fgetpos");
+				return(false);
+			}
+			return(true);
+		}
+	}
+
+	if (page_size
+		!= fwrite(buf, 1, page_size, file == stdin ? stdout : file)) {
+		fprintf(stderr, "Failed to write page %lu to %s: %s\n",
+			cur_page_num, filename, strerror(errno));
+
+		return(false);
+	}
+	if (file != stdin) {
+		fflush(file);
+		/* Store the current file position in pos */
+		if (0 != fgetpos(file, pos)) {
+			perror("fgetpos");
+			return(false);
+		}
+	}
+
+	return(true);
+}
+
+/*
+Parse the page and collect/dump the information about page type
+ at param [in] page	buffer page
+ at param [in] file	file for diagnosis.
+*/
+void
+parse_page(
+	const byte*	page,
+	FILE*		file)
+{
+	unsigned long long id;
+	ulint undo_page_type;
+	char str[20]={'\0'};
+
+	/* Check whether page is doublewrite buffer. */
+	if(skip_page) {
+		strcpy(str, "Double_write_buffer");
+	} else {
+		strcpy(str, "-");
+	}
+
+	switch (mach_read_from_2(page + FIL_PAGE_TYPE)) {
+
+	case FIL_PAGE_INDEX:
+		page_type.n_fil_page_index++;
+		id = mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID);
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tIndex page\t\t\t|"
+				"\tindex id=%llu,", cur_page_num, id);
+
+			fprintf(file,
+				" page level=%lu, No. of records=%lu,"
+				" garbage=%lu, %s\n",
+				page_header_get_field(page, PAGE_LEVEL),
+				page_header_get_field(page, PAGE_N_RECS),
+				page_header_get_field(page, PAGE_GARBAGE), str);
+		}
+		break;
+
+	case FIL_PAGE_UNDO_LOG:
+		page_type.n_fil_page_undo_log++;
+		undo_page_type = mach_read_from_2(page +
+				     TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_TYPE);
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tUndo log page\t\t\t|",
+				cur_page_num);
+		}
+		if (undo_page_type == TRX_UNDO_INSERT) {
+			page_type.n_undo_insert++;
+			if (page_type_dump) {
+				fprintf(file, "\t%s",
+					"Insert Undo log page");
+			}
+
+		} else if (undo_page_type == TRX_UNDO_UPDATE) {
+			page_type.n_undo_update++;
+			if (page_type_dump) {
+				fprintf(file, "\t%s",
+					"Update undo log page");
+			}
+		}
+
+		undo_page_type = mach_read_from_2(page + TRX_UNDO_SEG_HDR +
+						  TRX_UNDO_STATE);
+		switch (undo_page_type) {
+			case TRX_UNDO_ACTIVE:
+				page_type.n_undo_state_active++;
+				if (page_type_dump) {
+					fprintf(file, ", %s", "Undo log of "
+						"an active transaction");
+				}
+				break;
+
+			case TRX_UNDO_CACHED:
+				page_type.n_undo_state_cached++;
+				if (page_type_dump) {
+					fprintf(file, ", %s", "Page is "
+						"cached for quick reuse");
+				}
+				break;
+
+			case TRX_UNDO_TO_FREE:
+				page_type.n_undo_state_to_free++;
+				if (page_type_dump) {
+					fprintf(file, ", %s", "Insert undo "
+						"segment that can be freed");
+				}
+				break;
+
+			case TRX_UNDO_TO_PURGE:
+				page_type.n_undo_state_to_purge++;
+				if (page_type_dump) {
+					fprintf(file, ", %s", "Will be "
+						"freed in purge when all undo"
+					"data in it is removed");
+				}
+				break;
+
+			case TRX_UNDO_PREPARED:
+				page_type.n_undo_state_prepared++;
+				if (page_type_dump) {
+					fprintf(file, ", %s", "Undo log of "
+						"an prepared transaction");
+				}
+				break;
+
+			default:
+				page_type.n_undo_state_other++;
+				break;
+		}
+		if(page_type_dump) {
+			fprintf(file, ", %s\n", str);
+		}
+		break;
+
+	case FIL_PAGE_INODE:
+		page_type.n_fil_page_inode++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tInode page\t\t\t|"
+				"\t%s\n",cur_page_num, str);
+		}
+		break;
+
+	case FIL_PAGE_IBUF_FREE_LIST:
+		page_type.n_fil_page_ibuf_free_list++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tInsert buffer free list"
+				" page\t|\t%s\n", cur_page_num, str);
+		}
+		break;
+
+	case FIL_PAGE_TYPE_ALLOCATED:
+		page_type.n_fil_page_type_allocated++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tFreshly allocated "
+				"page\t\t|\t%s\n", cur_page_num, str);
+		}
+		break;
+
+	case FIL_PAGE_IBUF_BITMAP:
+		page_type.n_fil_page_ibuf_bitmap++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tInsert Buffer "
+				"Bitmap\t\t|\t%s\n", cur_page_num, str);
+		}
+		break;
+
+	case FIL_PAGE_TYPE_SYS:
+		page_type.n_fil_page_type_sys++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tSystem page\t\t\t|"
+				"\t%s\n",cur_page_num, str);
+		}
+		break;
+
+	case FIL_PAGE_TYPE_TRX_SYS:
+		page_type.n_fil_page_type_trx_sys++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tTransaction system "
+				"page\t\t|\t%s\n", cur_page_num, str);
+		}
+		break;
+
+	case FIL_PAGE_TYPE_FSP_HDR:
+		page_type.n_fil_page_type_fsp_hdr++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tFile Space "
+				"Header\t\t|\t%s\n", cur_page_num, str);
+		}
+		break;
+
+	case FIL_PAGE_TYPE_XDES:
+		page_type.n_fil_page_type_xdes++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tExtent descriptor "
+				"page\t\t|\t%s\n", cur_page_num, str);
+		}
+		break;
+
+	case FIL_PAGE_TYPE_BLOB:
+		page_type.n_fil_page_type_blob++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tBLOB page\t\t\t|\t%s\n",
+				cur_page_num, str);
+		}
+		break;
+
+	case FIL_PAGE_TYPE_ZBLOB:
+		page_type.n_fil_page_type_zblob++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tCompressed BLOB "
+				"page\t\t|\t%s\n", cur_page_num, str);
+		}
+		break;
+
+	case FIL_PAGE_TYPE_ZBLOB2:
+		page_type.n_fil_page_type_zblob2++;
+		if (page_type_dump) {
+			fprintf(file, "#::%lu \t\t|\t\tSubsequent Compressed "
+				"BLOB page\t|\t%s\n", cur_page_num, str);
+		}
+			break;
+
+	default:
+		page_type.n_fil_page_type_other++;
+		break;
+	}
+}
+/**
+ at param [in/out] file_name	name of the filename
+
+ at retval FILE pointer if successfully created else NULL when error occured.
+*/
+FILE*
+create_file(
+	char*	file_name)
+{
+	FILE*	file = NULL;
+
+#ifndef _WIN32
+	file = fopen(file_name, "wb");
+	if (file == NULL) {
+		fprintf(stderr, "Failed to create file: %s: %s\n",
+			file_name, strerror(errno));
+		return(NULL);
+	}
+#else
+	HANDLE		hFile;		/* handle to open file. */
+	int fd = 0;
+	hFile = CreateFile((LPCTSTR) file_name,
+			  GENERIC_READ | GENERIC_WRITE,
+			  FILE_SHARE_READ | FILE_SHARE_DELETE,
+			  NULL, CREATE_NEW, NULL, NULL);
+
+	if (hFile == INVALID_HANDLE_VALUE) {
+		/* print the error message. */
+		fprintf(stderr, "Filename::%s %s\n",
+			file_name,
+			error_message(GetLastError()));
+
+			return(NULL);
+		}
+
+	/* get the file descriptor. */
+	fd= _open_osfhandle((intptr_t)hFile, _O_RDWR | _O_BINARY);
+	file = fdopen(fd, "wb");
+#endif /* _WIN32 */
+
+	return(file);
+}
+
+/*
+ Print the page type count of a tablespace.
+ @param [in] fil_out	stream where the output goes.
+*/
+void
+print_summary(
+	FILE*	fil_out)
+{
+	fprintf(fil_out, "\n================PAGE TYPE SUMMARY==============\n");
+	fprintf(fil_out, "#PAGE_COUNT\tPAGE_TYPE");
+	fprintf(fil_out, "\n===============================================\n");
+	fprintf(fil_out, "%8d\tIndex page\n",
+		page_type.n_fil_page_index);
+	fprintf(fil_out, "%8d\tUndo log page\n",
+		page_type.n_fil_page_undo_log);
+	fprintf(fil_out, "%8d\tInode page\n",
+		page_type.n_fil_page_inode);
+	fprintf(fil_out, "%8d\tInsert buffer free list page\n",
+		page_type.n_fil_page_ibuf_free_list);
+	fprintf(fil_out, "%8d\tFreshly allocated page\n",
+		page_type.n_fil_page_type_allocated);
+	fprintf(fil_out, "%8d\tInsert buffer bitmap\n",
+		page_type.n_fil_page_ibuf_bitmap);
+	fprintf(fil_out, "%8d\tSystem page\n",
+		page_type.n_fil_page_type_sys);
+	fprintf(fil_out, "%8d\tTransaction system page\n",
+		page_type.n_fil_page_type_trx_sys);
+	fprintf(fil_out, "%8d\tFile Space Header\n",
+		page_type.n_fil_page_type_fsp_hdr);
+	fprintf(fil_out, "%8d\tExtent descriptor page\n",
+		page_type.n_fil_page_type_xdes);
+	fprintf(fil_out, "%8d\tBLOB page\n",
+		page_type.n_fil_page_type_blob);
+	fprintf(fil_out, "%8d\tCompressed BLOB page\n",
+		page_type.n_fil_page_type_zblob);
+	fprintf(fil_out, "%8d\tOther type of page",
+		page_type.n_fil_page_type_other);
+	fprintf(fil_out, "\n===============================================\n");
+	fprintf(fil_out, "Additional information:\n");
+	fprintf(fil_out, "Undo page type: %d insert, %d update, %d other\n",
+		page_type.n_undo_insert,
+		page_type.n_undo_update,
+		page_type.n_undo_other);
+	fprintf(fil_out, "Undo page state: %d active, %d cached, %d to_free, %d"
+		" to_purge, %d prepared, %d other\n",
+		page_type.n_undo_state_active,
+		page_type.n_undo_state_cached,
+		page_type.n_undo_state_to_free,
+		page_type.n_undo_state_to_purge,
+		page_type.n_undo_state_prepared,
+		page_type.n_undo_state_other);
+}
+
+/* command line argument for innochecksum tool. */
+static struct my_option innochecksum_options[] = {
   {"help", '?', "Displays this help and exits.",
     0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"info", 'I', "Synonym for --help.",
@@ -221,779 +916,599 @@ static struct my_option innochecksum_options[] =
     0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"verbose", 'v', "Verbose (prints progress every 5 seconds).",
     &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"debug", 'd', "Debug mode (prints checksums for each page, implies verbose).",
-    &debug, &debug, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"skip_corrupt", 'u', "Skip corrupt pages.",
-    &skip_corrupt, &skip_corrupt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"count", 'c', "Print the count of pages in the file.",
+#ifndef DBUG_OFF
+  {"debug", '#', "Output debug log. See " REFMAN "dbug-package.html",
+    &dbug_setting, &dbug_setting, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+#endif /* !DBUG_OFF */
+  {"count", 'c', "Print the count of pages in the file and exits.",
     &just_count, &just_count, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"start_page", 's', "Start on this page number (0 based).",
-    &start_page, &start_page, 0, GET_ULONG, REQUIRED_ARG,
-    0, 0, (longlong) 2L*1024L*1024L*1024L, 0, 1, 0},
+    &start_page, &start_page, 0, GET_ULL, REQUIRED_ARG,
+    0, 0, ULLONG_MAX, 0, 1, 0},
   {"end_page", 'e', "End at this page number (0 based).",
-    &end_page, &end_page, 0, GET_ULONG, REQUIRED_ARG,
-    0, 0, (longlong) 2L*1024L*1024L*1024L, 0, 1, 0},
+    &end_page, &end_page, 0, GET_ULL, REQUIRED_ARG,
+    0, 0, ULLONG_MAX, 0, 1, 0},
   {"page", 'p', "Check only this page (0 based).",
-    &do_page, &do_page, 0, GET_ULONG, REQUIRED_ARG,
-    0, 0, (longlong) 2L*1024L*1024L*1024L, 0, 1, 0},
-  {"per_page_details", 'i', "Print out per-page detail information.",
-    &per_page_details, &per_page_details, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}
-    ,
-  {"leaf", 'l', "Examine leaf index pages",
-    &do_leaf, &do_leaf, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"merge", 'm', "leaf page count if merge given number of consecutive pages",
-   &n_merge, &n_merge, 0, GET_ULONG, REQUIRED_ARG,
-   0, 0, (longlong)10L, 0, 1, 0},
+    &do_page, &do_page, 0, GET_ULL, REQUIRED_ARG,
+    0, 0, ULLONG_MAX, 0, 1, 0},
+  {"strict-check", 'C', "Specify the strict checksum algorithm by the user.",
+    &strict_check, &strict_check, &innochecksum_algorithms_typelib,
+    GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"no-check", 'n', "Ignore the checksum verification.",
+    &no_check, &no_check, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"allow-mismatches", 'a', "Maximum checksum mismatch allowed.",
+    &allow_mismatches, &allow_mismatches, 0,
+    GET_ULL, REQUIRED_ARG, 0, 0, ULLONG_MAX, 0, 1, 0},
+  {"write", 'w', "Rewrite the checksum algorithm by the user.",
+    &write_check, &write_check, &innochecksum_algorithms_typelib,
+    GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"page-type-summary", 'S', "Display a count of each page type "
+   "in a tablespace.", &page_type_summary, &page_type_summary, 0,
+   GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"page-type-dump", 'D', "Dump the page type info for each page in a "
+   "tablespace.", &page_dump_filename, &page_dump_filename, 0,
+   GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   {"log", 'l', "log output.",
+     &log_filename, &log_filename, 0,
+      GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 
+/* Print out the Innodb version and machine information. */
 static void print_version(void)
 {
-  printf("%s Ver %s, for %s (%s)\n",
-         my_progname, INNODB_VERSION_STR,
-         SYSTEM_TYPE, MACHINE_TYPE);
+#ifdef DBUG_OFF
+	printf("%s Ver %s, for %s (%s)\n",
+		my_progname, INNODB_VERSION_STR,
+		SYSTEM_TYPE, MACHINE_TYPE);
+#else
+	printf("%s-debug Ver %s, for %s (%s)\n",
+		my_progname, INNODB_VERSION_STR,
+		SYSTEM_TYPE, MACHINE_TYPE);
+#endif /* DBUG_OFF */
 }
 
 static void usage(void)
 {
-  print_version();
-  puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
-  printf("InnoDB offline file checksum utility.\n");
-  printf("Usage: %s [-c] [-s <start page>] [-e <end page>] [-p <page>] [-v] [-d] <filename>\n", my_progname);
-  my_print_help(innochecksum_options);
-  my_print_variables(innochecksum_options);
+	print_version();
+	puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
+	printf("InnoDB offline file checksum utility.\n");
+	printf("Usage: %s [-c] [-s <start page>] [-e <end page>] "
+		"[-p <page>] [-v]  [-a <allow mismatches>] [-n] "
+		"[-C <strict-check>] [-w <write>] [-S] [-D <page type dump>] "
+		"[-l <log>] <filename or [-]>\n", my_progname);
+	printf("See " REFMAN "innochecksum.html for usage hints.\n");
+	my_print_help(innochecksum_options);
+	my_print_variables(innochecksum_options);
 }
 
 extern "C" my_bool
 innochecksum_get_one_option(
-/*========================*/
-  int optid,
-  const struct my_option *opt __attribute__((unused)),
-  char *argument __attribute__((unused)))
+	int			optid,
+	const struct my_option	*opt __attribute__((unused)),
+	char			*argument __attribute__((unused)))
 {
-  switch (optid) {
-  case 'd':
-    verbose=1;	/* debug implies verbose... */
-    break;
-  case 'e':
-    use_end_page= 1;
-    break;
-  case 'p':
-    end_page= start_page= do_page;
-    use_end_page= 1;
-    do_one_page= 1;
-    break;
-  case 'V':
-    print_version();
-    exit(0);
-    break;
-  case 'I':
-  case '?':
-    usage();
-    exit(0);
-    break;
-  }
-  return 0;
-}
+	switch (optid) {
+#ifndef DBUG_OFF
+	case '#':
+		dbug_setting = argument
+			? argument
+			: IF_WIN("d:O,innochecksum.trace",
+				 "d:o,/tmp/innochecksum.trace");
+		DBUG_PUSH(dbug_setting);
+		break;
+#endif /* !DBUG_OFF */
+	case 'e':
+		use_end_page = true;
+		break;
+	case 'p':
+		end_page = start_page = do_page;
+		use_end_page = true;
+		do_one_page = true;
+		break;
+	case 'V':
+		print_version();
+		exit(EXIT_SUCCESS);
+		break;
+	case 'C':
+		strict_verify = true;
+		switch ((srv_checksum_algorithm_t) strict_check) {
+
+		case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
+		case SRV_CHECKSUM_ALGORITHM_CRC32:
+			srv_checksum_algorithm =
+				SRV_CHECKSUM_ALGORITHM_STRICT_CRC32;
+			break;
+
+		case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
+		case SRV_CHECKSUM_ALGORITHM_INNODB:
+			srv_checksum_algorithm =
+				SRV_CHECKSUM_ALGORITHM_STRICT_INNODB;
+			break;
+
+		case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
+		case SRV_CHECKSUM_ALGORITHM_NONE:
+			srv_checksum_algorithm =
+				SRV_CHECKSUM_ALGORITHM_STRICT_NONE;
+			break;
+		default:
+			return(true);
+		}
+		break;
+	case 'n':
+		no_check = true;
+		break;
+	case 'a':
+	case 'S':
+		break;
+	case 'w':
+		do_write = true;
+		break;
+	case 'D':
+		page_type_dump = true;
+		break;
+	case 'l':
+		is_log_enabled = true;
+		break;
+	case 'I':
+	case '?':
+		usage();
+		exit(EXIT_SUCCESS);
+		break;
+	}
 
-static int get_options(
-/*===================*/
-  int *argc,
-  char ***argv)
-{
-  int ho_error;
-
-  if ((ho_error=handle_options(argc, argv, innochecksum_options, innochecksum_get_one_option)))
-    exit(ho_error);
-
-  /* The next arg must be the filename */
-  if (!*argc)
-  {
-    usage();
-    return 1;
-  }
-  return 0;
-} /* get_options */
-
-/*********************************************************************//**
-Gets the file page type.
- at return type; NOTE that if the type has not been written to page, the
-return value not defined */
-ulint
-fil_page_get_type(
-/*==============*/
-       uchar*  page)   /*!< in: file page */
-{
-       return(mach_read_from_2(page + FIL_PAGE_TYPE));
+	return(false);
 }
 
-/**************************************************************//**
-Gets the index id field of a page.
- at return        index id */
-ib_uint64_t
-btr_page_get_index_id(
-/*==================*/
-       uchar*  page)   /*!< in: index page */
+static
+bool
+get_options(
+	int	*argc,
+	char	***argv)
 {
-       return(mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID));
-}
+	if (handle_options(argc, argv, innochecksum_options,
+		innochecksum_get_one_option))
+		exit(true);
+
+	/* The next arg must be the filename */
+	if (!*argc) {
+		usage();
+		return (true);
+	}
 
-/********************************************************//**
-Gets the next index page number.
- at return	next page number */
-ulint
-btr_page_get_next(
-/*==============*/
-  const page_t* page) /*!< in: index page */
-{
-  return(mach_read_from_4(page + FIL_PAGE_NEXT));
+	return (false);
 }
 
-/********************************************************//**
-Gets the previous index page number.
- at return	prev page number */
-ulint
-btr_page_get_prev(
-/*==============*/
-  const page_t* page) /*!< in: index page */
+int main(
+	int	argc,
+	char	**argv)
 {
-  return(mach_read_from_4(page + FIL_PAGE_PREV));
-}
+	/* our input file. */
+	FILE*		fil_in = NULL;
+	/* our input filename. */
+	char*		filename;
+	/* Buffer to store pages read. */
+	byte*		buf = NULL;
+	/* bytes read count */
+	ulong		bytes;
+	/* Buffer to decompress page.*/
+	byte*		tbuf = NULL;
+	/* current time */
+	time_t		now;
+	/* last time */
+	time_t		lastt;
+	/* stat, to get file size. */
+#ifdef _WIN32
+	struct _stat64	st;
+#else
+	struct stat	st;
+#endif /* _WIN32 */
+
+	/* size of file (has to be 64 bits) */
+	unsigned long long int	size		= 0;
+	/* number of pages in file */
+	ulint		pages;
+
+	off_t		offset			= 0;
+	/* count the no. of page corrupted. */
+	ulint		mismatch_count		= 0;
+	/* Variable to ack the page is corrupted or not. */
+	bool		is_corrupted		= false;
+
+	bool		partial_page_read	= false;
+	/* Enabled when read from stdin is done. */
+	bool		read_from_stdin		= false;
+	FILE*		fil_page_type		= NULL;
+	fpos_t		pos;
+
+	/* Use to check the space id of given file. If space_id is zero,
+	then check whether page is doublewrite buffer.*/
+	ulint		space_id = 0UL;
+	/* enable when space_id of given file is zero. */
+	bool		is_system_tablespace = false;
+
+	ut_crc32_init();
+	MY_INIT(argv[0]);
+	DBUG_ENTER("main");
+	DBUG_PROCESS(argv[0]);
+
+	if (get_options(&argc,&argv)) {
+		DBUG_RETURN(1);
+	}
 
-void
-parse_page(
-/*=======*/
-  uchar* page, /* in: buffer page */
-  uchar* xdes) /* in: extend descriptor page */
-{
-       ib_uint64_t id;
-       ulint x;
-       ulint n_recs;
-       ulint page_no;
-       ulint left_page_no;
-       ulint right_page_no;
-       ulint data_bytes;
-       int is_leaf;
-       int size_range_id;
-
-       switch (fil_page_get_type(page)) {
-       case FIL_PAGE_INDEX:
-               n_fil_page_index++;
-               id = btr_page_get_index_id(page);
-               n_recs = page_get_n_recs(page);
-               page_no = page_get_page_no(page);
-               left_page_no = btr_page_get_prev(page);
-               right_page_no = btr_page_get_next(page);
-               data_bytes = page_get_data_size(page);
-               is_leaf = page_is_leaf(page);
-               size_range_id = (data_bytes * SIZE_RANGES_FOR_PAGE
-                                + logical_page_size - 1) /
-                                logical_page_size;
-               if (size_range_id > SIZE_RANGES_FOR_PAGE + 1) {
-                 /* data_bytes is bigger than logical_page_size */
-                 size_range_id = SIZE_RANGES_FOR_PAGE + 1;
-               }
-               if (per_page_details) {
-                 printf("index %lu page %lu leaf %u n_recs %lu data_bytes %lu"
-                        "\n", (ulong) id, (ulong) page_no, is_leaf, n_recs, data_bytes);
-               }
-               /* update per-index statistics */
-               {
-                 if (index_ids.count(id) == 0) {
-                   index_ids[id] = per_index_stats();
-                 }
-		 std::map<unsigned long long, per_index_stats>::iterator it;
-		 it = index_ids.find(id);
-                 per_index_stats &index = (it->second);
-                 uchar* des = xdes + XDES_ARR_OFFSET
-                   + XDES_SIZE * ((page_no & (physical_page_size - 1))
-                                  / FSP_EXTENT_SIZE);
-                 if (xdes_get_bit(des, XDES_FREE_BIT,
-                                  page_no % FSP_EXTENT_SIZE)) {
-                   index.free_pages++;
-                   return;
-                 }
-                 index.pages++;
-                 if (is_leaf) {
-                   index.leaf_pages++;
-                   if (data_bytes > index.max_data_size) {
-                     index.max_data_size = data_bytes;
-                   }
-		   struct per_page_stats pp(n_recs, data_bytes,
-			   left_page_no, right_page_no);
-
-                   index.leaves[page_no] = pp;
-
-                   if (left_page_no == ULINT32_UNDEFINED) {
-                     index.first_leaf_page = page_no;
-                     index.count++;
-                   }
-                 }
-                 index.total_n_recs += n_recs;
-                 index.total_data_bytes += data_bytes;
-                 index.pages_in_size_range[size_range_id] ++;
-               }
-
-               break;
-       case FIL_PAGE_UNDO_LOG:
-               if (per_page_details) {
-                       printf("FIL_PAGE_UNDO_LOG\n");
-               }
-               n_fil_page_undo_log++;
-               x = mach_read_from_2(page + TRX_UNDO_PAGE_HDR +
-                                    TRX_UNDO_PAGE_TYPE);
-               if (x == TRX_UNDO_INSERT)
-                       n_undo_insert++;
-               else if (x == TRX_UNDO_UPDATE)
-                       n_undo_update++;
-               else
-                       n_undo_other++;
-
-               x = mach_read_from_2(page + TRX_UNDO_SEG_HDR + TRX_UNDO_STATE);
-               switch (x) {
-                       case TRX_UNDO_ACTIVE: n_undo_state_active++; break;
-                       case TRX_UNDO_CACHED: n_undo_state_cached++; break;
-                       case TRX_UNDO_TO_FREE: n_undo_state_to_free++; break;
-                       case TRX_UNDO_TO_PURGE: n_undo_state_to_purge++; break;
-                       case TRX_UNDO_PREPARED: n_undo_state_prepared++; break;
-                       default: n_undo_state_other++; break;
-               }
-               break;
-       case FIL_PAGE_INODE:
-               if (per_page_details) {
-                       printf("FIL_PAGE_INODE\n");
-               }
-               n_fil_page_inode++;
-               break;
-       case FIL_PAGE_IBUF_FREE_LIST:
-               if (per_page_details) {
-                       printf("FIL_PAGE_IBUF_FREE_LIST\n");
-               }
-               n_fil_page_ibuf_free_list++;
-               break;
-       case FIL_PAGE_TYPE_ALLOCATED:
-               if (per_page_details) {
-                       printf("FIL_PAGE_TYPE_ALLOCATED\n");
-               }
-               n_fil_page_type_allocated++;
-               break;
-       case FIL_PAGE_IBUF_BITMAP:
-               if (per_page_details) {
-                       printf("FIL_PAGE_IBUF_BITMAP\n");
-               }
-               n_fil_page_ibuf_bitmap++;
-               break;
-       case FIL_PAGE_TYPE_SYS:
-               if (per_page_details) {
-                       printf("FIL_PAGE_TYPE_SYS\n");
-               }
-               n_fil_page_type_sys++;
-               break;
-       case FIL_PAGE_TYPE_TRX_SYS:
-               if (per_page_details) {
-                       printf("FIL_PAGE_TYPE_TRX_SYS\n");
-               }
-               n_fil_page_type_trx_sys++;
-               break;
-       case FIL_PAGE_TYPE_FSP_HDR:
-               if (per_page_details) {
-                       printf("FIL_PAGE_TYPE_FSP_HDR\n");
-               }
-               memcpy(xdes, page, physical_page_size);
-               n_fil_page_type_fsp_hdr++;
-               break;
-       case FIL_PAGE_TYPE_XDES:
-               if (per_page_details) {
-                       printf("FIL_PAGE_TYPE_XDES\n");
-               }
-               memcpy(xdes, page, physical_page_size);
-               n_fil_page_type_xdes++;
-               break;
-       case FIL_PAGE_TYPE_BLOB:
-               if (per_page_details) {
-                       printf("FIL_PAGE_TYPE_BLOB\n");
-               }
-               n_fil_page_type_blob++;
-               break;
-       case FIL_PAGE_TYPE_ZBLOB:
-       case FIL_PAGE_TYPE_ZBLOB2:
-               if (per_page_details) {
-                       printf("FIL_PAGE_TYPE_ZBLOB/2\n");
-               }
-               n_fil_page_type_zblob++;
-               break;
-       case FIL_PAGE_PAGE_COMPRESSED:
-	       if (per_page_details) {
-		       printf("FIL_PAGE_PAGE_COMPRESSED\n");
-	       }
-	       n_fil_page_type_page_compressed++;
-	       break;
-       case FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED:
-	       if (per_page_details) {
-		       printf("FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED\n");
-	       }
-	       n_fil_page_type_page_compressed_encrypted++;
-	       break;
-       default:
-               if (per_page_details) {
-                       printf("FIL_PAGE_TYPE_OTHER\n");
-               }
-               n_fil_page_type_other++;
-       }
-}
+	if (strict_verify && no_check) {
+		fprintf(stderr, "Error: --strict-check option cannot be used "
+			"together with --no-check option.\n");
+		DBUG_RETURN(1);
+	}
 
-void print_index_leaf_stats(unsigned long long id, const per_index_stats& index)
-{
-  ulint page_no = index.first_leaf_page;
-  std::map<ulint, per_page_stats>::const_iterator it_page = index.leaves.find(page_no);
-  printf("\nindex: %llu leaf page stats: n_pages = %llu\n",
-         id, index.leaf_pages);
-  printf("page_no\tdata_size\tn_recs\n");
-  while (it_page != index.leaves.end()) {
-    const per_page_stats& stat = it_page->second;
-    printf("%lu\t%lu\t%lu\n", it_page->first, stat.data_size, stat.n_recs);
-    page_no = stat.right_page_no;
-    it_page = index.leaves.find(page_no);
-  }
-}
+	if (no_check && !do_write) {
+		fprintf(stderr, "Error: --no-check must be associated with "
+			"--write option.\n");
+		DBUG_RETURN(1);
+	}
 
-void defrag_analysis(unsigned long long id, const per_index_stats& index)
-{
-  // TODO: make it work for compressed pages too
-  std::map<ulint, per_page_stats>::const_iterator it = index.leaves.find(index.first_leaf_page);
-  ulint n_pages = 0;
-  ulint n_leaf_pages = 0;
-  while (it != index.leaves.end()) {
-    ulint data_size_total = 0;
-    for (ulong i = 0; i < n_merge; i++) {
-      const per_page_stats& stat = it->second;
-      n_leaf_pages ++;
-      data_size_total += stat.data_size;
-      it = index.leaves.find(stat.right_page_no);
-      if (it == index.leaves.end()) {
-        break;
-      }
-    }
-    if (index.max_data_size) {
-      n_pages += data_size_total / index.max_data_size;
-      if (data_size_total % index.max_data_size != 0) {
-        n_pages += 1;
-      }
-    }
-  }
-  if (index.leaf_pages)
-    printf("count = %lu free = %lu\n", index.count, index.free_pages);
-    printf("%llu\t\t%llu\t\t%lu\t\t%lu\t\t%lu\t\t%.2f\t%lu\n",
-           id, index.leaf_pages, n_leaf_pages, n_merge, n_pages,
-           1.0 - (double)n_pages / (double)n_leaf_pages, index.max_data_size);
-}
+	if (page_type_dump) {
+		fil_page_type = create_file(page_dump_filename);
+		if (!fil_page_type) {
+			DBUG_RETURN(1);
+		}
+	}
 
-void print_leaf_stats()
-{
-  printf("\n**************************************************\n");
-  printf("index_id\t#leaf_pages\t#actual_leaf_pages\tn_merge\t"
-         "#leaf_after_merge\tdefrag\n");
-  for (std::map<unsigned long long, per_index_stats>::const_iterator it = index_ids.begin(); it != index_ids.end(); it++) {
-    const per_index_stats& index = it->second;
-    if (verbose) {
-      print_index_leaf_stats(it->first, index);
-    }
-    if (n_merge) {
-      defrag_analysis(it->first, index);
-    }
-  }
-}
+	if (is_log_enabled) {
+		log_file = create_file(log_filename);
+		if (!log_file) {
+			DBUG_RETURN(1);
+		}
+		fprintf(log_file, "InnoDB File Checksum Utility.\n");
+	}
 
-void
-print_stats()
-/*========*/
-{
-       unsigned long long i;
-
-       printf("%d\tbad checksum\n", n_bad_checksum);
-       printf("%d\tFIL_PAGE_INDEX\n", n_fil_page_index);
-       printf("%d\tFIL_PAGE_UNDO_LOG\n", n_fil_page_undo_log);
-       printf("%d\tFIL_PAGE_INODE\n", n_fil_page_inode);
-       printf("%d\tFIL_PAGE_IBUF_FREE_LIST\n", n_fil_page_ibuf_free_list);
-       printf("%d\tFIL_PAGE_TYPE_ALLOCATED\n", n_fil_page_type_allocated);
-       printf("%d\tFIL_PAGE_IBUF_BITMAP\n", n_fil_page_ibuf_bitmap);
-       printf("%d\tFIL_PAGE_TYPE_SYS\n", n_fil_page_type_sys);
-       printf("%d\tFIL_PAGE_TYPE_TRX_SYS\n", n_fil_page_type_trx_sys);
-       printf("%d\tFIL_PAGE_TYPE_FSP_HDR\n", n_fil_page_type_fsp_hdr);
-       printf("%d\tFIL_PAGE_TYPE_XDES\n", n_fil_page_type_xdes);
-       printf("%d\tFIL_PAGE_TYPE_BLOB\n", n_fil_page_type_blob);
-       printf("%d\tFIL_PAGE_TYPE_ZBLOB\n", n_fil_page_type_zblob);
-       printf("%d\tFIL_PAGE_PAGE_COMPRESSED\n", n_fil_page_type_page_compressed);
-       printf("%d\tFIL_PAGE_PAGE_COMPRESSED_ENCRYPTED\n", n_fil_page_type_page_compressed_encrypted);
-       printf("%d\tother\n", n_fil_page_type_other);
-       printf("%d\tmax index_id\n", n_fil_page_max_index_id);
-       printf("undo type: %d insert, %d update, %d other\n",
-               n_undo_insert, n_undo_update, n_undo_other);
-       printf("undo state: %d active, %d cached, %d to_free, %d to_purge,"
-               " %d prepared, %d other\n", n_undo_state_active,
-               n_undo_state_cached, n_undo_state_to_free,
-               n_undo_state_to_purge, n_undo_state_prepared,
-               n_undo_state_other);
-
-       printf("index_id\t#pages\t\t#leaf_pages\t#recs_per_page"
-               "\t#bytes_per_page\n");
-       for (std::map<unsigned long long, per_index_stats>::const_iterator it = index_ids.begin(); it != index_ids.end(); it++) {
-         const per_index_stats& index = it->second;
-         printf("%lld\t\t%lld\t\t%lld\t\t%lld\t\t%lld\n",
-                it->first, index.pages, index.leaf_pages,
-                index.total_n_recs / index.pages,
-                index.total_data_bytes / index.pages);
-       }
-       printf("\n");
-       printf("index_id\tpage_data_bytes_histgram(empty,...,oversized)\n");
-       for (std::map<unsigned long long, per_index_stats>::const_iterator it = index_ids.begin(); it != index_ids.end(); it++) {
-         printf("%lld\t", it->first);
-         const per_index_stats& index = it->second;
-         for (i = 0; i < SIZE_RANGES_FOR_PAGE+2; i++) {
-           printf("\t%lld", index.pages_in_size_range[i]);
-         }
-         printf("\n");
-       }
-       if (do_leaf) {
-         print_leaf_stats();
-       }
-}
+	if (verbose) {
+		/* JAN: TODO: MySQL 5.7
+		my_print_variables_ex(innochecksum_options, stderr);
+		*/
+		my_print_variables(innochecksum_options);
+	}
 
-int main(int argc, char **argv)
-{
-  FILE* f;                       /* our input file */
-  char* filename;                /* our input filename. */
-  unsigned char *big_buf= 0, *buf;
-  unsigned char *big_xdes= 0, *xdes;
-  ulong bytes;                   /* bytes read count */
-  ulint ct;                      /* current page number (0 based) */
-  time_t now;                    /* current time */
-  time_t lastt;                  /* last time */
-  ulint oldcsum, oldcsumfield, csum, csumfield, crc32, logseq, logseqfield;
-                                 /* ulints for checksum storage */
-  struct stat st;                /* for stat, if you couldn't guess */
-  unsigned long long int size;   /* size of file (has to be 64 bits) */
-  ulint pages;                   /* number of pages in file */
-  off_t offset= 0;
-  int fd;
-
-  printf("InnoDB offline file checksum utility.\n");
-
-  ut_crc32_init();
-
-  MY_INIT(argv[0]);
-
-  if (get_options(&argc,&argv))
-    exit(1);
-
-  if (verbose)
-    my_print_variables(innochecksum_options);
-
-  /* The file name is not optional */
-  filename = *argv;
-  if (*filename == '\0')
-  {
-    fprintf(stderr, "Error; File name missing\n");
-    goto error_out;
-  }
-
-  /* stat the file to get size and page count */
-  if (stat(filename, &st))
-  {
-    fprintf(stderr, "Error; %s cannot be found\n", filename);
-    goto error_out;
-  }
-  size= st.st_size;
-
-  /* Open the file for reading */
-  f= fopen(filename, "rb");
-  if (f == NULL)
-  {
-    fprintf(stderr, "Error; %s cannot be opened", filename);
-    perror(" ");
-    goto error_out;
-  }
-
-  big_buf = (unsigned char *)malloc(2 * UNIV_PAGE_SIZE_MAX);
-  if (big_buf == NULL)
-  {
-    fprintf(stderr, "Error; failed to allocate memory\n");
-    perror("");
-    goto error_f;
-  }
-
-  /* Make sure the page is aligned */
-  buf = (unsigned char*)ut_align_down(big_buf
-                                      + UNIV_PAGE_SIZE_MAX, UNIV_PAGE_SIZE_MAX);
-
-  big_xdes = (unsigned char *)malloc(2 * UNIV_PAGE_SIZE_MAX);
-  if (big_xdes == NULL)
-  {
-    fprintf(stderr, "Error; failed to allocate memory\n");
-    perror("");
-    goto error_big_buf;
-  }
-
-  /* Make sure the page is aligned */
-  xdes = (unsigned char*)ut_align_down(big_xdes
-                                      + UNIV_PAGE_SIZE_MAX, UNIV_PAGE_SIZE_MAX);
-
-
-  if (!get_page_size(f, buf, &logical_page_size, &physical_page_size))
-    goto error;
-
-  if (compressed)
-  {
-    printf("Table is compressed\n");
-    printf("Key block size is %lu\n", physical_page_size);
-  }
-  else
-  {
-    printf("Table is uncompressed\n");
-    printf("Page size is %lu\n", physical_page_size);
-  }
-
-  pages= (ulint) (size / physical_page_size);
-
-  if (just_count)
-  {
-    if (verbose)
-      printf("Number of pages: ");
-    printf("%lu\n", pages);
-    goto ok;
-  }
-  else if (verbose)
-  {
-    printf("file %s = %llu bytes (%lu pages)...\n", filename, size, pages);
-    if (do_one_page)
-      printf("InnoChecksum; checking page %lu\n", do_page);
-    else
-      printf("InnoChecksum; checking pages in range %lu to %lu\n", start_page, use_end_page ? end_page : (pages - 1));
-  }
-
-#ifdef UNIV_LINUX
-  if (posix_fadvise(fileno(f), 0, 0, POSIX_FADV_SEQUENTIAL) ||
-      posix_fadvise(fileno(f), 0, 0, POSIX_FADV_NOREUSE))
-  {
-    perror("posix_fadvise failed");
-  }
-#endif
 
-  /* seek to the necessary position */
-  if (start_page)
-  {
-    fd= fileno(f);
-    if (!fd)
-    {
-      perror("Error; Unable to obtain file descriptor number");
-      goto error;
-    }
-
-    offset= (off_t)start_page * (off_t)physical_page_size;
-
-    if (lseek(fd, offset, SEEK_SET) != offset)
-    {
-      perror("Error; Unable to seek to necessary offset");
-      goto error;
-    }
-  }
-
-  /* main checksumming loop */
-  ct= start_page;
-  lastt= 0;
-  while (!feof(f))
-  {
-    int page_ok = 1;
-
-    bytes= fread(buf, 1, physical_page_size, f);
-
-    if (!bytes && feof(f))
-      goto ok;
-
-    if (ferror(f))
-    {
-      fprintf(stderr, "Error reading %lu bytes", physical_page_size);
-      perror(" ");
-      goto error;
-    }
-
-    ulint page_type = mach_read_from_2(buf+FIL_PAGE_TYPE);
-    ulint key_version = mach_read_from_4(buf + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
-
-    if (key_version && page_type != FIL_PAGE_PAGE_COMPRESSED) {
-	    encrypted = true;
-    } else {
-	    encrypted = false;
-    }
-
-    ulint comp_method = 0;
-
-    if (encrypted) {
-	    comp_method = mach_read_from_2(buf+FIL_PAGE_DATA+FIL_PAGE_COMPRESSED_SIZE);
-    } else {
-	    comp_method = mach_read_from_8(buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
-    }
-
-    ulint comp_size = mach_read_from_2(buf+FIL_PAGE_DATA);
-    ib_uint32_t encryption_checksum = mach_read_from_4(buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + 4);
-
-
-    if (page_type == FIL_PAGE_PAGE_COMPRESSED) {
-      /* Page compressed tables do not have any checksum */
-      if (debug)
-	fprintf(stderr, "Page %lu page compressed with method %s real_size %lu\n", ct,
-	        fil_get_compression_alg_name(comp_method), comp_size);
-      page_ok = 1;
-    } else if (compressed) {
-        /* compressed pages */
-	ulint crccsum = page_zip_calc_checksum(buf, physical_page_size, SRV_CHECKSUM_ALGORITHM_CRC32);
-	ulint icsum = page_zip_calc_checksum(buf, physical_page_size,  SRV_CHECKSUM_ALGORITHM_INNODB);
-
-        if (debug) {
-	  if (key_version != 0) {
-	    fprintf(stderr,
-		    "Page %lu encrypted key_version %lu calculated = %lu; crc32 = %lu; recorded = %u\n",
-		    ct, key_version, icsum, crccsum, encryption_checksum);
-	  }
-        }
+	buf = (byte*) malloc(UNIV_PAGE_SIZE_MAX * 2);
+	tbuf = buf + UNIV_PAGE_SIZE_MAX;
+
+	/* The file name is not optional. */
+	for (int i = 0; i < argc; ++i) {
+		/* Reset parameters for each file. */
+		filename = argv[i];
+		memset(&page_type, 0, sizeof(innodb_page_type));
+		is_corrupted = false;
+		partial_page_read = false;
+		skip_page = false;
+
+		if (is_log_enabled) {
+			fprintf(log_file, "Filename = %s\n", filename);
+		}
+
+		if (*filename == '-') {
+			/* read from stdin. */
+			fil_in = stdin;
+			read_from_stdin = true;
+
+		}
+
+		/* stat the file to get size and page count. */
+		if (!read_from_stdin &&
+#ifdef _WIN32
+			_stat64(filename, &st)) {
+#else
+			stat(filename, &st)) {
+#endif /* _WIN32 */
+			fprintf(stderr, "Error: %s cannot be found\n",
+				filename);
+
+			DBUG_RETURN(1);
+		}
+
+		if (!read_from_stdin) {
+			size = st.st_size;
+			fil_in = open_file(filename);
+			/*If fil_in is NULL, terminate as some error encountered */
+			if(fil_in == NULL) {
+				DBUG_RETURN(1);
+			}
+			/* Save the current file pointer in pos variable.*/
+			if (0 != fgetpos(fil_in, &pos)) {
+				perror("fgetpos");
+				DBUG_RETURN(1);
+			}
+		}
+
+		/* Testing for lock mechanism. The innochecksum
+		acquire lock on given file. So other tools accessing the same
+		file for processsing must fail. */
+#ifdef _WIN32
+		DBUG_EXECUTE_IF("innochecksum_cause_mysqld_crash",
+			ut_ad(page_dump_filename);
+			while((_access( page_dump_filename, 0)) == 0) {
+				sleep(1);
+			}
+			DBUG_RETURN(0); );
+#else
+		DBUG_EXECUTE_IF("innochecksum_cause_mysqld_crash",
+			ut_ad(page_dump_filename);
+			struct stat status_buf;
+			while(stat(page_dump_filename, &status_buf) == 0) {
+				sleep(1);
+			}
+			DBUG_RETURN(0); );
+#endif /* _WIN32 */
+
+		/* Read the minimum page size. */
+		bytes = ulong(fread(buf, 1, UNIV_ZIP_SIZE_MIN, fil_in));
+		partial_page_read = true;
+
+		if (bytes != UNIV_ZIP_SIZE_MIN) {
+			fprintf(stderr, "Error: Was not able to read the "
+				"minimum page size ");
+			fprintf(stderr, "of %d bytes.  Bytes read was %lu\n",
+				UNIV_ZIP_SIZE_MIN, bytes);
+
+			free(buf);
+			DBUG_RETURN(1);
+		}
+
+		/* enable variable is_system_tablespace when space_id of given
+		file is zero. Use to skip the checksum verification and rewrite
+		for doublewrite pages. */
+		is_system_tablespace = (!memcmp(&space_id, buf +
+					FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, 4))
+					? true : false;
+
+		const page_size_t&	page_size = get_page_size(buf);
+
+		pages = (ulint) (size / page_size.physical());
+
+		if (just_count) {
+			if (read_from_stdin) {
+				fprintf(stderr, "Number of pages:%lu\n", pages);
+			} else {
+				printf("Number of pages:%lu\n", pages);
+			}
+			continue;
+		} else if (verbose && !read_from_stdin) {
+			if (is_log_enabled) {
+				fprintf(log_file, "file %s = %llu bytes "
+					"(%lu pages)\n", filename, size, pages);
+				if (do_one_page) {
+					fprintf(log_file, "Innochecksum: "
+						"checking page %lu \n",
+						do_page);
+				}
+			}
+		} else {
+			if (is_log_enabled) {
+				fprintf(log_file, "Innochecksum: checking "
+					"pages in range %lu to %lu\n",
+					start_page, use_end_page ?
+					end_page : (pages - 1));
+			}
+		}
+
+		/* seek to the necessary position */
+		if (start_page) {
+			if (!read_from_stdin) {
+				/* If read is not from stdin, we can use
+				fseeko() to position the file pointer to
+				the desired page. */
+				partial_page_read = false;
+
+				offset = (off_t) start_page
+					* (off_t) page_size.physical();
+#ifdef _WIN32
+				if (_fseeki64(fil_in, offset, SEEK_SET)) {
+#else
+				if (fseeko(fil_in, offset, SEEK_SET)) {
+#endif /* _WIN32 */
+					perror("Error: Unable to seek to "
+						"necessary offset");
+
+					free(buf);
+					DBUG_RETURN(1);
+				}
+				/* Save the current file pointer in
+				pos variable. */
+				if (0 != fgetpos(fil_in, &pos)) {
+					perror("fgetpos");
+
+					free(buf);
+					DBUG_RETURN(1);
+				}
+			} else {
+
+				ulong count = 0;
+
+				while (!feof(fil_in)) {
+					if (start_page == count) {
+						break;
+					}
+					/* We read a part of page to find the
+					minimum page size. We cannot reset
+					the file pointer to the beginning of
+					the page if we are reading from stdin
+					(fseeko() on stdin doesn't work). So
+					read only the remaining part of page,
+					if partial_page_read is enable. */
+					bytes = read_file(buf,
+							  partial_page_read,
+							  static_cast<ulong>(
+							  page_size.physical()),
+							  fil_in);
+
+					partial_page_read = false;
+					count++;
+
+					if (!bytes || feof(fil_in)) {
+						fprintf(stderr, "Error: Unable "
+							"to seek to necessary "
+							"offset");
+
+						free(buf);
+						DBUG_RETURN(1);
+					}
+				}
+			}
+		}
+
+		if (page_type_dump) {
+			fprintf(fil_page_type,
+				"\n\nFilename::%s\n", filename);
+			fprintf(fil_page_type,
+				"========================================"
+				"======================================\n");
+			fprintf(fil_page_type,
+				"\tPAGE_NO\t\t|\t\tPAGE_TYPE\t\t"
+				"\t|\tEXTRA INFO\n");
+			fprintf(fil_page_type,
+				"========================================"
+				"======================================\n");
+		}
+
+		/* main checksumming loop */
+		cur_page_num = start_page;
+		lastt = 0;
+		while (!feof(fil_in)) {
+
+			bytes = read_file(buf, partial_page_read,
+					  static_cast<ulong>(
+					  page_size.physical()), fil_in);
+			partial_page_read = false;
+
+			if (!bytes && feof(fil_in)) {
+				break;
+			}
+
+			if (ferror(fil_in)) {
+				fprintf(stderr, "Error reading %lu bytes",
+					page_size.physical());
+				perror(" ");
+
+				free(buf);
+				DBUG_RETURN(1);
+			}
+
+			if (bytes != page_size.physical()) {
+				fprintf(stderr, "Error: bytes read (%lu) "
+					"doesn't match page size (%lu)\n",
+					bytes, page_size.physical());
+				free(buf);
+				DBUG_RETURN(1);
+			}
+
+			if (is_system_tablespace) {
+				/* enable when page is double write buffer.*/
+				skip_page = is_page_doublewritebuffer(buf);
+			} else {
+				skip_page = false;
+
+				if (!page_decompress(buf, tbuf, page_size)) {
+
+					fprintf(stderr,
+						"Page decompress failed");
+
+					free(buf);
+					DBUG_RETURN(1);
+				}
+			}
+
+			/* If no-check is enabled, skip the
+			checksum verification.*/
+			if (!no_check) {
+				/* Checksum verification */
+				if (!skip_page) {
+					is_corrupted = is_page_corrupted(
+						buf, page_size);
+
+					if (is_corrupted) {
+						fprintf(stderr, "Fail: page "
+							"%lu invalid\n",
+							cur_page_num);
+
+						mismatch_count++;
+
+						if(mismatch_count > allow_mismatches) {
+							fprintf(stderr,
+								"Exceeded the "
+								"maximum allowed "
+								"checksum mismatch "
+								"count::%lu\n",
+								allow_mismatches);
+
+							free(buf);
+							DBUG_RETURN(1);
+						}
+					}
+				}
+			}
+
+			/* Rewrite checksum */
+			if (do_write
+			    && !write_file(filename, fil_in, buf,
+					   page_size.is_compressed(), &pos,
+					   static_cast<ulong>(page_size.physical()))) {
+
+				free(buf);
+				DBUG_RETURN(1);
+			}
+
+			/* end if this was the last page we were supposed to check */
+			if (use_end_page && (cur_page_num >= end_page)) {
+				break;
+			}
+
+			if (page_type_summary || page_type_dump) {
+				parse_page(buf, fil_page_type);
+			}
+
+			/* do counter increase and progress printing */
+			cur_page_num++;
+			if (verbose && !read_from_stdin) {
+				if ((cur_page_num % 64) == 0) {
+					now = time(0);
+					if (!lastt) {
+						lastt= now;
+					}
+					if (now - lastt >= 1
+					    && is_log_enabled) {
+						fprintf(log_file, "page %lu "
+							"okay: %.3f%% done\n",
+							(cur_page_num - 1),
+							(float) cur_page_num / pages * 100);
+						lastt = now;
+					}
+				}
+			}
+		}
+
+		if (!read_from_stdin) {
+			/* flcose() will flush the data and release the lock if
+			any acquired. */
+			fclose(fil_in);
+		}
+
+		/* Enabled for page type summary. */
+		if (page_type_summary) {
+			if (!read_from_stdin) {
+				fprintf(stdout, "\nFile::%s",filename);
+				print_summary(stdout);
+			} else {
+				print_summary(stderr);
+			}
+		}
+	}
 
-	if (encrypted) {
-	  if (encryption_checksum != 0 && crccsum != encryption_checksum && icsum != encryption_checksum) {
-	    if (debug)
-	      fprintf(stderr, "page %lu: compressed: calculated = %lu; crc32 = %lu; recorded = %u\n",
-		      ct, icsum, crccsum, encryption_checksum);
-	    fprintf(stderr, "Fail; page %lu invalid (fails compressed page checksum).\n", ct);
-	  }
-	} else {
-          if (!page_zip_verify_checksum(buf, physical_page_size)) {
-            fprintf(stderr, "Fail; page %lu invalid (fails compressed page checksum).\n", ct);
-            if (!skip_corrupt)
-              goto error;
-            page_ok = 0;
-          }
+	if (is_log_enabled) {
+		fclose(log_file);
 	}
-    } else {
-      if (key_version != 0) {
-      /* Encrypted page */
-        if (debug) {
-	  if (page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) {
-	    fprintf(stderr,
-		    "Page %lu page compressed with method %s real_size %lu and encrypted key_version %lu checksum %u\n",
-		    ct, fil_get_compression_alg_name(comp_method), comp_size, key_version, encryption_checksum);
-	  } else {
-	    fprintf(stderr,
-		    "Page %lu encrypted key_version %lu checksum %u\n",
-		    ct, key_version, encryption_checksum);
-	  }
-        }
-      }
-
-      /* Page compressed tables do not contain FIL tailer */
-      if (page_type != FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED && page_type != FIL_PAGE_PAGE_COMPRESSED) {
-        /* check the "stored log sequence numbers" */
-         logseq= mach_read_from_4(buf + FIL_PAGE_LSN + 4);
-        logseqfield= mach_read_from_4(buf + logical_page_size - FIL_PAGE_END_LSN_OLD_CHKSUM + 4);
-        if (debug)
-          printf("page %lu: log sequence number: first = %lu; second = %lu\n", ct, logseq, logseqfield);
-        if (logseq != logseqfield)
-        {
-          fprintf(stderr, "Fail; page %lu invalid (fails log sequence number check)\n", ct);
-          if (!skip_corrupt)
-            goto error;
-          page_ok = 0;
-        }
 
-        /* check old method of checksumming */
-        oldcsum= buf_calc_page_old_checksum(buf);
-        oldcsumfield= mach_read_from_4(buf + logical_page_size - FIL_PAGE_END_LSN_OLD_CHKSUM);
-        if (debug)
-          printf("page %lu: old style: calculated = %lu; recorded = %lu\n", ct, oldcsum, oldcsumfield);
-        if (oldcsumfield != mach_read_from_4(buf + FIL_PAGE_LSN) && oldcsumfield != oldcsum)
-        {
-          fprintf(stderr, "Fail;  page %lu invalid (fails old style checksum)\n", ct);
-          if (!skip_corrupt)
-            goto error;
-          page_ok = 0;
-        }
-      }
-
-      /* now check the new method */
-      csum= buf_calc_page_new_checksum(buf);
-      crc32= buf_calc_page_crc32(buf);
-      csumfield= mach_read_from_4(buf + FIL_PAGE_SPACE_OR_CHKSUM);
-
-      if (key_version)
-	      csumfield = encryption_checksum;
-
-      if (debug)
-        printf("page %lu: new style: calculated = %lu; crc32 = %lu; recorded = %lu\n",
-               ct, csum, crc32, csumfield);
-      if (csumfield != 0 && crc32 != csumfield && csum != csumfield)
-      {
-        fprintf(stderr, "Fail; page %lu invalid (fails innodb and crc32 checksum)\n", ct);
-        if (!skip_corrupt)
-          goto error;
-        page_ok = 0;
-      }
-    }
-    /* end if this was the last page we were supposed to check */
-    if (use_end_page && (ct >= end_page))
-      goto ok;
-
-    if (per_page_details)
-    {
-      printf("page %ld ", ct);
-    }
-
-    /* do counter increase and progress printing */
-    ct++;
-
-    if (!page_ok)
-    {
-      if (per_page_details)
-      {
-        printf("BAD_CHECKSUM\n");
-      }
-      n_bad_checksum++;
-      continue;
-    }
-
-    /* Can't parse compressed or/and encrypted pages */
-    if (page_type != FIL_PAGE_PAGE_COMPRESSED && !encrypted) {
-      parse_page(buf, xdes);
-    }
-
-    if (verbose)
-    {
-      if (ct % 64 == 0)
-      {
-        now= time(0);
-        if (!lastt) lastt= now;
-        if (now - lastt >= 1)
-        {
-          printf("page %lu okay: %.3f%% done\n", (ct - 1), (float) ct / pages * 100);
-          lastt= now;
-        }
-      }
-    }
-  }
-
-ok:
-  if (!just_count)
-    print_stats();
-  free(big_xdes);
-  free(big_buf);
-  fclose(f);
-  my_end(0);
-  exit(0);
-
-error:
-  free(big_xdes);
-error_big_buf:
-  free(big_buf);
-error_f:
-  fclose(f);
-error_out:
-  my_end(0);
-  exit(1);
+	free(buf);
+	DBUG_RETURN(0);
 }
diff --git a/include/dur_prop.h b/include/dur_prop.h
new file mode 100644
index 0000000..558ce5a
--- /dev/null
+++ b/include/dur_prop.h
@@ -0,0 +1,32 @@
+/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+
+   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 St, Fifth Floor, Boston, MA 02110-1301  USA */
+
+#ifndef _my_dur_prop_h
+#define _my_dur_prop_h
+
+enum durability_properties
+{
+  /*
+    Preserves the durability properties defined by the engine
+  */
+  HA_REGULAR_DURABILITY= 0,
+  /*
+     Ignore the durability properties defined by the engine and
+     write only in-memory entries.
+  */
+  HA_IGNORE_DURABILITY= 1
+};
+
+#endif /* _my_dur_prop_h */
diff --git a/include/my_icp.h b/include/my_icp.h
new file mode 100644
index 0000000..8b77b7c
--- /dev/null
+++ b/include/my_icp.h
@@ -0,0 +1,48 @@
+/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+
+   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 */
+
+#ifndef _my_icp_h
+#define _my_icp_h
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/**
+  Values returned by index_cond_func_xxx functions.
+*/
+
+typedef enum icp_result {
+  /** Index tuple doesn't satisfy the pushed index condition (the engine
+  should discard the tuple and go to the next one) */
+  ICP_NO_MATCH,
+
+  /** Index tuple satisfies the pushed index condition (the engine should
+  fetch and return the record) */
+  ICP_MATCH,
+
+  /** Index tuple is out of the range that we're scanning, e.g. if we're
+  scanning "t.key BETWEEN 10 AND 20" and got a "t.key=21" tuple (the engine
+  should stop scanning and return HA_ERR_END_OF_FILE right away). */
+  ICP_OUT_OF_RANGE
+
+} ICP_RESULT;
+
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif /* _my_icp_h */
diff --git a/include/mysql/psi/psi_base.h b/include/mysql/psi/psi_base.h
new file mode 100644
index 0000000..10593c4
--- /dev/null
+++ b/include/mysql/psi/psi_base.h
@@ -0,0 +1,147 @@
+/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+
+  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,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#ifndef MYSQL_PSI_BASE_H
+#define MYSQL_PSI_BASE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+  @file mysql/psi/psi_base.h
+  Performance schema instrumentation interface.
+
+  @defgroup Instrumentation_interface Instrumentation Interface
+  @ingroup Performance_schema
+  @{
+*/
+
+#define PSI_INSTRUMENT_ME 0
+
+#define PSI_NOT_INSTRUMENTED 0
+
+/**
+  Global flag.
+  This flag indicate that an instrumentation point is a global variable,
+  or a singleton.
+*/
+#define PSI_FLAG_GLOBAL (1 << 0)
+
+/**
+  Mutable flag.
+  This flag indicate that an instrumentation point is a general placeholder,
+  that can mutate into a more specific instrumentation point.
+*/
+#define PSI_FLAG_MUTABLE (1 << 1)
+
+#define PSI_FLAG_THREAD (1 << 2)
+
+/**
+  Stage progress flag.
+  This flag apply to the stage instruments only.
+  It indicates the instrumentation provides progress data.
+*/
+#define PSI_FLAG_STAGE_PROGRESS (1 << 3)
+
+/**
+  Shared Exclusive flag.
+  Indicates that rwlock support the shared exclusive state.
+*/
+#define PSI_RWLOCK_FLAG_SX (1 << 4)
+
+/**
+  Transferable flag.
+  This flag indicate that an instrumented object can
+  be created by a thread and destroyed by another thread.
+*/
+#define PSI_FLAG_TRANSFER (1 << 5)
+
+#ifdef HAVE_PSI_INTERFACE
+
+/**
+  @def PSI_VERSION_1
+  Performance Schema Interface number for version 1.
+  This version is supported.
+*/
+#define PSI_VERSION_1 1
+
+/**
+  @def PSI_VERSION_2
+  Performance Schema Interface number for version 2.
+  This version is not implemented, it's a placeholder.
+*/
+#define PSI_VERSION_2 2
+
+/**
+  @def PSI_CURRENT_VERSION
+  Performance Schema Interface number for the most recent version.
+  The most current version is @c PSI_VERSION_1
+*/
+#define PSI_CURRENT_VERSION 1
+
+/**
+  @def USE_PSI_1
+  Define USE_PSI_1 to use the interface version 1.
+*/
+
+/**
+  @def USE_PSI_2
+  Define USE_PSI_2 to use the interface version 2.
+*/
+
+/**
+  @def HAVE_PSI_1
+  Define HAVE_PSI_1 if the interface version 1 needs to be compiled in.
+*/
+
+/**
+  @def HAVE_PSI_2
+  Define HAVE_PSI_2 if the interface version 2 needs to be compiled in.
+*/
+
+#ifndef USE_PSI_2
+#ifndef USE_PSI_1
+#define USE_PSI_1
+#endif
+#endif
+
+#ifdef USE_PSI_1
+#define HAVE_PSI_1
+#endif
+
+#ifdef USE_PSI_2
+#define HAVE_PSI_2
+#endif
+
+/*
+  Allow to override PSI_XXX_CALL at compile time
+  with more efficient implementations, if available.
+  If nothing better is available,
+  make a dynamic call using the PSI_server function pointer.
+*/
+
+#define PSI_DYNAMIC_CALL(M) PSI_server->M
+
+#endif /* HAVE_PSI_INTERFACE */
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MYSQL_PSI_BASE_H */
+
diff --git a/include/mysql/psi/psi_memory.h b/include/mysql/psi/psi_memory.h
new file mode 100644
index 0000000..725b3ed
--- /dev/null
+++ b/include/mysql/psi/psi_memory.h
@@ -0,0 +1,155 @@
+/* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+
+  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,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#ifndef MYSQL_PSI_MEMORY_H
+#define MYSQL_PSI_MEMORY_H
+
+#include "psi_base.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+  @file mysql/psi/psi_memory.h
+  Performance schema instrumentation interface.
+
+  @defgroup Instrumentation_interface Instrumentation Interface
+  @ingroup Performance_schema
+  @{
+*/
+
+#ifdef HAVE_PSI_INTERFACE
+#ifndef DISABLE_ALL_PSI
+#ifndef DISABLE_PSI_MEMORY
+#define HAVE_PSI_MEMORY_INTERFACE
+#endif /* DISABLE_PSI_MEMORY */
+#endif /* DISABLE_ALL_PSI */
+#endif /* HAVE_PSI_INTERFACE */
+
+struct PSI_thread;
+
+/**
+  Instrumented memory key.
+  To instrument memory, a memory key must be obtained using @c register_memory.
+  Using a zero key always disable the instrumentation.
+*/
+typedef unsigned int PSI_memory_key;
+
+#ifdef HAVE_PSI_1
+
+/**
+  @defgroup Group_PSI_v1 Application Binary Interface, version 1
+  @ingroup Instrumentation_interface
+  @{
+*/
+
+/**
+  Memory instrument information.
+  @since PSI_VERSION_1
+  This structure is used to register instrumented memory.
+*/
+struct PSI_memory_info_v1
+{
+  /** Pointer to the key assigned to the registered memory. */
+  PSI_memory_key *m_key;
+  /** The name of the memory instrument to register. */
+  const char *m_name;
+  /**
+    The flags of the socket instrument to register.
+    @sa PSI_FLAG_GLOBAL
+  */
+  int m_flags;
+};
+typedef struct PSI_memory_info_v1 PSI_memory_info_v1;
+
+/**
+  Memory registration API.
+  @param category a category name (typically a plugin name)
+  @param info an array of memory info to register
+  @param count the size of the info array
+*/
+typedef void (*register_memory_v1_t)
+  (const char *category, struct PSI_memory_info_v1 *info, int count);
+
+/**
+  Instrument memory allocation.
+  @param key the memory instrument key
+  @param size the size of memory allocated
+  @param[out] owner the memory owner
+  @return the effective memory instrument key
+*/
+typedef PSI_memory_key (*memory_alloc_v1_t)
+  (PSI_memory_key key, size_t size, struct PSI_thread ** owner);
+
+/**
+  Instrument memory re allocation.
+  @param key the memory instrument key
+  @param old_size the size of memory previously allocated
+  @param new_size the size of memory re allocated
+  @param[in, out] owner the memory owner
+  @return the effective memory instrument key
+*/
+typedef PSI_memory_key (*memory_realloc_v1_t)
+  (PSI_memory_key key, size_t old_size, size_t new_size, struct PSI_thread ** owner);
+
+/**
+  Instrument memory claim.
+  @param key the memory instrument key
+  @param size the size of memory allocated
+  @param[in, out] owner the memory owner
+  @return the effective memory instrument key
+*/
+typedef PSI_memory_key (*memory_claim_v1_t)
+  (PSI_memory_key key, size_t size, struct PSI_thread ** owner);
+
+/**
+  Instrument memory free.
+  @param key the memory instrument key
+  @param size the size of memory allocated
+  @param owner the memory owner
+*/
+typedef void (*memory_free_v1_t)
+  (PSI_memory_key key, size_t size, struct PSI_thread * owner);
+
+/** @} (end of group Group_PSI_v1) */
+
+#endif /* HAVE_PSI_1 */
+
+#ifdef HAVE_PSI_2
+struct PSI_memory_info_v2
+{
+  int placeholder;
+};
+
+#endif /* HAVE_PSI_2 */
+
+#ifdef USE_PSI_1
+typedef struct PSI_memory_info_v1 PSI_memory_info;
+#endif
+
+#ifdef USE_PSI_2
+typedef struct PSI_memory_info_v2 PSI_memory_info;
+#endif
+
+/** @} (end of group Instrumentation_interface) */
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* MYSQL_PSI_MEMORY_H */
+
diff --git a/mysql-test/disabled.def b/mysql-test/disabled.def
index e82ddcf..75704c7 100644
--- a/mysql-test/disabled.def
+++ b/mysql-test/disabled.def
@@ -22,3 +22,7 @@ innodb-wl5522-debug-zip  : broken upstream
 innodb_bug12902967       : broken upstream
 file_contents            : MDEV-6526 these files are not installed anymore
 max_statement_time       : cannot possibly work, depends on timing
+implicit_commit          : MDEV-10549
+lock_sync                : MDEV-10548
+innodb_mysql_sync        : MDEV-10548
+partition_debug_sync     : MDEV-10548
diff --git a/mysql-test/include/have_numa.inc b/mysql-test/include/have_numa.inc
new file mode 100644
index 0000000..bd1c7d7
--- /dev/null
+++ b/mysql-test/include/have_numa.inc
@@ -0,0 +1,18 @@
+let $numa_support = `SELECT COUNT(VARIABLE_VALUE) = 1 FROM
+  INFORMATION_SCHEMA.GLOBAL_VARIABLES
+  WHERE VARIABLE_NAME='innodb_numa_interleave'`;
+
+if ( $numa_support == 0 )
+{
+    --skip Test requires: NUMA must be enabled
+}
+
+if ( $numa_support == 1 )
+{
+  let $numa = `SELECT @@GLOBAL.innodb_numa_interleave = 'OFF'`;
+  if ( $numa == 1 )
+  {
+    --skip Test requires: NUMA must be enabled
+  }
+}
+
diff --git a/mysql-test/include/have_xtradb.combinations b/mysql-test/include/have_xtradb.combinations
index 0419dc9..3454f83 100644
--- a/mysql-test/include/have_xtradb.combinations
+++ b/mysql-test/include/have_xtradb.combinations
@@ -6,8 +6,8 @@ innodb-cmpmem
 innodb-trx
 innodb-sys-indexes
 
-[xtradb]
-innodb
-innodb-cmpmem
-innodb-trx
-innodb-sys-indexes
+#[xtradb]
+#innodb
+#innodb-cmpmem
+#innodb-trx
+#innodb-sys-indexes
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index 6b25c75..d47e7d3 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -32,6 +32,7 @@ BEGIN
      AND variable_name not like "Last_IO_Err*"
      AND variable_name != 'INNODB_IBUF_MAX_SIZE'
      AND variable_name != 'INNODB_USE_NATIVE_AIO'
+     AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP'
      AND variable_name not like 'GTID%POS'
      AND variable_name != 'GTID_BINLOG_STATE'
    ORDER BY variable_name;
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 0cddff8..afad786 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -4456,7 +4456,14 @@ sub extract_warning_lines ($$) {
      qr|nnoDB: fix the corruption by dumping, dropping, and reimporting|,
      qr|InnoDB: the corrupt table. You can use CHECK|,
      qr|InnoDB: TABLE to scan your table for corruption|,
-     qr/InnoDB: See also */
+     qr/InnoDB: See also */,
+     qr/InnoDB: Cannot open .*ib_buffer_pool.* for reading: No such file or directory*/,
+     qr/InnoDB: Upgrading redo log:*/,
+     qr|InnoDB: Starting to delete and rewrite log files.|,
+     qr/InnoDB: New log files created, LSN=*/,
+     qr|InnoDB: Creating foreign key constraint system tables.|,
+     qr/InnoDB: Table .*mysql.*innodb_table_stats.* not found./,
+     qr/InnoDB: User stopword table .* does not exist./
 
     );
 
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 3461038..d8e1741 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1860,8 +1860,8 @@ ALTER TABLE tm1 MODIFY COLUMN c INT NULL;
 affected rows: 2
 info: Records: 2  Duplicates: 0  Warnings: 0
 ALTER TABLE ti1 MODIFY COLUMN h VARCHAR(30);
-affected rows: 2
-info: Records: 2  Duplicates: 0  Warnings: 0
+affected rows: 0
+info: Records: 0  Duplicates: 0  Warnings: 0
 ALTER TABLE tm1 MODIFY COLUMN h VARCHAR(30);
 affected rows: 2
 info: Records: 2  Duplicates: 0  Warnings: 0
diff --git a/mysql-test/r/group_min_max_innodb.result b/mysql-test/r/group_min_max_innodb.result
index 77c74fb..9d8f8e7 100644
--- a/mysql-test/r/group_min_max_innodb.result
+++ b/mysql-test/r/group_min_max_innodb.result
@@ -194,7 +194,7 @@ EXPLAIN SELECT c1, i1, max(i2) FROM t2
 WHERE (c1 = 'C' OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 )
 GROUP BY c1,i1;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t2	range	k2	k2	5	NULL	59	Using where; Using index
+1	SIMPLE	t2	range	k2	k2	5	NULL	60	Using where; Using index
 SELECT c1, i1, max(i2) FROM t2
 WHERE (c1 = 'C' OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 )
 GROUP BY c1,i1;
@@ -205,7 +205,7 @@ EXPLAIN SELECT c1, i1, max(i2) FROM t2
 WHERE (((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 ))
 GROUP BY c1,i1;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t2	range	k2	k2	5	NULL	58	Using where; Using index
+1	SIMPLE	t2	range	k2	k2	5	NULL	60	Using where; Using index
 SELECT c1, i1, max(i2) FROM t2 
 WHERE (((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 ))
 GROUP BY c1,i1;
diff --git a/mysql-test/r/innodb_icp.result b/mysql-test/r/innodb_icp.result
index bc1c242..8a519d6 100644
--- a/mysql-test/r/innodb_icp.result
+++ b/mysql-test/r/innodb_icp.result
@@ -409,7 +409,7 @@ WHERE (pk BETWEEN 4 AND 5 OR pk < 2) AND c1 < 240
 ORDER BY c1
 LIMIT 1;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	range	PRIMARY,k1	k1	5	NULL	3	Using where; Using index
+1	SIMPLE	t1	range	PRIMARY,k1	k1	5	NULL	4	Using where; Using index
 DROP TABLE t1;
 #
 #
diff --git a/mysql-test/r/mysqlbinlog_row_minimal.result b/mysql-test/r/mysqlbinlog_row_minimal.result
index 84c0e66..2737d61 100644
--- a/mysql-test/r/mysqlbinlog_row_minimal.result
+++ b/mysql-test/r/mysqlbinlog_row_minimal.result
@@ -54,7 +54,7 @@ CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMIN
 BEGIN
 /*!*/;
 # at 809
-#<date> server id 1  end_log_pos 865 CRC32 XXX 	Table_map: `test`.`t1` mapped to number 30
+#<date> server id 1  end_log_pos 865 CRC32 XXX 	Table_map: `test`.`t1` mapped to number num
 # at 865
 #<date> server id 1  end_log_pos 934 CRC32 XXX 	Write_rows: table id 30 flags: STMT_END_F
 ### INSERT INTO `test`.`t1`
@@ -79,7 +79,7 @@ COMMIT
 BEGIN
 /*!*/;
 # at 1049
-#<date> server id 1  end_log_pos 1105 CRC32 XXX 	Table_map: `test`.`t1` mapped to number 30
+#<date> server id 1  end_log_pos 1105 CRC32 XXX 	Table_map: `test`.`t1` mapped to number num
 # at 1105
 #<date> server id 1  end_log_pos 1173 CRC32 XXX 	Write_rows: table id 30 flags: STMT_END_F
 ### INSERT INTO `test`.`t1`
@@ -104,7 +104,7 @@ COMMIT
 BEGIN
 /*!*/;
 # at 1288
-#<date> server id 1  end_log_pos 1344 CRC32 XXX 	Table_map: `test`.`t1` mapped to number 30
+#<date> server id 1  end_log_pos 1344 CRC32 XXX 	Table_map: `test`.`t1` mapped to number num
 # at 1344
 #<date> server id 1  end_log_pos 1411 CRC32 XXX 	Write_rows: table id 30 flags: STMT_END_F
 ### INSERT INTO `test`.`t1`
@@ -129,7 +129,7 @@ COMMIT
 BEGIN
 /*!*/;
 # at 1526
-#<date> server id 1  end_log_pos 1582 CRC32 XXX 	Table_map: `test`.`t1` mapped to number 30
+#<date> server id 1  end_log_pos 1582 CRC32 XXX 	Table_map: `test`.`t1` mapped to number num
 # at 1582
 #<date> server id 1  end_log_pos 1652 CRC32 XXX 	Write_rows: table id 30 flags: STMT_END_F
 ### INSERT INTO `test`.`t1`
@@ -154,7 +154,7 @@ COMMIT
 BEGIN
 /*!*/;
 # at 1767
-#<date> server id 1  end_log_pos 1823 CRC32 XXX 	Table_map: `test`.`t2` mapped to number 31
+#<date> server id 1  end_log_pos 1823 CRC32 XXX 	Table_map: `test`.`t2` mapped to number num
 # at 1823
 #<date> server id 1  end_log_pos 1990 CRC32 XXX 	Write_rows: table id 31 flags: STMT_END_F
 ### INSERT INTO `test`.`t2`
@@ -212,7 +212,7 @@ COMMIT
 BEGIN
 /*!*/;
 # at 2105
-#<date> server id 1  end_log_pos 2161 CRC32 XXX 	Table_map: `test`.`t2` mapped to number 31
+#<date> server id 1  end_log_pos 2161 CRC32 XXX 	Table_map: `test`.`t2` mapped to number num
 # at 2161
 #<date> server id 1  end_log_pos 2235 CRC32 XXX 	Update_rows: table id 31 flags: STMT_END_F
 ### UPDATE `test`.`t2`
@@ -244,7 +244,7 @@ COMMIT
 BEGIN
 /*!*/;
 # at 2350
-#<date> server id 1  end_log_pos 2406 CRC32 XXX 	Table_map: `test`.`t1` mapped to number 30
+#<date> server id 1  end_log_pos 2406 CRC32 XXX 	Table_map: `test`.`t1` mapped to number num
 # at 2406
 #<date> server id 1  end_log_pos 2460 CRC32 XXX 	Delete_rows: table id 30 flags: STMT_END_F
 ### DELETE FROM `test`.`t1`
@@ -270,7 +270,7 @@ COMMIT
 BEGIN
 /*!*/;
 # at 2575
-#<date> server id 1  end_log_pos 2631 CRC32 XXX 	Table_map: `test`.`t2` mapped to number 31
+#<date> server id 1  end_log_pos 2631 CRC32 XXX 	Table_map: `test`.`t2` mapped to number num
 # at 2631
 #<date> server id 1  end_log_pos 2685 CRC32 XXX 	Delete_rows: table id 31 flags: STMT_END_F
 ### DELETE FROM `test`.`t2`
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index b0e89b7..818316f 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -108,9 +108,6 @@ The following options may be given as the first argument:
  --bulk-insert-buffer-size=# 
  Size of tree cache used in bulk insert optimisation. Note
  that this is a limit per thread!
- --changed-page-bitmaps[=name] 
- Enable or disable CHANGED_PAGE_BITMAPS plugin. One of:
- ON, OFF, FORCE (don't start if the plugin fails to load).
  --character-set-client-handshake 
  Don't ignore client side character set value sent during
  handshake.
@@ -1153,7 +1150,6 @@ binlog-row-event-max-size 1024
 binlog-row-image FULL
 binlog-stmt-cache-size 32768
 bulk-insert-buffer-size 8388608
-changed-page-bitmaps ON
 character-set-client-handshake TRUE
 character-set-filesystem binary
 character-sets-dir MYSQL_CHARSETSDIR/
diff --git a/mysql-test/r/order_by_optimizer_innodb.result b/mysql-test/r/order_by_optimizer_innodb.result
index f3167db..0b62ba9 100644
--- a/mysql-test/r/order_by_optimizer_innodb.result
+++ b/mysql-test/r/order_by_optimizer_innodb.result
@@ -40,11 +40,11 @@ pk1	count(*)
 # The following should use range(ux_pk1_fd5), two key parts (key_len=5+8=13)
 EXPLAIN SELECT * FROM t2 USE INDEX(ux_pk1_fd5) WHERE pk1=9 AND fd5 < 500 ORDER BY fd5 DESC LIMIT 10;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t2	range	ux_pk1_fd5	ux_pk1_fd5	13	NULL	137	Using where
+1	SIMPLE	t2	range	ux_pk1_fd5	ux_pk1_fd5	13	NULL	138	Using where
 # This also must use range, not ref. key_len must be 13
 EXPLAIN SELECT * FROM t2                       WHERE pk1=9 AND fd5 < 500 ORDER BY fd5 DESC LIMIT 10;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t2	range	PRIMARY,ux_pk1_fd5	ux_pk1_fd5	13	NULL	137	Using where
+1	SIMPLE	t2	range	PRIMARY,ux_pk1_fd5	ux_pk1_fd5	13	NULL	138	Using where
 drop table t0,t1, t2;
 #
 # MDEV-6814: Server crashes in calculate_key_len on query with ORDER BY
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index c9568f7..d1ec12e 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -385,33 +385,33 @@ DROP TABLE t1;
 create table t1 (a int) engine=innodb partition by hash(a) ;
 show table status like 't1';
 Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
-t1	InnoDB	10	Compact	2	8192	16384	0	0	#	NULL	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
+t1	InnoDB	10	Dynamic	2	8192	16384	0	0	#	NULL	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
 drop table t1;
 create table t1 (a int)
 engine = innodb
 partition by key (a);
 show table status;
 Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
-t1	InnoDB	10	Compact	2	8192	16384	0	0	#	NULL	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
+t1	InnoDB	10	Dynamic	2	8192	16384	0	0	#	NULL	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
 insert into t1 values (0), (1), (2), (3);
 show table status;
 Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
-t1	InnoDB	10	Compact	4	4096	16384	0	0	#	NULL	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
+t1	InnoDB	10	Dynamic	4	4096	16384	0	0	#	NULL	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
 drop table t1;
 create table t1 (a int auto_increment primary key)
 engine = innodb
 partition by key (a);
 show table status;
 Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
-t1	InnoDB	10	Compact	2	8192	16384	0	0	#	1	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
+t1	InnoDB	10	Dynamic	2	8192	16384	0	0	#	1	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
 insert into t1 values (NULL), (NULL), (NULL), (NULL);
 show table status;
 Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
-t1	InnoDB	10	Compact	4	4096	16384	0	0	#	5	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
+t1	InnoDB	10	Dynamic	4	4096	16384	0	0	#	5	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
 insert into t1 values (NULL), (NULL), (NULL), (NULL);
 show table status;
 Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
-t1	InnoDB	10	Compact	8	2048	16384	0	0	#	9	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
+t1	InnoDB	10	Dynamic	8	2048	16384	0	0	#	9	#	NULL	NULL	latin1_swedish_ci	NULL	partitioned	
 drop table t1;
 create table t1 (a int)
 partition by key (a)
diff --git a/mysql-test/r/partition_innodb_plugin.result b/mysql-test/r/partition_innodb_plugin.result
index d53d2ed..35b1e31 100644
--- a/mysql-test/r/partition_innodb_plugin.result
+++ b/mysql-test/r/partition_innodb_plugin.result
@@ -42,6 +42,8 @@ SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
 SET @@global.innodb_file_format = Barracuda,
 @@global.innodb_file_per_table = ON,
 @@global.innodb_strict_mode = ON;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 connect con1,localhost,root,,;
 CREATE TABLE t1 (id INT NOT NULL
 PRIMARY KEY,
@@ -104,6 +106,8 @@ disconnect con2;
 connection default;
 SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
 SET @@global.innodb_file_format = @old_innodb_file_format;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
 SET NAMES utf8;
 CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
@@ -143,12 +147,12 @@ ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
 # First table reported in 'SHOW ENGINE InnoDB STATUS'
 SHOW ENGINE InnoDB STATUS;
 Type	Name	Status
-InnoDB		index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */ 
+InnoDB		index PRIMARY of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
 set @old_sql_mode = @@sql_mode;
 set sql_mode = 'ANSI_QUOTES';
 SHOW ENGINE InnoDB STATUS;
 Type	Name	Status
-InnoDB		index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */ 
+InnoDB		index PRIMARY of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
 set @@sql_mode = @old_sql_mode;
 connection con1;
 ROLLBACK;
diff --git a/mysql-test/r/range_vs_index_merge_innodb.result b/mysql-test/r/range_vs_index_merge_innodb.result
index 8428936..19feae4 100644
--- a/mysql-test/r/range_vs_index_merge_innodb.result
+++ b/mysql-test/r/range_vs_index_merge_innodb.result
@@ -57,7 +57,7 @@ WHERE Population < 200000 AND Name LIKE 'P%' AND
 (Population > 300000 OR Name LIKE 'T%') AND
 (Population < 100000 OR Name LIKE 'Pa%');
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population,Name	Name	35	NULL	235	Using index condition; Using where
+1	SIMPLE	City	range	Population,Name	Name	35	NULL	236	Using index condition; Using where
 EXPLAIN
 SELECT * FROM City
 WHERE Population > 100000 AND Name LIKE 'Aba%' OR
@@ -65,34 +65,34 @@ Country IN ('CAN', 'ARG') AND ID < 3800 OR
 Country < 'U' AND Name LIKE 'Zhu%' OR
 ID BETWEEN 3800 AND 3810;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	PRIMARY,Population,Country,Name	Name,Country,PRIMARY	35,7,4	NULL	123	Using sort_union(Name,Country,PRIMARY); Using where
+1	SIMPLE	City	index_merge	PRIMARY,Population,Country,Name	Name,Country,PRIMARY	35,7,4	NULL	125	Using sort_union(Name,Country,PRIMARY); Using where
 EXPLAIN 
 SELECT * FROM City
 WHERE (Population > 101000 AND Population < 115000);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population	Population	4	NULL	458	Using index condition
+1	SIMPLE	City	range	Population	Population	4	NULL	459	Using index condition
 EXPLAIN 
 SELECT * FROM City
 WHERE (Population > 101000 AND Population < 102000);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population	Population	4	NULL	38	Using index condition
+1	SIMPLE	City	range	Population	Population	4	NULL	39	Using index condition
 EXPLAIN 
 SELECT * FROM City
 WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'F'));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	Country,Name	Name,Country	35,3	NULL	213	Using sort_union(Name,Country); Using where
+1	SIMPLE	City	index_merge	Country,Name	Name,Country	35,3	NULL	215	Using sort_union(Name,Country); Using where
 EXPLAIN 
 SELECT * FROM City
 WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'F'))
 AND (Population > 101000 AND Population < 115000);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	Population,Country,Name	Name,Country	35,3	NULL	213	Using sort_union(Name,Country); Using where
+1	SIMPLE	City	index_merge	Population,Country,Name	Name,Country	35,3	NULL	215	Using sort_union(Name,Country); Using where
 EXPLAIN 
 SELECT * FROM City
 WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'F'))
 AND (Population > 101000 AND Population < 102000);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population,Country,Name	Population	4	NULL	38	Using index condition; Using where
+1	SIMPLE	City	range	Population,Country,Name	Population	4	NULL	39	Using index condition; Using where
 SELECT * FROM City USE INDEX ()
 WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'F'))
 AND (Population > 101000 AND Population < 115000);
@@ -176,11 +176,11 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 EXPLAIN
 SELECT  * FROM City WHERE (Name < 'Bb');
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Name	Name	35	NULL	373	Using index condition
+1	SIMPLE	City	range	Name	Name	35	NULL	374	Using index condition
 EXPLAIN
 SELECT  * FROM City WHERE (Country > 'A' AND Country < 'B');
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Country	Country	3	NULL	106	Using index condition
+1	SIMPLE	City	range	Country	Country	3	NULL	107	Using index condition
 EXPLAIN
 SELECT  * FROM City WHERE (Name BETWEEN 'P' AND 'Pb');
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
@@ -188,15 +188,15 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 EXPLAIN
 SELECT  * FROM City WHERE (Name BETWEEN 'P' AND 'S');
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Name	Name	35	NULL	384	Using index condition
+1	SIMPLE	City	range	Name	Name	35	NULL	385	Using index condition
 EXPLAIN
 SELECT  * FROM City WHERE (Population > 101000 AND Population < 110000);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population	Population	4	NULL	327	Using index condition
+1	SIMPLE	City	range	Population	Population	4	NULL	328	Using index condition
 EXPLAIN
 SELECT  * FROM City WHERE (Population > 103000 AND Population < 104000);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population	Population	4	NULL	36	Using index condition
+1	SIMPLE	City	range	Population	Population	4	NULL	37	Using index condition
 EXPLAIN
 SELECT  * FROM City 
 WHERE (Name < 'Ac' AND (Country > 'A' AND Country < 'B')) OR
@@ -208,19 +208,19 @@ SELECT  * FROM City
 WHERE (Name < 'Ac' AND (Country > 'A' AND Country < 'B')) OR
 (Name BETWEEN 'P' AND 'S' AND (Population > 103000 AND Population < 104000));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	Population,Country,Name	Name,Population	35,4	NULL	59	Using sort_union(Name,Population); Using where
+1	SIMPLE	City	index_merge	Population,Country,Name	Name,Population	35,4	NULL	60	Using sort_union(Name,Population); Using where
 EXPLAIN
 SELECT  * FROM City
 WHERE (Name < 'Bb' AND (Country > 'A' AND Country < 'B')) OR
 (Name BETWEEN 'P' AND 'Pb' AND (Population > 101000 AND Population < 110000));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	Population,Country,Name	Country,Name	3,35	NULL	177	Using sort_union(Country,Name); Using where
+1	SIMPLE	City	index_merge	Population,Country,Name	Country,Name	3,35	NULL	178	Using sort_union(Country,Name); Using where
 EXPLAIN
 SELECT  * FROM City
 WHERE (Name < 'Bb' AND (Country > 'A' AND Country < 'B')) OR
 (Name BETWEEN 'P' AND 'S' AND (Population > 103000 AND Population < 104000));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	Population,Country,Name	Country,Population	3,4	NULL	142	Using sort_union(Country,Population); Using where
+1	SIMPLE	City	index_merge	Population,Country,Name	Country,Population	3,4	NULL	144	Using sort_union(Country,Population); Using where
 SELECT  * FROM City USE INDEX ()
 WHERE (Name < 'Ac' AND (Country > 'A' AND Country < 'B')) OR
 (Name BETWEEN 'P' AND 'Pb' AND (Population > 101000 AND Population < 110000));
@@ -336,15 +336,15 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 EXPLAIN
 SELECT * FROM City WHERE (ID < 600) OR (ID BETWEEN 900 AND 1500);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	PRIMARY	PRIMARY	4	NULL	1198	Using where
+1	SIMPLE	City	range	PRIMARY	PRIMARY	4	NULL	1200	Using where
 EXPLAIN
 SELECT * FROM City WHERE Country > 'A' AND Country < 'ARG';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Country	Country	3	NULL	19	Using index condition
+1	SIMPLE	City	range	Country	Country	3	NULL	20	Using index condition
 EXPLAIN
 SELECT * FROM City WHERE Name LIKE 'H%' OR Name LIKE 'P%' ;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Name	Name	35	NULL	394	Using index condition; Using where
+1	SIMPLE	City	range	Name	Name	35	NULL	395	Using index condition; Using where
 EXPLAIN
 SELECT * FROM City WHERE Name LIKE 'Ha%' OR Name LIKE 'Pa%' ;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
@@ -362,7 +362,7 @@ WHERE ((ID < 800) AND (Name LIKE 'Ha%' OR (Country > 'A' AND Country < 'ARG')))
 OR ((ID BETWEEN 900 AND 1500) AND 
 (Name LIKE 'Pa%' OR (Population > 103000 AND Population < 104000)));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	PRIMARY,Population,Country,Name	Name,Country,PRIMARY	39,3,4	NULL	680	Using sort_union(Name,Country,PRIMARY); Using where
+1	SIMPLE	City	index_merge	PRIMARY,Population,Country,Name	Name,Country,PRIMARY	39,3,4	NULL	683	Using sort_union(Name,Country,PRIMARY); Using where
 EXPLAIN
 SELECT * FROM City
 WHERE ((ID < 200) AND (Name LIKE 'Ha%' OR (Country > 'A' AND Country < 'ARG')))
@@ -577,11 +577,11 @@ ID	Name	Country	Population
 EXPLAIN 
 SELECT * FROM City WHERE Population > 101000 AND Population < 102000;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population	Population	4	NULL	38	Using index condition
+1	SIMPLE	City	range	Population	Population	4	NULL	39	Using index condition
 EXPLAIN 
 SELECT * FROM City WHERE Population > 101000 AND Population < 110000;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population	Population	4	NULL	327	Using index condition
+1	SIMPLE	City	range	Population	Population	4	NULL	328	Using index condition
 EXPLAIN 
 SELECT * FROM City WHERE Country < 'C';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
@@ -593,7 +593,7 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 EXPLAIN 
 SELECT * FROM City WHERE Name BETWEEN 'P' AND 'S';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Name	Name	35	NULL	384	Using index condition
+1	SIMPLE	City	range	Name	Name	35	NULL	385	Using index condition
 EXPLAIN 
 SELECT * FROM City WHERE Name BETWEEN 'P' AND 'Pb';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
@@ -601,7 +601,7 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 EXPLAIN 
 SELECT * FROM City WHERE ID BETWEEN 3400 AND 3800;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	PRIMARY	PRIMARY	4	NULL	400	Using where
+1	SIMPLE	City	range	PRIMARY	PRIMARY	4	NULL	401	Using where
 EXPLAIN 
 SELECT * FROM City WHERE ID BETWEEN 3790 AND 3800;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
@@ -609,7 +609,7 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 EXPLAIN 
 SELECT * FROM City WHERE Name LIKE 'P%';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Name	Name	35	NULL	235	Using index condition
+1	SIMPLE	City	range	Name	Name	35	NULL	236	Using index condition
 EXPLAIN
 SELECT * FROM City
 WHERE ((Population > 101000 AND Population < 102000) AND
@@ -617,7 +617,7 @@ WHERE ((Population > 101000 AND Population < 102000) AND
 ((ID BETWEEN 3400 AND 3800) AND 
 (Country < 'AGO' OR Name LIKE 'Pa%'));
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	PRIMARY,Population,Country,Name	Population,PRIMARY	4,4	NULL	438	Using sort_union(Population,PRIMARY); Using where
+1	SIMPLE	City	index_merge	PRIMARY,Population,Country,Name	Population,PRIMARY	4,4	NULL	440	Using sort_union(Population,PRIMARY); Using where
 EXPLAIN
 SELECT * FROM City
 WHERE ((Population > 101000 AND Population < 110000) AND
@@ -684,11 +684,11 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 EXPLAIN
 SELECT * FROM City WHERE Name LIKE 'P%';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Name	Name	35	NULL	235	Using index condition
+1	SIMPLE	City	range	Name	Name	35	NULL	236	Using index condition
 EXPLAIN
 SELECT * FROM City WHERE (Population > 101000 AND Population < 103000);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population	Population	4	NULL	80	Using index condition
+1	SIMPLE	City	range	Population	Population	4	NULL	81	Using index condition
 EXPLAIN
 SELECT * FROM City WHERE Country='USA';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
@@ -702,7 +702,7 @@ SELECT * FROM City
 WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'Pas%')
 AND Country='USA';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	Population,Country,Name,CountryPopulation	CountryPopulation,Name	7,35	NULL	17	Using sort_union(CountryPopulation,Name); Using where
+1	SIMPLE	City	index_merge	Population,Country,Name,CountryPopulation	CountryPopulation,Name	7,35	NULL	18	Using sort_union(CountryPopulation,Name); Using where
 EXPLAIN
 SELECT * FROM City 
 WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'P%')
@@ -777,7 +777,7 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 EXPLAIN
 SELECT * FROM City WHERE ID BETWEEN 3500 AND 3800;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	PRIMARY	PRIMARY	4	NULL	300	Using where
+1	SIMPLE	City	range	PRIMARY	PRIMARY	4	NULL	301	Using where
 EXPLAIN
 SELECT * FROM City WHERE ID BETWEEN 4000 AND 4300;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
@@ -789,11 +789,11 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 EXPLAIN
 SELECT * FROM City WHERE (Population > 101000 AND Population < 102000);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population	Population	4	NULL	38	Using index condition
+1	SIMPLE	City	range	Population	Population	4	NULL	39	Using index condition
 EXPLAIN
 SELECT * FROM City WHERE (Population > 101000 AND Population < 103000);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	range	Population	Population	4	NULL	80	Using index condition
+1	SIMPLE	City	range	Population	Population	4	NULL	81	Using index condition
 EXPLAIN
 SELECT * FROM City WHERE Name LIKE 'Pa%';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
@@ -806,7 +806,7 @@ WHERE ((Population > 101000 AND Population < 102000) OR
 ID BETWEEN 3790 AND 3800) AND Country='USA'
         AND (Name LIKE 'Pa%' OR ID BETWEEN 4025 AND 4035);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	PRIMARY,Population,Country,Name,CountryPopulation,CountryName	CountryPopulation,PRIMARY	7,4	NULL	13	Using sort_union(CountryPopulation,PRIMARY); Using where
+1	SIMPLE	City	index_merge	PRIMARY,Population,Country,Name,CountryPopulation,CountryName	CountryPopulation,PRIMARY	7,4	NULL	14	Using sort_union(CountryPopulation,PRIMARY); Using where
 EXPLAIN
 SELECT * FROM City
 WHERE ((Population > 101000 AND Population < 103000) OR
@@ -869,7 +869,7 @@ WHERE ((Population > 101000 and Population < 102000) OR
 ID BETWEEN 3790 AND 3800) AND Country='USA'
         OR (Name LIKE 'Pa%' OR ID BETWEEN 250 AND 260) AND Country='BRA';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	City	index_merge	PRIMARY,Population,Country,Name,CountryPopulation,CountryName	CountryPopulation,CountryName,PRIMARY	7,38,4	NULL	35	Using sort_union(CountryPopulation,CountryName,PRIMARY); Using where
+1	SIMPLE	City	index_merge	PRIMARY,Population,Country,Name,CountryPopulation,CountryName	CountryPopulation,CountryName,PRIMARY	7,38,4	NULL	36	Using sort_union(CountryPopulation,CountryName,PRIMARY); Using where
 SELECT * FROM City USE INDEX ()
 WHERE ((Population > 101000 and Population < 102000) OR
 ID BETWEEN 3790 AND 3800) AND Country='USA'
@@ -1445,7 +1445,7 @@ explain
 select * from t1
 where (home_state = 'ia' or work_state='ia') and account_id = 1;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index_merge	account_id,user_home_state_indx,user_work_state_indx	user_home_state_indx,user_work_state_indx	3,3	NULL	10	Using union(user_home_state_indx,user_work_state_indx); Using where
+1	SIMPLE	t1	index_merge	account_id,user_home_state_indx,user_work_state_indx	user_home_state_indx,user_work_state_indx	3,3	NULL	12	Using union(user_home_state_indx,user_work_state_indx); Using where
 drop table t1;
 CREATE TABLE t1 (
 c1 int(11) NOT NULL auto_increment,
diff --git a/mysql-test/r/row-checksum-old.result b/mysql-test/r/row-checksum-old.result
index ef52346..5789fc6 100644
--- a/mysql-test/r/row-checksum-old.result
+++ b/mysql-test/r/row-checksum-old.result
@@ -73,7 +73,7 @@ test.t1	4108368782
 drop table if exists t1;
 create table t1 (a int null, v varchar(100)) engine=innodb checksum=0 row_format=fixed;
 Warnings:
-Warning	1478	InnoDB: assuming ROW_FORMAT=COMPACT.
+Warning	1478	InnoDB: assuming ROW_FORMAT=DYNAMIC.
 insert into t1 values(null, null), (1, "hello");
 checksum table t1;
 Table	Checksum
diff --git a/mysql-test/r/row-checksum.result b/mysql-test/r/row-checksum.result
index fb8a126..0fbebba 100644
--- a/mysql-test/r/row-checksum.result
+++ b/mysql-test/r/row-checksum.result
@@ -73,7 +73,7 @@ test.t1	3885665021
 drop table if exists t1;
 create table t1 (a int null, v varchar(100)) engine=innodb checksum=0 row_format=fixed;
 Warnings:
-Warning	1478	InnoDB: assuming ROW_FORMAT=COMPACT.
+Warning	1478	InnoDB: assuming ROW_FORMAT=DYNAMIC.
 insert into t1 values(null, null), (1, "hello");
 checksum table t1;
 Table	Checksum
diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result
index daf2807..2c1913f 100644
--- a/mysql-test/r/selectivity_innodb.result
+++ b/mysql-test/r/selectivity_innodb.result
@@ -144,9 +144,9 @@ order by s_suppkey;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	PRIMARY	supplier	index	PRIMARY	PRIMARY	4	NULL	10	100.00	
 1	PRIMARY	<derived3>	ref	key0	key0	5	dbt3_s001.supplier.s_suppkey	10	100.00	Using where
-3	DERIVED	lineitem	range	i_l_shipdate	i_l_shipdate	4	NULL	228	100.00	Using where; Using temporary; Using filesort
-2	SUBQUERY	<derived4>	ALL	NULL	NULL	NULL	NULL	228	100.00	
-4	DERIVED	lineitem	range	i_l_shipdate	i_l_shipdate	4	NULL	228	100.00	Using where; Using temporary; Using filesort
+3	DERIVED	lineitem	range	i_l_shipdate	i_l_shipdate	4	NULL	229	100.00	Using where; Using temporary; Using filesort
+2	SUBQUERY	<derived4>	ALL	NULL	NULL	NULL	NULL	229	100.00	
+4	DERIVED	lineitem	range	i_l_shipdate	i_l_shipdate	4	NULL	229	100.00	Using where; Using temporary; Using filesort
 Warnings:
 Note	1003	select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where ((`revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`))) order by `dbt3_s001`.`supplier`.`s_suppkey`
 select s_suppkey, s_name, s_address, s_phone, total_revenue
@@ -165,9 +165,9 @@ order by s_suppkey;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	PRIMARY	supplier	index	PRIMARY	PRIMARY	4	NULL	10	100.00	
 1	PRIMARY	<derived3>	ref	key0	key0	5	dbt3_s001.supplier.s_suppkey	10	100.00	Using where
-3	DERIVED	lineitem	range	i_l_shipdate	i_l_shipdate	4	NULL	228	100.00	Using where; Using temporary; Using filesort
-2	SUBQUERY	<derived4>	ALL	NULL	NULL	NULL	NULL	227	100.00	
-4	DERIVED	lineitem	range	i_l_shipdate	i_l_shipdate	4	NULL	228	100.00	Using where; Using temporary; Using filesort
+3	DERIVED	lineitem	range	i_l_shipdate	i_l_shipdate	4	NULL	229	100.00	Using where; Using temporary; Using filesort
+2	SUBQUERY	<derived4>	ALL	NULL	NULL	NULL	NULL	228	100.00	
+4	DERIVED	lineitem	range	i_l_shipdate	i_l_shipdate	4	NULL	229	100.00	Using where; Using temporary; Using filesort
 Warnings:
 Note	1003	select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where ((`revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey`) and (`revenue0`.`total_revenue` = (select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`))) order by `dbt3_s001`.`supplier`.`s_suppkey`
 select s_suppkey, s_name, s_address, s_phone, total_revenue
@@ -544,7 +544,7 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	PRIMARY	<subquery2>	eq_ref	distinct_key	distinct_key	4	func	1	100.00	
 2	MATERIALIZED	part	ALL	PRIMARY	NULL	NULL	NULL	200	4.17	Using where
 2	MATERIALIZED	partsupp	ref	PRIMARY,i_ps_partkey,i_ps_suppkey	PRIMARY	4	dbt3_s001.part.p_partkey	3	100.00	Using where
-4	DEPENDENT SUBQUERY	lineitem	ref	i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey	i_l_suppkey_partkey	10	dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey	8	14.37	Using where
+4	DEPENDENT SUBQUERY	lineitem	ref	i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey	i_l_suppkey_partkey	10	dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey	8	14.40	Using where
 Warnings:
 Note	1276	Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
 Note	1276	Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
@@ -600,7 +600,7 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	PRIMARY	<subquery2>	eq_ref	distinct_key	distinct_key	4	func	1	100.00	
 2	MATERIALIZED	part	ALL	PRIMARY	NULL	NULL	NULL	200	7.03	Using where
 2	MATERIALIZED	partsupp	ref	PRIMARY,i_ps_partkey,i_ps_suppkey	PRIMARY	4	dbt3_s001.part.p_partkey	3	100.00	Using where
-4	DEPENDENT SUBQUERY	lineitem	ref	i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey	i_l_suppkey_partkey	10	dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey	8	14.37	Using where
+4	DEPENDENT SUBQUERY	lineitem	ref	i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey	i_l_suppkey_partkey	10	dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey	8	14.40	Using where
 Warnings:
 Note	1276	Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
 Note	1276	Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
@@ -656,7 +656,7 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	PRIMARY	<subquery2>	eq_ref	distinct_key	distinct_key	4	func	1	100.00	
 2	MATERIALIZED	part	ALL	PRIMARY	NULL	NULL	NULL	200	7.81	Using where
 2	MATERIALIZED	partsupp	ref	PRIMARY,i_ps_partkey,i_ps_suppkey	PRIMARY	4	dbt3_s001.part.p_partkey	3	100.00	Using where
-4	DEPENDENT SUBQUERY	lineitem	ref	i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey	i_l_suppkey_partkey	10	dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey	8	14.37	Using where
+4	DEPENDENT SUBQUERY	lineitem	ref	i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey	i_l_suppkey_partkey	10	dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey	8	14.40	Using where
 Warnings:
 Note	1276	Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
 Note	1276	Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
@@ -712,7 +712,7 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	PRIMARY	<subquery2>	eq_ref	distinct_key	distinct_key	4	func	1	100.00	
 2	MATERIALIZED	part	ALL	PRIMARY	NULL	NULL	NULL	200	7.81	Using where
 2	MATERIALIZED	partsupp	ref	PRIMARY,i_ps_partkey,i_ps_suppkey	PRIMARY	4	dbt3_s001.part.p_partkey	3	100.00	Using where
-4	DEPENDENT SUBQUERY	lineitem	ref	i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey	i_l_suppkey_partkey	10	dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey	8	14.37	Using where
+4	DEPENDENT SUBQUERY	lineitem	ref	i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey	i_l_suppkey_partkey	10	dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey	8	14.40	Using where
 Warnings:
 Note	1276	Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
 Note	1276	Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
diff --git a/mysql-test/r/stat_tables_innodb.result b/mysql-test/r/stat_tables_innodb.result
index 0e86675..42443bf 100644
--- a/mysql-test/r/stat_tables_innodb.result
+++ b/mysql-test/r/stat_tables_innodb.result
@@ -67,7 +67,7 @@ and r_name = 'AMERICA' and o_orderdate >= date '1995-01-01'
 group by n_name
 order by revenue desc;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	orders	range	PRIMARY,i_o_orderdate,i_o_custkey	i_o_orderdate	4	NULL	211	Using where; Using temporary; Using filesort
+1	SIMPLE	orders	range	PRIMARY,i_o_orderdate,i_o_custkey	i_o_orderdate	4	NULL	213	Using where; Using temporary; Using filesort
 1	SIMPLE	customer	eq_ref	PRIMARY,i_c_nationkey	PRIMARY	4	dbt3_s001.orders.o_custkey	1	Using where
 1	SIMPLE	nation	eq_ref	PRIMARY,i_n_regionkey	PRIMARY	4	dbt3_s001.customer.c_nationkey	1	
 1	SIMPLE	supplier	ref	PRIMARY,i_s_nationkey	i_s_nationkey	5	dbt3_s001.customer.c_nationkey	1	Using index
@@ -198,7 +198,7 @@ and r_name = 'AMERICA' and o_orderdate >= date '1995-01-01'
 group by n_name
 order by revenue desc;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	orders	range	PRIMARY,i_o_orderdate,i_o_custkey	i_o_orderdate	4	NULL	211	Using where; Using temporary; Using filesort
+1	SIMPLE	orders	range	PRIMARY,i_o_orderdate,i_o_custkey	i_o_orderdate	4	NULL	213	Using where; Using temporary; Using filesort
 1	SIMPLE	customer	eq_ref	PRIMARY,i_c_nationkey	PRIMARY	4	dbt3_s001.orders.o_custkey	1	Using where
 1	SIMPLE	nation	eq_ref	PRIMARY,i_n_regionkey	PRIMARY	4	dbt3_s001.customer.c_nationkey	1	
 1	SIMPLE	supplier	ref	PRIMARY,i_s_nationkey	i_s_nationkey	5	dbt3_s001.customer.c_nationkey	1	Using index
diff --git a/mysql-test/r/type_bit_innodb.result b/mysql-test/r/type_bit_innodb.result
index 80fc942..acb3c31 100644
--- a/mysql-test/r/type_bit_innodb.result
+++ b/mysql-test/r/type_bit_innodb.result
@@ -256,7 +256,7 @@ a+0	b+0
 127	403
 explain select a+0, b+0 from t1 where a > 40 and a < 70 order by 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	range	a	a	2	NULL	8	Using where; Using index; Using filesort
+1	SIMPLE	t1	range	a	a	2	NULL	9	Using where; Using index; Using filesort
 select a+0, b+0 from t1 where a > 40 and a < 70 order by 2;
 a+0	b+0
 57	135
diff --git a/mysql-test/suite/encryption/disabled.def b/mysql-test/suite/encryption/disabled.def
index 8c0d479..ae9359f 100644
--- a/mysql-test/suite/encryption/disabled.def
+++ b/mysql-test/suite/encryption/disabled.def
@@ -14,4 +14,5 @@ innodb_scrub : MDEV-8139
 innodb_scrub_compressed : MDEV-8139
 innodb_scrub_background : MDEV-8139
 innodb_encryption-page-compression : Fails with lost connection at line 156
+innochecksum : Waiting for merge
 
diff --git a/mysql-test/suite/encryption/r/debug_key_management.result b/mysql-test/suite/encryption/r/debug_key_management.result
index 8793e6b..e185740 100644
--- a/mysql-test/suite/encryption/r/debug_key_management.result
+++ b/mysql-test/suite/encryption/r/debug_key_management.result
@@ -9,13 +9,13 @@ innodb_encryption_threads	4
 select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
 space	name	current_key_version
 0	NULL	1
-1	mysql/innodb_table_stats	1
-2	mysql/innodb_index_stats	1
+2	mysql/innodb_table_stats	1
+3	mysql/innodb_index_stats	1
 set global debug_key_management_version=10;
 select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
 space	name	current_key_version
 0	NULL	10
-1	mysql/innodb_table_stats	10
-2	mysql/innodb_index_stats	10
+2	mysql/innodb_table_stats	10
+3	mysql/innodb_index_stats	10
 set global innodb_encrypt_tables=OFF;
 set global debug_key_management_version=1;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
index cf97918..84c8c2f 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
@@ -8,9 +8,12 @@ call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal
 call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
 call mtr.add_suppression("mysqld: File .*");
 call mtr.add_suppression("InnoDB: Tablespace id .* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace.");
+call mtr.add_suppression("InnoDB: InnoDB: Page may be an index page where index id is .*");
 
 # Start server with keys2.txt
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
 INSERT INTO t1 VALUES ('foobar');
@@ -36,10 +39,12 @@ SELECT * FROM t1;
 ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
 SHOW WARNINGS;
 Level	Code	Message
-Warning	1812	Tablespace is missing for table 'test/t1'
+Warning	192	Table test/t1 in tablespace 8 is encrypted but encryption service or used key_id is not available.  Can't continue reading table.
 Warning	192	Table test/t1 is encrypted but encryption service or used key_id 2 is not available.  Can't continue reading table.
 Error	1296	Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
 DROP TABLE t1;
+Warnings:
+Warning	192	Table in tablespace 8 encrypted.However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match. Can't continue opening the table.
 # Start server with keys.txt
 CREATE TABLE t2 (c VARCHAR(8), id int not null primary key, b int, key(b)) ENGINE=InnoDB ENCRYPTED=YES;
 INSERT INTO t2 VALUES ('foobar',1,2);
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change3.result b/mysql-test/suite/encryption/r/innodb-bad-key-change3.result
index 68d8552..3449e63 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change3.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change3.result
@@ -1,5 +1,8 @@
-call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded");
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 set global innodb_compression_algorithm = 1;
 CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(255)) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
@@ -24,6 +27,8 @@ UNLOCK TABLES;
 NOT FOUND /foobar/ in t1.ibd
 ALTER TABLE t1 DISCARD TABLESPACE;
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 # List after t1 DISCARD
 t1.frm
@@ -42,3 +47,5 @@ ERROR HY000: Tablespace has been discarded for table 't1'
 # t1 yes on expecting NOT FOUND
 NOT FOUND /foobar/ in t1.ibd
 DROP TABLE t1;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
index 531ba40..3ced393 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
@@ -5,16 +5,22 @@ call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal
 call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
 call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4;
 INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 CHECK TABLE t1;
 Table	Op	Msg_type	Msg_text
-test.t1	check	Warning	Table test/t1 in tablespace 4 is encrypted but encryption service or used key_id is not available.  Can't continue reading table.
+test.t1	check	Warning	Table test/t1 in tablespace 7 is encrypted but encryption service or used key_id is not available.  Can't continue reading table.
 test.t1	check	Warning	Table test/t1 is encrypted but encryption service or used key_id is not available.  Can't continue checking table.
 test.t1	check	error	Corrupt
 SHOW WARNINGS;
 Level	Code	Message
 DROP TABLE t1;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change5.result b/mysql-test/suite/encryption/r/innodb-bad-key-change5.result
index 11130a7..9d8b1dd 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change5.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change5.result
@@ -5,10 +5,14 @@ call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal
 call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
 call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4;
 INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 OPTIMIZE TABLE t1;
 Table	Op	Msg_type	Msg_text
@@ -26,3 +30,5 @@ Level	Code	Message
 Warning	192	Table test/t1 is encrypted but encryption service or used key_id is not available.  Can't continue reading table.
 Error	1296	Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
 DROP TABLE t1;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb-discard-import.result b/mysql-test/suite/encryption/r/innodb-discard-import.result
index 195b82f..dc55c0a 100644
--- a/mysql-test/suite/encryption/r/innodb-discard-import.result
+++ b/mysql-test/suite/encryption/r/innodb-discard-import.result
@@ -1,5 +1,8 @@
-call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded");
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 SET GLOBAL innodb_compression_algorithm = 1;
 create table t1(c1 bigint not null, b char(200))  engine=innodb encrypted=yes encryption_key_id=4;
@@ -72,6 +75,8 @@ ALTER TABLE t2 DISCARD TABLESPACE;
 ALTER TABLE t3 DISCARD TABLESPACE;
 ALTER TABLE t4 DISCARD TABLESPACE;
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 SET GLOBAL innodb_compression_algorithm = 1;
 # List after t1 DISCARD
@@ -129,6 +134,8 @@ COUNT(*)
 2000
 flush data to disk
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 SET GLOBAL innodb_compression_algorithm = 1;
 # tables should be still either encrypted and/or compressed
@@ -142,3 +149,5 @@ NOT FOUND /tmpres/ in t3.ibd
 NOT FOUND /mysql/ in t4.ibd
 DROP PROCEDURE innodb_insert_proc;
 DROP TABLE t1,t2,t3,t4;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb-encryption-alter.result b/mysql-test/suite/encryption/r/innodb-encryption-alter.result
index 5869c5d..2003df0 100644
--- a/mysql-test/suite/encryption/r/innodb-encryption-alter.result
+++ b/mysql-test/suite/encryption/r/innodb-encryption-alter.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 SET GLOBAL innodb_encrypt_tables = ON;
 SET GLOBAL innodb_encryption_threads = 4;
@@ -51,3 +53,5 @@ Error	1005	Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create
 Warning	1030	Got error 140 "Wrong create options" from storage engine InnoDB
 set innodb_default_encryption_key_id = 1;
 drop table t1,t2;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb-encryption-disable.result b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
index 63ff1dc..62b233c 100644
--- a/mysql-test/suite/encryption/r/innodb-encryption-disable.result
+++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
 call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
@@ -23,10 +25,24 @@ CREATE TABLE `t1` (
 `charcol3` varchar(128) DEFAULT NULL
 ) ENGINE=InnoDB;
 insert into t1 values (1,2,'maria','db','encryption');
+select * from t1;
+intcol1	intcol2	charcol1	charcol2	charcol3
+1	2	maria	db	encryption
+select * from t5;
+intcol1	intcol2	charcol1	charcol2	charcol3
+1	2	maria	db	encryption
 alter table t1 encrypted='yes' `encryption_key_id`=1;
 select * from t1;
+intcol1	intcol2	charcol1	charcol2	charcol3
+1	2	maria	db	encryption
+select * from t5;
+intcol1	intcol2	charcol1	charcol2	charcol3
+1	2	maria	db	encryption
+select * from t1;
 ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
 select * from t5;
 ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
 drop table t1;
 drop table t5;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb-log-encrypt.result b/mysql-test/suite/encryption/r/innodb-log-encrypt.result
index 655e302..fb62292 100644
--- a/mysql-test/suite/encryption/r/innodb-log-encrypt.result
+++ b/mysql-test/suite/encryption/r/innodb-log-encrypt.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 create table t1(c1 bigint not null, b char(200), c varchar(200)) engine=innodb encrypted=yes encryption_key_id=1;
 show warnings;
@@ -53,3 +55,5 @@ FOUND /publicmessage/ in ib_logfile0
 NOT FOUND /publicmessage/ in ib_logfile1
 drop procedure innodb_insert_proc;
 drop table t1;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb-page_encryption.result b/mysql-test/suite/encryption/r/innodb-page_encryption.result
index c481498..051fd60 100644
--- a/mysql-test/suite/encryption/r/innodb-page_encryption.result
+++ b/mysql-test/suite/encryption/r/innodb-page_encryption.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
 show warnings;
@@ -121,6 +123,8 @@ SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_
 variable_value >= 0
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 update innodb_normal set c1 = c1 +1;
 update innodb_compact set c1 = c1 + 1;
@@ -198,6 +202,8 @@ innodb_redundant	CREATE TABLE `innodb_redundant` (
   `b` char(200) DEFAULT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 show create table innodb_compact;
 Table	Create Table
@@ -275,3 +281,5 @@ drop table innodb_compressed;
 drop table innodb_dynamic;
 drop table innodb_redundant;
 drop table innodb_defkey;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result b/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result
index f7ffc77..6efefb2 100644
--- a/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result
+++ b/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 set global innodb_compression_algorithm = 1;
 create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
@@ -75,6 +77,8 @@ variable_value >= 0
 SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decompressed';
 variable_value >= 0
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 set global innodb_compression_algorithm = 1;
 update innodb_normal set c1 = c1 + 1;
@@ -129,6 +133,8 @@ innodb_dynamic	CREATE TABLE `innodb_dynamic` (
   `b` char(200) DEFAULT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 show create table innodb_normal;
 Table	Create Table
@@ -182,3 +188,5 @@ drop procedure innodb_insert_proc;
 drop table innodb_normal;
 drop table innodb_compact;
 drop table innodb_dynamic;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result b/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result
index 92130da..672202d 100644
--- a/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result
+++ b/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result
@@ -2,6 +2,8 @@ call mtr.add_suppression("KeyID 0 not found or with error. Check the key and the
 call mtr.add_suppression("Disabling redo log encryp*");
 call mtr.add_suppression("InnoDB: Redo log crypto: Can't initialize to key version*");
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
 show warnings;
@@ -100,6 +102,8 @@ SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_
 variable_value >= 0
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 update innodb_normal set c1 = c1 +1;
 update innodb_compact set c1 = c1 + 1;
@@ -169,6 +173,8 @@ innodb_redundant	CREATE TABLE `innodb_redundant` (
   `b` char(200) DEFAULT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 show create table innodb_compact;
 Table	Create Table
@@ -247,3 +253,5 @@ pk
 1
 2
 DROP TABLE t1;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result b/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
index f8c59b7..5bb3b2b 100644
--- a/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
+++ b/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
@@ -1,5 +1,8 @@
-call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
 CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB;
@@ -50,6 +53,8 @@ t2.ibd
 t3.frm
 t3.ibd
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 ALTER TABLE t1 DISCARD TABLESPACE;
 ALTER TABLE t2 DISCARD TABLESPACE;
@@ -61,6 +66,8 @@ t3.frm
 # Restarting server
 # Done restarting server
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 # Tablespaces should be still encrypted
 # t1 yes on expecting NOT FOUND
@@ -147,3 +154,5 @@ NOT FOUND /temp/ in t2.ibd
 NOT FOUND /barfoo/ in t3.ibd
 DROP PROCEDURE innodb_insert_proc;
 DROP TABLE t1, t2, t3;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result b/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result
index ab95800..576b44f 100644
--- a/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result
+++ b/mysql-test/suite/encryption/r/innodb_encryption_filekeys.result
@@ -1,5 +1,7 @@
 call mtr.add_suppression("trying to do an operation on a dropped tablespace .*");
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 SET GLOBAL innodb_encrypt_tables = OFF;
 SET GLOBAL innodb_encryption_threads = 4;
@@ -63,5 +65,7 @@ COUNT(1)
 SELECT COUNT(1) FROM t5;
 COUNT(1)
 400
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 drop table t1,t2,t3,t4, t5;
 set GLOBAL innodb_default_encryption_key_id=1;
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_is.result b/mysql-test/suite/encryption/r/innodb_encryption_is.result
index 5bbcbbe..591c5a8 100644
--- a/mysql-test/suite/encryption/r/innodb_encryption_is.result
+++ b/mysql-test/suite/encryption/r/innodb_encryption_is.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
 CREATE TABLE t2 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
@@ -12,3 +14,5 @@ NAME	ENCRYPTION_SCHEME	MIN_KEY_VERSION	CURRENT_KEY_VERSION	CURRENT_KEY_ID
 test/t1	1	1	1	1
 test/t2	1	1	1	2
 DROP TABLE t1, t2;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_row_compressed.result b/mysql-test/suite/encryption/r/innodb_encryption_row_compressed.result
new file mode 100644
index 0000000..e49e38a
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption_row_compressed.result
@@ -0,0 +1,159 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
+SET GLOBAL innodb_file_per_table = ON;
+create table innodb_compressed1(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed encrypted=yes;
+create table innodb_compressed2(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=1 encrypted=yes;
+create table innodb_compressed3(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=2 encrypted=yes;
+create table innodb_compressed4(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=4 encrypted=yes;
+insert into innodb_compressed1 values (1, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (2, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (3, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (4, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (5, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (6, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (7, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (8, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (9, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (10, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed2 select * from innodb_compressed1;
+insert into innodb_compressed3 select * from innodb_compressed1;
+insert into innodb_compressed4 select * from innodb_compressed1;
+# t1 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed1.ibd
+# t2 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed2.ibd
+# t3 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed3.ibd
+# t4 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed4.ibd
+SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
+SET GLOBAL innodb_file_per_table = ON;
+select * from innodb_compressed1 where d = 20;
+c1	d	a	b
+1	20	private	evenmoreprivate
+2	20	private	evenmoreprivate
+8	20	private	evenmoreprivate
+9	20	private	evenmoreprivate
+10	20	private	evenmoreprivate
+select * from innodb_compressed1 where d = 30;
+c1	d	a	b
+3	30	private	evenmoreprivate
+4	30	private	evenmoreprivate
+5	30	private	evenmoreprivate
+6	30	private	evenmoreprivate
+7	30	private	evenmoreprivate
+select * from innodb_compressed2 where d = 20;
+c1	d	a	b
+1	20	private	evenmoreprivate
+2	20	private	evenmoreprivate
+8	20	private	evenmoreprivate
+9	20	private	evenmoreprivate
+10	20	private	evenmoreprivate
+select * from innodb_compressed2 where d = 30;
+c1	d	a	b
+3	30	private	evenmoreprivate
+4	30	private	evenmoreprivate
+5	30	private	evenmoreprivate
+6	30	private	evenmoreprivate
+7	30	private	evenmoreprivate
+select * from innodb_compressed3 where d = 20;
+c1	d	a	b
+1	20	private	evenmoreprivate
+2	20	private	evenmoreprivate
+8	20	private	evenmoreprivate
+9	20	private	evenmoreprivate
+10	20	private	evenmoreprivate
+select * from innodb_compressed3 where d = 30;
+c1	d	a	b
+3	30	private	evenmoreprivate
+4	30	private	evenmoreprivate
+5	30	private	evenmoreprivate
+6	30	private	evenmoreprivate
+7	30	private	evenmoreprivate
+select * from innodb_compressed4 where d = 20;
+c1	d	a	b
+1	20	private	evenmoreprivate
+2	20	private	evenmoreprivate
+8	20	private	evenmoreprivate
+9	20	private	evenmoreprivate
+10	20	private	evenmoreprivate
+select * from innodb_compressed4 where d = 30;
+c1	d	a	b
+3	30	private	evenmoreprivate
+4	30	private	evenmoreprivate
+5	30	private	evenmoreprivate
+6	30	private	evenmoreprivate
+7	30	private	evenmoreprivate
+update innodb_compressed1 set d = d + 10 where d = 30;
+update innodb_compressed2 set d = d + 10 where d = 30;
+update innodb_compressed3 set d = d + 10 where d = 30;
+update innodb_compressed4 set d = d + 10 where d = 30;
+insert into innodb_compressed1 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed2 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed3 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed4 values (20, 60, 'newprivate', 'newevenmoreprivate');
+# t1 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed1.ibd
+# t2 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed2.ibd
+# t3 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed3.ibd
+# t4 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed4.ibd
+select * from innodb_compressed1 where d = 40;
+c1	d	a	b
+3	40	private	evenmoreprivate
+4	40	private	evenmoreprivate
+5	40	private	evenmoreprivate
+6	40	private	evenmoreprivate
+7	40	private	evenmoreprivate
+select * from innodb_compressed1 where d = 60;
+c1	d	a	b
+20	60	newprivate	newevenmoreprivate
+select * from innodb_compressed2 where d = 40;
+c1	d	a	b
+3	40	private	evenmoreprivate
+4	40	private	evenmoreprivate
+5	40	private	evenmoreprivate
+6	40	private	evenmoreprivate
+7	40	private	evenmoreprivate
+select * from innodb_compressed2 where d = 60;
+c1	d	a	b
+20	60	newprivate	newevenmoreprivate
+select * from innodb_compressed3 where d = 40;
+c1	d	a	b
+3	40	private	evenmoreprivate
+4	40	private	evenmoreprivate
+5	40	private	evenmoreprivate
+6	40	private	evenmoreprivate
+7	40	private	evenmoreprivate
+select * from innodb_compressed3 where d = 60;
+c1	d	a	b
+20	60	newprivate	newevenmoreprivate
+select * from innodb_compressed4 where d = 40;
+c1	d	a	b
+3	40	private	evenmoreprivate
+4	40	private	evenmoreprivate
+5	40	private	evenmoreprivate
+6	40	private	evenmoreprivate
+7	40	private	evenmoreprivate
+select * from innodb_compressed4 where d = 60;
+c1	d	a	b
+20	60	newprivate	newevenmoreprivate
+# t1 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed1.ibd
+# t2 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed2.ibd
+# t3 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed3.ibd
+# t4 yes on expecting NOT FOUND
+NOT FOUND /private/ in innodb_compressed4.ibd
+drop table innodb_compressed1;
+drop table innodb_compressed2;
+drop table innodb_compressed3;
+drop table innodb_compressed4;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_tables.result b/mysql-test/suite/encryption/r/innodb_encryption_tables.result
index 640e2be..da62c0a 100644
--- a/mysql-test/suite/encryption/r/innodb_encryption_tables.result
+++ b/mysql-test/suite/encryption/r/innodb_encryption_tables.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
 create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact;
@@ -104,6 +106,8 @@ SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_
 variable_value >= 0
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 update innodb_normal set c1 = c1 + 1;
 update innodb_compact set c1 = c1 + 1;
@@ -159,3 +163,5 @@ drop table innodb_compact;
 drop table innodb_dynamic;
 drop table innodb_compressed;
 drop table innodb_redundant;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
index f5dba15..69ab0d0 100644
--- a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
+++ b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes;
 CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB;
@@ -174,3 +176,5 @@ NOT FOUND /mangled/ in t6.ibd
 NOT FOUND /mysql/ in t7.ibd
 DROP PROCEDURE innodb_insert_proc;
 DROP TABLE t1, t2, t3, t4, t5, t6, t7;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result b/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result
index 43fb736..22038c0 100644
--- a/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result
+++ b/mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result
@@ -1,5 +1,7 @@
 # Restart mysqld --loose-file-key-management-filename=keys2.txt
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
 show warnings;
@@ -105,6 +107,8 @@ SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_
 variable_value >= 0
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 alter table innodb_compact engine=innodb encryption_key_id = 2;
 alter table innodb_compressed engine=innodb encryption_key_id = 3;
@@ -151,3 +155,5 @@ drop table innodb_compact;
 drop table innodb_compressed;
 drop table innodb_dynamic;
 drop table innodb_redundant;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
index 9180fb1..9fd6ac3 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
@@ -22,6 +22,8 @@ call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal
 call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
 call mtr.add_suppression("mysqld: File .*");
 call mtr.add_suppression("InnoDB: Tablespace id .* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace.");
+call mtr.add_suppression("InnoDB: InnoDB: Page may be an index page where index id is .*");
+
 --echo
 --echo # Start server with keys2.txt
 -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change3.test b/mysql-test/suite/encryption/t/innodb-bad-key-change3.test
index 20d63b1..d0480a6 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change3.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change3.test
@@ -8,7 +8,9 @@
 #
 # MDEV-8772: Assertion failure in file ha_innodb.cc line 20027 when importing page compressed and encrypted tablespace using incorrect keys
 #
-call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded");
+
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
 
 --disable_query_log
 let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
diff --git a/mysql-test/suite/encryption/t/innodb-discard-import.test b/mysql-test/suite/encryption/t/innodb-discard-import.test
index 6d9f6c5..3bcb8d3 100644
--- a/mysql-test/suite/encryption/t/innodb-discard-import.test
+++ b/mysql-test/suite/encryption/t/innodb-discard-import.test
@@ -10,7 +10,8 @@
 # MDEV-8770: Incorrect error message when importing page compressed tablespace
 #
 
-call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded");
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
 
 --disable_query_log
 let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.test b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
index 42d8008..e8e2ba0 100644
--- a/mysql-test/suite/encryption/t/innodb-encryption-disable.test
+++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
@@ -30,12 +30,14 @@ call mtr.add_suppression("InnoDB: Tablespace id.* is encrypted but encryption se
 --shutdown_server
 --source include/wait_until_disconnected.inc
 
---write_file $MYSQLTEST_VARDIR/keys1.txt
+--error 0,1,2
+--remove_file $MYSQLTEST_VARDIR/encryption-disable-keys1.txt
+--write_file $MYSQLTEST_VARDIR/encryption-disable-keys1.txt
 1;770A8A65DA156D24EE2A093277530142
 4;770A8A65DA156D24EE2A093277530143
 EOF
 
---exec echo "restart:--innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--exec echo "restart:--innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/encryption-disable-keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --enable_reconnect
 --source include/wait_until_connected_again.inc
 
@@ -58,8 +60,15 @@ CREATE TABLE `t1` (
 ) ENGINE=InnoDB;
 
 insert into t1 values (1,2,'maria','db','encryption');
+
+select * from t1;
+select * from t5;
+
 alter table t1 encrypted='yes' `encryption_key_id`=1;
 
+select * from t1;
+select * from t5;
+
 --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --shutdown_server
 --source include/wait_until_disconnected.inc
@@ -77,7 +86,7 @@ select * from t5;
 --shutdown_server
 --source include/wait_until_disconnected.inc
 
---exec echo "restart:--innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--exec echo "restart:--innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/encryption-disable-keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --enable_reconnect
 --source include/wait_until_connected_again.inc
 
@@ -89,4 +98,4 @@ EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
 EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
 --enable_query_log
 
---remove_file $MYSQLTEST_VARDIR/keys1.txt
+--remove_file $MYSQLTEST_VARDIR/encryption-disable-keys1.txt
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
index def3665..0361fdd 100644
--- a/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
+++ b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
@@ -4,7 +4,8 @@
 -- source include/not_embedded.inc
 -- source include/not_windows.inc
 
-call mtr.add_suppression("InnoDB: Table .* tablespace is set as discarded.");
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
 
 --let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
 --let $MYSQLD_DATADIR = `SELECT @@datadir`
@@ -107,6 +108,7 @@ ALTER TABLE t3 DISCARD TABLESPACE;
 
 --echo # List after t1 DISCARD
 --list_files $MYSQLD_DATADIR/test
+--disable_result_log
 --error 0,1,2
 --remove_file $MYSQLD_DATADIR/test/t1.cfg
 --error 0,1,2
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.opt b/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.opt
new file mode 100644
index 0000000..7ebf81a
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.opt
@@ -0,0 +1,4 @@
+--innodb-encrypt-tables=ON
+--innodb-encryption-rotate-key-age=15
+--innodb-encryption-threads=4
+--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.test b/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.test
new file mode 100644
index 0000000..0a28c16
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_row_compressed.test
@@ -0,0 +1,125 @@
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+-- source include/not_embedded.inc
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+create table innodb_compressed1(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed encrypted=yes;
+create table innodb_compressed2(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=1 encrypted=yes;
+create table innodb_compressed3(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=2 encrypted=yes;
+create table innodb_compressed4(c1 bigint not null primary key, d int, a varchar(20), b char(200)) engine=innodb row_format=compressed key_block_size=4 encrypted=yes;
+
+insert into innodb_compressed1 values (1, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (2, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (3, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (4, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (5, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (6, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (7, 30, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (8, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (9, 20, 'private', 'evenmoreprivate');
+insert into innodb_compressed1 values (10, 20, 'private', 'evenmoreprivate');
+
+insert into innodb_compressed2 select * from innodb_compressed1;
+insert into innodb_compressed3 select * from innodb_compressed1;
+insert into innodb_compressed4 select * from innodb_compressed1;
+
+--source include/restart_mysqld.inc
+
+--let $MYSQLD_DATADIR=`select @@datadir`
+--let t1_IBD = $MYSQLD_DATADIR/test/innodb_compressed1.ibd
+--let t2_IBD = $MYSQLD_DATADIR/test/innodb_compressed2.ibd
+--let t3_IBD = $MYSQLD_DATADIR/test/innodb_compressed3.ibd
+--let t4_IBD = $MYSQLD_DATADIR/test/innodb_compressed4.ibd
+--let SEARCH_RANGE = 10000000
+--let SEARCH_PATTERN=private
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t2 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t3 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t4 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+select * from innodb_compressed1 where d = 20;
+select * from innodb_compressed1 where d = 30;
+select * from innodb_compressed2 where d = 20;
+select * from innodb_compressed2 where d = 30;
+select * from innodb_compressed3 where d = 20;
+select * from innodb_compressed3 where d = 30;
+select * from innodb_compressed4 where d = 20;
+select * from innodb_compressed4 where d = 30;
+
+update innodb_compressed1 set d = d + 10 where d = 30;
+update innodb_compressed2 set d = d + 10 where d = 30;
+update innodb_compressed3 set d = d + 10 where d = 30;
+update innodb_compressed4 set d = d + 10 where d = 30;
+
+insert into innodb_compressed1 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed2 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed3 values (20, 60, 'newprivate', 'newevenmoreprivate');
+insert into innodb_compressed4 values (20, 60, 'newprivate', 'newevenmoreprivate');
+
+--let SEARCH_PATTERN=private
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t2 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t3 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t4 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+
+--source include/restart_mysqld.inc
+
+select * from innodb_compressed1 where d = 40;
+select * from innodb_compressed1 where d = 60;
+select * from innodb_compressed2 where d = 40;
+select * from innodb_compressed2 where d = 60;
+select * from innodb_compressed3 where d = 40;
+select * from innodb_compressed3 where d = 60;
+select * from innodb_compressed4 where d = 40;
+select * from innodb_compressed4 where d = 60;
+
+--let SEARCH_PATTERN=private
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t2 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t3 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--echo # t4 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+
+drop table innodb_compressed1;
+drop table innodb_compressed2;
+drop table innodb_compressed3;
+drop table innodb_compressed4;
+
+# reset system
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log
diff --git a/mysql-test/suite/handler/disabled.def b/mysql-test/suite/handler/disabled.def
new file mode 100644
index 0000000..ef63577
--- /dev/null
+++ b/mysql-test/suite/handler/disabled.def
@@ -0,0 +1,13 @@
+##############################################################################
+#
+#  List the test cases that are to be disabled temporarily.
+#
+#  Separate the test case name and the comment with ':'.
+#
+#    <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+#  Do not use any TAB characters for whitespace.
+#
+##############################################################################
+
+innodb : MDEV-10549
\ No newline at end of file
diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def
index 8cae44a..274e3c2 100644
--- a/mysql-test/suite/innodb/disabled.def
+++ b/mysql-test/suite/innodb/disabled.def
@@ -10,3 +10,9 @@
 #
 ##############################################################################
 
+innodb.auto_increment_dup : MDEV-10548
+group_commit_binlog_pos : MDEV-10156
+group_commit_binlog_pos_no_optimize_thread : MDEV-10156
+innodb_skip_innodb_is_tables : MDEV-10200
+innodb.innodb_bug13510739: MDEV-10549
+innodb.defrag_mdl-9155 : MDEV-10551
diff --git a/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc b/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc
index bc64937..75cab77 100644
--- a/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc
+++ b/mysql-test/suite/innodb/include/innodb_simulate_comp_failures.inc
@@ -23,6 +23,8 @@ call mtr.add_suppression(".*");
 # create the table with compressed pages of size 8K.
 CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(msg)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
 
+SHOW CREATE TABLE t1;
+
 # percentage of compressions that will be forced to fail
 SET GLOBAL innodb_simulate_comp_failures = 25;
 
@@ -35,16 +37,16 @@ let $commit_iterations=50;
 while ($num_inserts_ind)
 {
   let $repeat = `select floor(rand() * 10)`;
-  eval
-INSERT INTO t1(id, msg)
-VALUES ($num_inserts_ind, REPEAT('abcdefghijklmnopqrstuvwxyz', $repeat));
+  eval INSERT INTO t1(id, msg)
+       VALUES ($num_inserts_ind, REPEAT('abcdefghijklmnopqrstuvwxyz', $repeat));
   dec $num_inserts_ind;
 }
 
 --enable_query_log
 --enable_result_log
 
-SELECT COUNT(*) FROM t1;
+COMMIT;
+SELECT COUNT(id) FROM t1;
 
 --disable_query_log
 --disable_result_log
diff --git a/mysql-test/suite/innodb/r/group_commit_crash.result b/mysql-test/suite/innodb/r/group_commit_crash.result
index 5d5dffa..80a780b 100644
--- a/mysql-test/suite/innodb/r/group_commit_crash.result
+++ b/mysql-test/suite/innodb/r/group_commit_crash.result
@@ -124,3 +124,5 @@ delete from t1;
 DROP TABLE t1;
 DROP TABLE t2;
 DROP PROCEDURE setcrash;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result
index 542ce9d..06fdeae 100644
--- a/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result
+++ b/mysql-test/suite/innodb/r/group_commit_crash_no_optimize_thread.result
@@ -124,3 +124,5 @@ delete from t1;
 DROP TABLE t1;
 DROP TABLE t2;
 DROP PROCEDURE setcrash;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/help_url.result b/mysql-test/suite/innodb/r/help_url.result
index 10affe7..87530bc 100644
--- a/mysql-test/suite/innodb/r/help_url.result
+++ b/mysql-test/suite/innodb/r/help_url.result
@@ -1,4 +1,2 @@
 create table innodb_table_monitor (a int) engine=InnoDB;
-Warnings:
-Warning	131	Using the table name innodb_table_monitor to enable diagnostic output is deprecated and may be removed in future releases. Use INFORMATION_SCHEMA or PERFORMANCE_SCHEMA tables or SET GLOBAL innodb_status_output=ON.
 drop table innodb_table_monitor;
diff --git a/mysql-test/suite/innodb/r/innodb-16k.result b/mysql-test/suite/innodb/r/innodb-16k.result
index 0537315..adfbc97 100644
--- a/mysql-test/suite/innodb/r/innodb-16k.result
+++ b/mysql-test/suite/innodb/r/innodb-16k.result
@@ -1,5 +1,11 @@
+call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_large_prefix = OFF;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 # Test 1) Show the page size from Information Schema
 SELECT variable_value FROM information_schema.global_status
 WHERE LOWER(variable_name) = 'innodb_page_size';
@@ -224,6 +230,8 @@ table_name	row_format	create_options
 t1	Compressed	row_format=COMPRESSED
 DROP TABLE t1;
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 CREATE TABLE t2(d varchar(17) PRIMARY KEY) ENGINE=innodb DEFAULT CHARSET=utf8;
 CREATE TABLE t3(a int PRIMARY KEY) ENGINE=innodb;
 INSERT INTO t3 VALUES (22),(44),(33),(55),(66);
@@ -368,11 +376,6 @@ UPDATE t1 SET s=@e;
 CREATE INDEX t1t ON t1 (t(767));
 UPDATE t1 SET t=@e;
 ERROR HY000: Undo log record is too big.
-CREATE INDEX t1u ON t1 (u(767));
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
-CREATE INDEX t1ut ON t1 (u(767), t(767));
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
-CREATE INDEX t1st ON t1 (s(767), t(767));
 SHOW CREATE TABLE t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
@@ -416,11 +419,12 @@ t1	CREATE TABLE `t1` (
   KEY `t1q` (`q`(767)),
   KEY `t1r` (`r`(767)),
   KEY `t1s` (`s`(767)),
-  KEY `t1t` (`t`(767)),
-  KEY `t1st` (`s`(767),`t`(767))
+  KEY `t1t` (`t`(767))
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
 DROP TABLE t1;
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 Test an assertion failure on purge.
 CREATE TABLE t1_purge (
@@ -464,6 +468,8 @@ DELETE FROM t3_purge;
 DELETE FROM t4_purge;
 SET GLOBAL innodb_file_per_table=on;
 SET GLOBAL innodb_file_format='Barracuda';
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET @r=REPEAT('a',500);
 CREATE TABLE tlong(a int,
 v1 varchar(500), v2 varchar(500), v3 varchar(500),
@@ -552,7 +558,7 @@ SHOW WARNINGS;
 Level	Code	Message
 Error	1713	Undo log record is too big.
 DROP TABLE bug12547647;
-SET SESSION innodb_strict_mode = off;
+SET SESSION innodb_strict_mode = on;
 CREATE TABLE t1(
 c text NOT NULL, d text NOT NULL,
 PRIMARY KEY (c(767),d(767)))
@@ -977,3 +983,7 @@ COL196 TEXT,
 COL197 TEXT)
 row_format=compact,ENGINE=INNODB;
 ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb-alter-discard.result b/mysql-test/suite/innodb/r/innodb-alter-discard.result
index 2971286..bd60d2d 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-discard.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-discard.result
@@ -1,5 +1,11 @@
 SET GLOBAL innodb_file_per_table=1;
 CREATE TABLE t(a INT)ENGINE=InnoDB;
+call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
+call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified.");
+call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.");
+call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: './test/t.ibd' OS error: .*");
+call mtr.add_suppression("InnoDB: Ignoring tablespace `test/t` because it could not be opened.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .*");
 call mtr.add_suppression("InnoDB: Error: trying to open a table, but could not$");
 call mtr.add_suppression("MySQL is trying to open a table handle but the \.ibd file for$");
 call mtr.add_suppression("InnoDB: Table 'test/t'$");
@@ -17,5 +23,5 @@ ERROR 42S02: Table 'test.t1' doesn't exist
 ALTER TABLE t DISCARD TABLESPACE;
 Warnings:
 Warning	1812	Tablespace is missing for table 'test/t'
-Warning	1812	Tablespace is missing for table 't'
+Warning	1812	Tablespace is missing for table 'test/t'
 DROP TABLE t;
diff --git a/mysql-test/suite/innodb/r/innodb-blob.result b/mysql-test/suite/innodb/r/innodb-blob.result
index ec5a4a8..fe4b190 100644
--- a/mysql-test/suite/innodb/r/innodb-blob.result
+++ b/mysql-test/suite/innodb/r/innodb-blob.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles!");
 CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
 CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
 CREATE TABLE t3 (a INT PRIMARY KEY, b TEXT, c TEXT) ENGINE=InnoDB;
@@ -18,7 +19,9 @@ a	RIGHT(b,20)
 1	aaaaaaaaaaaaaaaaaaaa
 2	bbbbbbbbbbbbbbbbbbbb
 connection default;
-SET DEBUG_DBUG='+d,row_ins_extern_checkpoint';
+SET DEBUG='+d,row_ins_extern_checkpoint';
+Warnings:
+Warning	1287	'@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
 SET DEBUG_SYNC='before_row_ins_extern_latch SIGNAL rec_not_blob WAIT_FOR crash';
 ROLLBACK;
 BEGIN;
@@ -38,7 +41,9 @@ a
 1
 2
 3
-SET DEBUG_DBUG='+d,crash_commit_before';
+SET DEBUG='+d,crash_commit_before';
+Warnings:
+Warning	1287	'@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
 INSERT INTO t2 VALUES (42);
 ERROR HY000: Lost connection to MySQL server during query
 disconnect con1;
@@ -51,18 +56,25 @@ test.t1	check	status	OK
 INSERT INTO t3 VALUES
 (1,REPEAT('d',7000),REPEAT('e',100)),
 (2,REPEAT('g',7000),REPEAT('h',100));
-SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR go';
+SET DEBUG_SYNC='blob_write_middle SIGNAL go_sel WAIT_FOR go_upd';
 UPDATE t3 SET c=REPEAT('f',3000) WHERE a=1;
+# Connection con1:
 connect  con1,localhost,root,,;
-SET DEBUG_SYNC='now WAIT_FOR have_latch';
+SET DEBUG_SYNC='now WAIT_FOR go_sel';
 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
 SELECT @@tx_isolation;
 @@tx_isolation
 READ-UNCOMMITTED
 SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3;
-connect  con2,localhost,root,,;
-SET DEBUG_SYNC='now SIGNAL go';
+a	RIGHT(b,20)	RIGHT(c,20)
+2	gggggggggggggggggggg	hhhhhhhhhhhhhhhhhhhh
+set debug_sync='now SIGNAL go_upd';
+# Connection default:
+connection default;
+# reap UPDATE t3 SET c=REPEAT('f',3000) WHERE a=1;
+# Connection con1:
 connection con1;
+SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3;
 a	RIGHT(b,20)	RIGHT(c,20)
 1	dddddddddddddddddddd	ffffffffffffffffffff
 2	gggggggggggggggggggg	hhhhhhhhhhhhhhhhhhhh
@@ -73,11 +85,13 @@ Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 test.t2	check	status	OK
 test.t3	check	status	OK
-connection con2;
+connect  con2,localhost,root,,;
 BEGIN;
 INSERT INTO t2 VALUES (347);
 connection default;
-SET DEBUG_DBUG='+d,row_upd_extern_checkpoint';
+SET DEBUG='+d,row_upd_extern_checkpoint';
+Warnings:
+Warning	1287	'@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
 SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR crash';
 UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2;
 connection con2;
@@ -86,7 +100,9 @@ SELECT info FROM information_schema.processlist
 WHERE state = 'debug sync point: before_row_upd_extern';
 info
 UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2
-SET DEBUG_DBUG='+d,crash_commit_before';
+SET DEBUG='+d,crash_commit_before';
+Warnings:
+Warning	1287	'@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
 COMMIT;
 ERROR HY000: Lost connection to MySQL server during query
 disconnect con2;
@@ -109,7 +125,9 @@ connect  con2,localhost,root,,;
 BEGIN;
 INSERT INTO t2 VALUES (33101);
 connection default;
-SET DEBUG_DBUG='+d,row_upd_extern_checkpoint';
+SET DEBUG='+d,row_upd_extern_checkpoint';
+Warnings:
+Warning	1287	'@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
 SET DEBUG_SYNC='after_row_upd_extern SIGNAL have_latch WAIT_FOR crash';
 UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2;
 connection con2;
@@ -118,7 +136,9 @@ SELECT info FROM information_schema.processlist
 WHERE state = 'debug sync point: after_row_upd_extern';
 info
 UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2
-SET DEBUG_DBUG='+d,crash_commit_before';
+SET DEBUG='+d,crash_commit_before';
+Warnings:
+Warning	1287	'@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
 COMMIT;
 ERROR HY000: Lost connection to MySQL server during query
 disconnect con2;
diff --git a/mysql-test/suite/innodb/r/innodb-bug-14068765.result b/mysql-test/suite/innodb/r/innodb-bug-14068765.result
index 7a8f959..f6d37b2 100644
--- a/mysql-test/suite/innodb/r/innodb-bug-14068765.result
+++ b/mysql-test/suite/innodb/r/innodb-bug-14068765.result
@@ -38,5 +38,7 @@ COUNT(*)
 2
 DROP TABLE testdb_wl5522.t1;
 DROP DATABASE testdb_wl5522;
-SET GLOBAL INNODB_FILE_FORMAT=Antelope;
+SET GLOBAL INNODB_FILE_FORMAT=Barracuda;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL INNODB_FILE_PER_TABLE=1;
diff --git a/mysql-test/suite/innodb/r/innodb-bug-14084530.result b/mysql-test/suite/innodb/r/innodb-bug-14084530.result
index 4b4f201..3ba8e0e 100644
--- a/mysql-test/suite/innodb/r/innodb-bug-14084530.result
+++ b/mysql-test/suite/innodb/r/innodb-bug-14084530.result
@@ -27,5 +27,7 @@ c1
 SET AUTOCOMMIT = 1;
 DROP TABLE testdb_wl5522.t1;
 DROP DATABASE testdb_wl5522;
-SET GLOBAL INNODB_FILE_FORMAT=Antelope;
+SET GLOBAL INNODB_FILE_FORMAT=Barracuda;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL INNODB_FILE_PER_TABLE=1;
diff --git a/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
index 508d578..5abfb8c 100644
--- a/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
+++ b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
@@ -2,13 +2,13 @@
 # Bug#69122 - INNODB DOESN'T REDO-LOG INSERT BUFFER MERGE
 #             OPERATION IF IT IS DONE IN-PLACE
 #
-SET GLOBAL innodb_change_buffering_debug = 1;
 CREATE TABLE t1(
 a INT AUTO_INCREMENT PRIMARY KEY,
 b CHAR(1),
 c INT,
 INDEX(b))
-ENGINE=InnoDB;
+ENGINE=InnoDB STATS_PERSISTENT=0;
+SET GLOBAL innodb_change_buffering_debug = 1;
 INSERT INTO t1 VALUES(0,'x',1);
 INSERT INTO t1 SELECT 0,b,c FROM t1;
 INSERT INTO t1 SELECT 0,b,c FROM t1;
@@ -23,7 +23,6 @@ INSERT INTO t1 SELECT 0,b,c FROM t1;
 INSERT INTO t1 SELECT 0,b,c FROM t1;
 INSERT INTO t1 SELECT 0,b,c FROM t1;
 INSERT INTO t1 SELECT 0,b,c FROM t1;
-INSERT INTO t1 SELECT 0,b,c FROM t1;
 BEGIN;
 SELECT b FROM t1 LIMIT 3;
 b
@@ -35,7 +34,9 @@ connection con1;
 BEGIN;
 DELETE FROM t1 WHERE a=1;
 INSERT INTO t1 VALUES(1,'X',1);
-SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace';
+SET DEBUG='+d,crash_after_log_ibuf_upd_inplace';
+Warnings:
+Warning	1287	'@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
 SELECT b FROM t1 LIMIT 3;
 ERROR HY000: Lost connection to MySQL server during query
 FOUND /Wrote log record for ibuf update in place operation/ in my_restart.err
diff --git a/mysql-test/suite/innodb/r/innodb-fk-warnings.result b/mysql-test/suite/innodb/r/innodb-fk-warnings.result
index eddedfc..6c203cc 100644
--- a/mysql-test/suite/innodb/r/innodb-fk-warnings.result
+++ b/mysql-test/suite/innodb/r/innodb-fk-warnings.result
@@ -16,7 +16,7 @@ CONSTRAINT test FOREIGN KEY (b) REFERENCES t2 (id)
 ERROR HY000: Can't create table `test`.`t2` (errno: 121 "Duplicate key on write or update")
 show warnings;
 Level	Code	Message
-Warning	121	Create or Alter table `test`.`t2` with foreign key constraint failed. Foreign key constraint `test/test` already exists on data dictionary. Foreign key constraint names need to be unique in database. Error in foreign key definition: CONSTRAINT `test` FOREIGN KEY (`b`) REFERENCES `test`.`t2` (`id`).
+Warning	121	Create or Alter table `test`.`t2` with foreign key constraint failed. Foreign key constraint `test`.`test` already exists on data dictionary. Foreign key constraint names need to be unique in database. Error in foreign key definition: CONSTRAINT `test` FOREIGN KEY (`b`) REFERENCES `test`.`t2` (`id`).
 Error	1005	Can't create table `test`.`t2` (errno: 121 "Duplicate key on write or update")
 Warning	1022	Can't write; duplicate key in table 't2'
 drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index e6ee836..fa49027 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb/r/innodb-index.result
@@ -1,5 +1,7 @@
 set global innodb_file_per_table=on;
 set global innodb_file_format='Barracuda';
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS;
 create table t1(a varchar(2) primary key) engine=innodb;
 insert into t1 values('');
@@ -857,8 +859,12 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	2	Using index
 drop table t1;
 set global innodb_file_per_table=1;
-set global innodb_file_format=Antelope;
-set global innodb_file_format_max=Antelope;
+set global innodb_file_format=Barracuda;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
+set global innodb_file_format_max=Barracuda;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
 SET FOREIGN_KEY_CHECKS=0;
 CREATE TABLE t1(
@@ -1189,3 +1195,7 @@ t2c	CREATE TABLE `t2c` (
   KEY `t2a` (`a`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 DROP TABLE t1,t2,t2c,t2i;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb-mdev-7408.result b/mysql-test/suite/innodb/r/innodb-mdev-7408.result
index 8f6ad13..80b46d3 100644
--- a/mysql-test/suite/innodb/r/innodb-mdev-7408.result
+++ b/mysql-test/suite/innodb/r/innodb-mdev-7408.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("InnoDB: User stopword table .* does not exist.");
 select @@global.innodb_ft_server_stopword_table;
 @@global.innodb_ft_server_stopword_table
 NULL
diff --git a/mysql-test/suite/innodb/r/innodb-mdev-7513.result b/mysql-test/suite/innodb/r/innodb-mdev-7513.result
index bb3531e..55b4d34 100644
--- a/mysql-test/suite/innodb/r/innodb-mdev-7513.result
+++ b/mysql-test/suite/innodb/r/innodb-mdev-7513.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("InnoDB: Cannot add field `.* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
 call mtr.add_suppression("Row size too large (> 8126)*");
 CREATE TABLE t1 ( text1 TEXT,
 text2 TEXT,
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
index 8d3bc06..a566c94 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
@@ -1,4 +1,6 @@
 set global innodb_file_format = `barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_per_table = on;
 set global innodb_compression_algorithm = 5;
 create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
@@ -435,3 +437,5 @@ drop table innodb_page_compressed6;
 drop table innodb_page_compressed7;
 drop table innodb_page_compressed8;
 drop table innodb_page_compressed9;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result
index eeab262..76cd5b1 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result
@@ -1,4 +1,6 @@
 set global innodb_file_format = `barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_per_table = on;
 set global innodb_compression_algorithm = 2;
 create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
@@ -436,3 +438,5 @@ drop table innodb_page_compressed6;
 drop table innodb_page_compressed7;
 drop table innodb_page_compressed8;
 drop table innodb_page_compressed9;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
index d340801..cceff82 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
@@ -1,4 +1,6 @@
 set global innodb_file_format = `barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_per_table = on;
 set global innodb_compression_algorithm = 4;
 create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
@@ -435,3 +437,5 @@ drop table innodb_page_compressed6;
 drop table innodb_page_compressed7;
 drop table innodb_page_compressed8;
 drop table innodb_page_compressed9;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result
index fdbc99f..1a9235f 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result
@@ -1,4 +1,6 @@
 set global innodb_file_format = `barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_per_table = on;
 set global innodb_compression_algorithm = 3;
 create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
@@ -349,3 +351,5 @@ drop table innodb_page_compressed6;
 drop table innodb_page_compressed7;
 drop table innodb_page_compressed8;
 drop table innodb_page_compressed9;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result
index a0b2f94..e1d46b0 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result
@@ -1,5 +1,7 @@
 call mtr.add_suppression("Compression failed for space*");
 set global innodb_file_format = `barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_per_table = on;
 set global innodb_compression_algorithm = 6;
 create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
@@ -436,3 +438,5 @@ drop table innodb_page_compressed6;
 drop table innodb_page_compressed7;
 drop table innodb_page_compressed8;
 drop table innodb_page_compressed9;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_tables.result b/mysql-test/suite/innodb/r/innodb-page_compression_tables.result
index 98de5db..a0ac898 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_tables.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_tables.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 set global innodb_compression_algorithm = 1;
 create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
@@ -91,6 +93,8 @@ select count(*) from innodb_dynamic where c1 < 1500000;
 count(*)
 5000
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 set global innodb_compression_algorithm = 0;
 alter table innodb_compact engine=innodb page_compressed=DEFAULT;
@@ -119,3 +123,5 @@ drop procedure innodb_insert_proc;
 drop table innodb_normal;
 drop table innodb_compact;
 drop table innodb_dynamic;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result
index 4c3ab27..a8078c0 100644
--- a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 set global innodb_compression_algorithm = 1;
 create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
@@ -349,3 +351,5 @@ drop table innodb_page_compressed6;
 drop table innodb_page_compressed7;
 drop table innodb_page_compressed8;
 drop table innodb_page_compressed9;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result
index e613f76..9837f56 100644
--- a/mysql-test/suite/innodb/r/innodb-virtual-columns.result
+++ b/mysql-test/suite/innodb/r/innodb-virtual-columns.result
@@ -23,6 +23,22 @@ deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginn
 deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term', 
 CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE grad_degree;
+Table	Create Table
+grad_degree	CREATE TABLE `grad_degree` (
+  `student_id` int(8) unsigned NOT NULL,
+  `plan` varchar(10) NOT NULL,
+  `admit_term` char(4) NOT NULL,
+  `wdraw_rsn` varchar(4) NOT NULL DEFAULT '',
+  `ofis_deg_status` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
+      ELSE 'Not Completed'
+    END) VIRTUAL,
+  `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
+  `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term',
+  PRIMARY KEY (`student_id`,`plan`,`admit_term`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
 CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
 CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term);
 INSERT IGNORE grad_degree (
@@ -117,6 +133,57 @@ deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginn
 deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term', 
 CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE grad_degree;
+Table	Create Table
+grad_degree	CREATE TABLE `grad_degree` (
+  `student_id` int(8) unsigned NOT NULL,
+  `plan` varchar(10) NOT NULL,
+  `admit_term` char(4) NOT NULL,
+  `wdraw_rsn` varchar(4) NOT NULL DEFAULT '',
+  `ofis_deg_status` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
+      ELSE 'Not Completed'
+    END) VIRTUAL,
+  `ofis_deg_status2` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress2'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2'
+      ELSE 'Not Completed2'
+    END) VIRTUAL,
+  `ofis_deg_status3` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress3'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3'
+      ELSE 'Not Completed3'
+    END) VIRTUAL,
+  `ofis_deg_status4` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress4'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4'
+      ELSE 'Not Completed4'
+    END) VIRTUAL,
+  `ofis_deg_status5` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress5'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5'
+      ELSE 'Not Completed5'
+    END) VIRTUAL,
+  `ofis_deg_status6` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress6'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6'
+      ELSE 'Not Completed6'
+    END) VIRTUAL,
+  `ofis_deg_status7` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress7'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7'
+      ELSE 'Not Completed7'
+    END) VIRTUAL,
+  `ofis_deg_status8` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress8'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8'
+      ELSE 'Not Completed8'
+    END) VIRTUAL,
+  `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
+  `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term',
+  PRIMARY KEY (`student_id`,`plan`,`admit_term`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
 CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
 CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term);
 INSERT IGNORE grad_degree (
@@ -264,6 +331,57 @@ deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginn
 deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term', 
 CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+SHOW CREATE TABLE grad_degree;
+Table	Create Table
+grad_degree	CREATE TABLE `grad_degree` (
+  `student_id` int(8) unsigned NOT NULL,
+  `plan` varchar(10) NOT NULL,
+  `admit_term` char(4) NOT NULL,
+  `wdraw_rsn` varchar(4) NOT NULL DEFAULT '',
+  `ofis_deg_status` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
+      ELSE 'Not Completed'
+    END) VIRTUAL,
+  `ofis_deg_status2` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress2'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2'
+      ELSE 'Not Completed2'
+    END) VIRTUAL,
+  `ofis_deg_status3` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress3'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3'
+      ELSE 'Not Completed3'
+    END) VIRTUAL,
+  `ofis_deg_status4` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress4'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4'
+      ELSE 'Not Completed4'
+    END) VIRTUAL,
+  `ofis_deg_status5` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress5'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5'
+      ELSE 'Not Completed5'
+    END) VIRTUAL,
+  `ofis_deg_status6` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress6'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6'
+      ELSE 'Not Completed6'
+    END) VIRTUAL,
+  `ofis_deg_status7` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress7'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7'
+      ELSE 'Not Completed7'
+    END) VIRTUAL,
+  `ofis_deg_status8` varchar(15) AS (CASE
+WHEN wdraw_rsn = '' THEN 'In progress8'
+      WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8'
+      ELSE 'Not Completed8'
+    END) VIRTUAL,
+  `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
+  `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term',
+  PRIMARY KEY (`student_id`,`plan`,`admit_term`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
 CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
 ALTER TABLE grad_degree DROP COLUMN ofis_deg_status2, DROP COLUMN ofis_deg_status3,
 DROP COLUMN ofis_deg_status4, DROP COLUMN ofis_deg_status5, DROP COLUMN ofis_deg_status6,
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-1.result b/mysql-test/suite/innodb/r/innodb-wl5522-1.result
index 0608408..ec28ead 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-1.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-1.result
@@ -1,9 +1,12 @@
+call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists.  Please DISCARD the tablespace before IMPORT.");
 DROP TABLE IF EXISTS t1;
 SET GLOBAL innodb_file_per_table = 1;
 SELECT @@innodb_file_per_table;
 @@innodb_file_per_table
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@innodb_file_format;
 @@innodb_file_format
 Barracuda
@@ -126,6 +129,8 @@ COUNT(*)
 2
 DROP TABLE testdb_wl5522.t1;
 SET GLOBAL innodb_file_format='Barracuda';
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 CREATE TABLE testdb_wl5522.t1 (
 col_1_varbinary VARBINARY (4000) ,
 col_2_varchar VARCHAR (4000),
@@ -410,7 +415,7 @@ ALTER TABLE testdb_wl5522.t1 DISCARD TABLESPACE;
 restore: t1 .ibd and .cfg files
 ALTER TABLE testdb_wl5522.t1 IMPORT TABLESPACE;
 ALTER TABLE testdb_wl5522.t1 IMPORT TABLESPACE;
-ERROR HY000: Tablespace for table 't1' exists. Please DISCARD the tablespace before IMPORT.
+ERROR HY000: Tablespace for table 'testdb_wl5522/t1' exists. Please DISCARD the tablespace before IMPORT.
 SELECT * FROM testdb_wl5522.t1 ORDER BY i;
 i
 100
@@ -807,5 +812,7 @@ DROP DATABASE testdb_wl5522;
 call mtr.add_suppression("Got error -1 when reading table '.*'");
 call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
 call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
-SET GLOBAL INNODB_FILE_FORMAT=Antelope;
+SET GLOBAL INNODB_FILE_FORMAT=Barracuda;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL INNODB_FILE_PER_TABLE=1;
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result
index 0e863f5..e01a773 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result
@@ -1,8 +1,13 @@
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
+call mtr.add_suppression("InnoDB: Error: Tablespace flags .* corrupted unused .*");
 SET GLOBAL innodb_file_per_table = 1;
 SELECT @@innodb_file_per_table;
 @@innodb_file_per_table
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@innodb_file_format;
 @@innodb_file_format
 Barracuda
@@ -49,6 +54,8 @@ SELECT @@innodb_file_per_table;
 @@innodb_file_per_table
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@innodb_file_format;
 @@innodb_file_format
 Barracuda
@@ -86,7 +93,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
 restore: t1 .ibd and .cfg files
 SET SESSION debug_dbug="+d,ib_import_internal_error";
 ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
-ERROR HY000: Internal error: While updating the <space, root page number> of index "GEN_CLUST_INDEX" - Generic error
+ERROR HY000: Internal error: While updating the <space, root page number> of index GEN_CLUST_INDEX - Generic error
 SET SESSION debug_dbug="-d,ib_import_internal_error";
 restore: t1 .ibd and .cfg files
 ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
@@ -99,7 +106,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
 restore: t1 .ibd and .cfg files
 SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure";
 ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
-ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Too many concurrent transactions
+ERROR HY000: Internal error: Cannot reset LSNs in table "test_wl5522"."t1" : Too many concurrent transactions
 restore: t1 .ibd and .cfg files
 SET SESSION debug_dbug="-d,ib_import_reset_space_and_lsn_failure";
 SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
@@ -442,7 +449,7 @@ t1	CREATE TABLE `t1` (
   KEY `idx1` (`c2`),
   KEY `idx2` (`c3`(512)),
   KEY `idx3` (`c4`(512))
-) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8
+) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8
 DROP TABLE test_wl5522.t1;
 CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
@@ -473,7 +480,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
 restore: t1 .ibd and .cfg files
 SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1";
 ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
-ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
+ERROR HY000: Internal error: Cannot reset LSNs in table "test_wl5522"."t1" : Data structure corruption
 SET SESSION debug_dbug="-d,ib_import_trigger_corruption_1";
 DROP TABLE test_wl5522.t1;
 unlink: t1.ibd
@@ -498,7 +505,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
 restore: t1 .ibd and .cfg files
 SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2";
 ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
-ERROR HY000: Index corrupt: Externally stored column(5) has a reference length of 19 in the cluster index "GEN_CLUST_INDEX"
+ERROR HY000: Index corrupt: Externally stored column(5) has a reference length of 19 in the cluster index GEN_CLUST_INDEX
 SET SESSION debug_dbug="-d,ib_import_trigger_corruption_2";
 DROP TABLE test_wl5522.t1;
 unlink: t1.ibd
@@ -563,7 +570,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
 restore: t1 .ibd and .cfg files
 SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
 ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
-ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Unsupported
+ERROR HY000: Internal error: Cannot reset LSNs in table "test_wl5522"."t1" : Unsupported
 SET SESSION debug_dbug="-d,fsp_flags_is_valid_failure";
 DROP TABLE test_wl5522.t1;
 unlink: t1.ibd
@@ -575,6 +582,12 @@ 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;
+Warnings:
+Error	145	Table './mtr/test_suppressions' is marked as crashed and should be repaired
+Error	1194	Table 'test_suppressions' is marked as crashed and should be repaired
+Error	1034	1 client is using or hasn't closed the table properly
 SET GLOBAL INNODB_FILE_PER_TABLE=1;
-SET GLOBAL INNODB_FILE_FORMAT=Antelope;
+SET GLOBAL INNODB_FILE_FORMAT=Barracuda;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET SESSION innodb_strict_mode=0;
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-zip.result b/mysql-test/suite/innodb/r/innodb-wl5522-zip.result
index 47413b1..67e5976 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-zip.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-zip.result
@@ -1,9 +1,12 @@
+call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists.  Please DISCARD the tablespace before IMPORT.");
 DROP TABLE IF EXISTS t1;
 SET GLOBAL innodb_file_per_table = 1;
 SELECT @@innodb_file_per_table;
 @@innodb_file_per_table
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@innodb_file_format;
 @@innodb_file_format
 Barracuda
@@ -74,9 +77,6 @@ ALTER TABLE t1 DISCARD TABLESPACE;
 t1.frm
 ALTER TABLE t1 IMPORT TABLESPACE;
 ALTER TABLE t1 ENGINE InnoDB;
-Warnings:
-Warning	1478	InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
-Warning	1478	InnoDB: assuming ROW_FORMAT=COMPACT.
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 640
@@ -112,6 +112,8 @@ SELECT @@innodb_file_per_table;
 @@innodb_file_per_table
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@innodb_file_format;
 @@innodb_file_format
 Barracuda
@@ -124,7 +126,7 @@ c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
 c2 INT) ENGINE=InnoDB  ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
 INSERT INTO t1(c2) VALUES(1);
 ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Tablespace for table 't1' exists. Please DISCARD the tablespace before IMPORT.
+ERROR HY000: Tablespace for table 'test/t1' exists. Please DISCARD the tablespace before IMPORT.
 SELECT * FROM t1;
 c1	c2
 1	1
@@ -459,7 +461,7 @@ t1	CREATE TABLE `t1` (
   `c2` int(11) DEFAULT NULL,
   PRIMARY KEY (`c1`),
   KEY `idx` (`c2`)
-) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
+) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
 SELECT * FROM t1;
 c1	c2
 1	1
@@ -498,6 +500,8 @@ DROP TABLE t1;
 call mtr.add_suppression("Got error -1 when reading table '.*'");
 call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
 call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
-SET GLOBAL INNODB_FILE_FORMAT=Antelope;
+SET GLOBAL INNODB_FILE_FORMAT=Barracuda;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL INNODB_FILE_PER_TABLE=1;
 SET SESSION innodb_strict_mode=0;
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result
index fb4ac37..84a67ed 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522.result
@@ -1,9 +1,12 @@
+call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists.  Please DISCARD the tablespace before IMPORT.");
 DROP TABLE IF EXISTS t1;
 SET GLOBAL innodb_file_per_table = 1;
 SELECT @@innodb_file_per_table;
 @@innodb_file_per_table
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@innodb_file_format;
 @@innodb_file_format
 Barracuda
@@ -105,6 +108,8 @@ SELECT @@innodb_file_per_table;
 @@innodb_file_per_table
 1
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@innodb_file_format;
 @@innodb_file_format
 Barracuda
@@ -113,7 +118,7 @@ c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
 c2 INT) ENGINE=InnoDB;
 INSERT INTO t1(c2) VALUES(1);
 ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Tablespace for table 't1' exists. Please DISCARD the tablespace before IMPORT.
+ERROR HY000: Tablespace for table 'test/t1' exists. Please DISCARD the tablespace before IMPORT.
 SELECT * FROM t1;
 c1	c2
 1	1
@@ -426,7 +431,7 @@ t1	CREATE TABLE `t1` (
   `c2` int(11) DEFAULT NULL,
   PRIMARY KEY (`c1`),
   KEY `idx` (`c2`)
-) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1
+) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1
 SELECT * FROM t1;
 c1	c2
 1	1
@@ -536,7 +541,7 @@ t1	CREATE TABLE `t1` (
   `c2` int(11) DEFAULT NULL,
   PRIMARY KEY (`c1`),
   KEY `idx` (`c2`)
-) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
 SELECT * FROM t1;
 c1	c2
 1	1
@@ -612,7 +617,7 @@ t1	CREATE TABLE `t1` (
   `c2` int(11) DEFAULT NULL,
   PRIMARY KEY (`c1`),
   KEY `idx` (`c2`)
-) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
+) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
 SELECT * FROM t1;
 c1	c2
 1	1
@@ -722,7 +727,7 @@ t1	CREATE TABLE `t1` (
   `c2` int(11) DEFAULT NULL,
   PRIMARY KEY (`c1`),
   KEY `idx` (`c2`)
-) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
 SELECT * FROM t1;
 c1	c2
 1	1
@@ -801,7 +806,7 @@ t1	CREATE TABLE `t1` (
   `c2` int(11) DEFAULT NULL,
   PRIMARY KEY (`c1`),
   KEY `idx` (`c2`)
-) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
 SELECT * FROM t1;
 c1	c2
 1	1
@@ -911,7 +916,7 @@ t1	CREATE TABLE `t1` (
   `c2` int(11) DEFAULT NULL,
   PRIMARY KEY (`c1`),
   KEY `idx` (`c2`)
-) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
 SELECT * FROM t1;
 c1	c2
 1	1
@@ -990,7 +995,7 @@ t1	CREATE TABLE `t1` (
   `c2` int(11) DEFAULT NULL,
   PRIMARY KEY (`c1`),
   KEY `idx` (`c2`)
-) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
 SELECT * FROM t1;
 c1	c2
 1	1
@@ -1029,5 +1034,7 @@ DROP TABLE t1;
 call mtr.add_suppression("Got error -1 when reading table '.*'");
 call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
 call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
-SET GLOBAL INNODB_FILE_FORMAT=Antelope;
+SET GLOBAL INNODB_FILE_FORMAT=Barracuda;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL INNODB_FILE_PER_TABLE=1;
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index 4c890dd..d278fee 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -947,6 +947,7 @@ desc t1;
 Field	Type	Null	Key	Default	Extra
 t	int(11)	NO	MUL	1	
 drop table t1;
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
 CREATE TABLE t1 (
 number bigint(20) NOT NULL default '0',
 cname char(15) NOT NULL default '',
@@ -1009,6 +1010,7 @@ select * from t2;
 number	cname	carrier_id	privacy	last_mod_date	last_mod_id	last_app_date	last_app_id	version	assigned_scps	status
 333	tubs	99	2	2002-01-09 11:34:53	501	2002-01-09 11:34:53	500	3	10	0
 drop table t1,t2;
+SET sql_mode = default;
 create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
 BEGIN;
 SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
@@ -1316,16 +1318,80 @@ INSERT INTO t2 VALUES (10, 'old'), (20, 'other');
 UPDATE t1 SET c1 = 'other' WHERE c1 = 'old';
 ERROR 23000: Foreign key constraint for table 't1', record 'other-somevalu' would lead to a duplicate entry in table 't2', key 'c1'
 DROP TABLE t2,t1;
+call mtr.add_suppression("Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 255. Please drop excessive foreign constraints and try again");
 create table t1(
 id int primary key,
 pid int,
 index(pid),
 foreign key(pid) references t1(id) on delete cascade) engine=innodb;
-insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
-(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
+insert into t1 values
+(  0,   0), (  1,   0), (  2,   1), (  3,   2),
+(  4,   3), (  5,   4), (  6,   5), (  7,   6),
+(  8,   7), (  9,   8), ( 10,   9), ( 11,  10),
+( 12,  11), ( 13,  12), ( 14,  13), ( 15,  14),
+( 16,  15), ( 17,  16), ( 18,  17), ( 19,  18),
+( 20,  19), ( 21,  20), ( 22,  21), ( 23,  22),
+( 24,  23), ( 25,  24), ( 26,  25), ( 27,  26),
+( 28,  27), ( 29,  28), ( 30,  29), ( 31,  30),
+( 32,  31), ( 33,  32), ( 34,  33), ( 35,  34),
+( 36,  35), ( 37,  36), ( 38,  37), ( 39,  38),
+( 40,  39), ( 41,  40), ( 42,  41), ( 43,  42),
+( 44,  43), ( 45,  44), ( 46,  45), ( 47,  46),
+( 48,  47), ( 49,  48), ( 50,  49), ( 51,  50),
+( 52,  51), ( 53,  52), ( 54,  53), ( 55,  54),
+( 56,  55), ( 57,  56), ( 58,  57), ( 59,  58),
+( 60,  59), ( 61,  60), ( 62,  61), ( 63,  62),
+( 64,  63), ( 65,  64), ( 66,  65), ( 67,  66),
+( 68,  67), ( 69,  68), ( 70,  69), ( 71,  70),
+( 72,  71), ( 73,  72), ( 74,  73), ( 75,  74),
+( 76,  75), ( 77,  76), ( 78,  77), ( 79,  78),
+( 80,  79), ( 81,  80), ( 82,  81), ( 83,  82),
+( 84,  83), ( 85,  84), ( 86,  85), ( 87,  86),
+( 88,  87), ( 89,  88), ( 90,  89), ( 91,  90),
+( 92,  91), ( 93,  92), ( 94,  93), ( 95,  94),
+( 96,  95), ( 97,  96), ( 98,  97), ( 99,  98),
+(100,  99), (101, 100), (102, 101), (103, 102),
+(104, 103), (105, 104), (106, 105), (107, 106),
+(108, 107), (109, 108), (110, 109), (111, 110),
+(112, 111), (113, 112), (114, 113), (115, 114),
+(116, 115), (117, 116), (118, 117), (119, 118),
+(120, 119), (121, 120), (122, 121), (123, 122),
+(124, 123), (125, 124), (126, 125), (127, 126),
+(128, 127), (129, 128), (130, 129), (131, 130),
+(132, 131), (133, 132), (134, 133), (135, 134),
+(136, 135), (137, 136), (138, 137), (139, 138),
+(140, 139), (141, 140), (142, 141), (143, 142),
+(144, 143), (145, 144), (146, 145), (147, 146),
+(148, 147), (149, 148), (150, 149), (151, 150),
+(152, 151), (153, 152), (154, 153), (155, 154),
+(156, 155), (157, 156), (158, 157), (159, 158),
+(160, 159), (161, 160), (162, 161), (163, 162),
+(164, 163), (165, 164), (166, 165), (167, 166),
+(168, 167), (169, 168), (170, 169), (171, 170),
+(172, 171), (173, 172), (174, 173), (175, 174),
+(176, 175), (177, 176), (178, 177), (179, 178),
+(180, 179), (181, 180), (182, 181), (183, 182),
+(184, 183), (185, 184), (186, 185), (187, 186),
+(188, 187), (189, 188), (190, 189), (191, 190),
+(192, 191), (193, 192), (194, 193), (195, 194),
+(196, 195), (197, 196), (198, 197), (199, 198),
+(200, 199), (201, 200), (202, 201), (203, 202),
+(204, 203), (205, 204), (206, 205), (207, 206),
+(208, 207), (209, 208), (210, 209), (211, 210),
+(212, 211), (213, 212), (214, 213), (215, 214),
+(216, 215), (217, 216), (218, 217), (219, 218),
+(220, 219), (221, 220), (222, 221), (223, 222),
+(224, 223), (225, 224), (226, 225), (227, 226),
+(228, 227), (229, 228), (230, 229), (231, 230),
+(232, 231), (233, 232), (234, 233), (235, 234),
+(236, 235), (237, 236), (238, 237), (239, 238),
+(240, 239), (241, 240), (242, 241), (243, 242),
+(244, 243), (245, 244), (246, 245), (247, 246),
+(248, 247), (249, 248), (250, 249), (251, 250),
+(252, 251), (253, 252), (254, 253), (255, 254);
 delete from t1 where id=0;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `t1` (`id`) ON DELETE CASCADE)
-delete from t1 where id=15;
+Got one of the listed errors
+delete from t1 where id=255;
 delete from t1 where id=0;
 drop table t1;
 CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB;
@@ -1628,6 +1694,7 @@ a
 drop table t1;
 create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb;
 insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
+analyze table t1;
 select * from t1 order by a,b,c,d;
 a	b	c	d	e
 1	1	a	1	1
@@ -1689,10 +1756,10 @@ variable_value
 16384
 SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
 variable_value - @innodb_rows_deleted_orig
-71
+311
 SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
 variable_value - @innodb_rows_inserted_orig
-964
+1204
 SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
 variable_value - @innodb_rows_updated_orig
 866
@@ -2259,7 +2326,7 @@ t1	CREATE TABLE `t1` (
 drop table t1;
 create table t1 (v varchar(10), c char(10)) row_format=fixed;
 Warnings:
-Warning	1478	InnoDB: assuming ROW_FORMAT=COMPACT.
+Warning	1478	InnoDB: assuming ROW_FORMAT=DYNAMIC.
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
@@ -2287,9 +2354,16 @@ select * from t1 where a=20 and b is null;
 a	b
 20	NULL
 drop table t1;
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
+SET GLOBAL innodb_large_prefix=OFF;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 create table t1 (v varchar(65530), key(v));
 Warnings:
 Warning	1071	Specified key was too long; max key length is 767 bytes
+SET GLOBAL innodb_large_prefix=default;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 drop table t1;
 create table t1 (v varchar(65536));
 Warnings:
@@ -2309,7 +2383,8 @@ t1	CREATE TABLE `t1` (
   `v` mediumtext CHARACTER SET utf8 DEFAULT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 drop table t1;
-set storage_engine=MyISAM;
+SET sql_mode = default;
+set default_storage_engine=MyISAM;
 create table t1 (v varchar(16384)) engine=innodb;
 drop table t1;
 create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
@@ -2434,6 +2509,10 @@ t9	CREATE TABLE `t9` (
   KEY `col1` (`col1`,`col2`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
+SET GLOBAL innodb_large_prefix=OFF;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 create table t1 (col1 varchar(768), index(col1))
 character set = latin1 engine = innodb;
 Warnings:
@@ -2450,6 +2529,9 @@ create table t4 (col1 blob, index(col1(768)))
 character set = latin1 engine = innodb;
 Warnings:
 Warning	1071	Specified key was too long; max key length is 767 bytes
+SET GLOBAL innodb_large_prefix=default;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
@@ -2457,6 +2539,9 @@ t1	CREATE TABLE `t1` (
   KEY `col1` (`col1`(767))
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 drop table t1, t2, t3, t4;
+set global innodb_large_prefix=OFF;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 create table t1 (col1 varchar(768) primary key)
 character set = latin1 engine = innodb;
 ERROR 42000: Specified key was too long; max key length is 767 bytes
@@ -2469,6 +2554,10 @@ ERROR 42000: Specified key was too long; max key length is 767 bytes
 create table t4 (col1 blob, primary key(col1(768)))
 character set = latin1 engine = innodb;
 ERROR 42000: Specified key was too long; max key length is 767 bytes
+SET sql_mode = default;
+set global innodb_large_prefix=default;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 CREATE TABLE t1
 (
 id INT PRIMARY KEY
@@ -2485,7 +2574,7 @@ INSERT INTO t2 VALUES(1);
 DELETE FROM t1 WHERE id = 1;
 ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
 DROP TABLE t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
+Got one of the listed errors
 SET FOREIGN_KEY_CHECKS=0;
 DROP TABLE t1;
 SET FOREIGN_KEY_CHECKS=1;
@@ -2608,6 +2697,7 @@ d varchar(255) character set utf8,
 e varchar(255) character set utf8,
 key (a,b,c,d,e)) engine=innodb;
 ERROR 42000: Specified key was too long; max key length is 3072 bytes
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
 create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb;
 create table t2 (s1 binary(2),primary key (s1)) engine=innodb;
 create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
@@ -2723,6 +2813,7 @@ t2	CREATE TABLE `t2` (
   KEY `t2_ibfk_0` (`a`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 DROP TABLE t2,t1;
+SET sql_mode = default;
 CREATE TABLE t1 (
 field1 varchar(8) NOT NULL DEFAULT '',
 field2 varchar(8) NOT NULL DEFAULT '',
@@ -3095,7 +3186,7 @@ t1	CREATE TABLE `t1` (
   CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
 DROP TABLE t1,t2;
-set innodb_strict_mode=on;
+SET innodb_strict_mode=ON;
 CREATE TABLE t1 (
 c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
 c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
@@ -3106,7 +3197,8 @@ c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
 c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
 c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
 ) ENGINE = InnoDB;
-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+ERROR 42000: Row size too large (> {checked_valid}). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
+SET innodb_strict_mode=OFF;
 DROP TABLE IF EXISTS t1;
 Warnings:
 Note	1051	Unknown table 'test.t1'
diff --git a/mysql-test/suite/innodb/r/innodb_blob_truncate.result b/mysql-test/suite/innodb/r/innodb_blob_truncate.result
index 569e6b0..a71dd76 100644
--- a/mysql-test/suite/innodb/r/innodb_blob_truncate.result
+++ b/mysql-test/suite/innodb/r/innodb_blob_truncate.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 create table t1(a blob) engine=innodb key_block_size=8;
 create function generate_blob()
@@ -17,3 +19,5 @@ truncate t1;
 insert into t1 select generate_blob();
 drop table t1;
 drop function generate_blob;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result
deleted file mode 100644
index c467193..0000000
--- a/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result
+++ /dev/null
@@ -1,24 +0,0 @@
-call mtr.add_suppression("InnoDB: The total blob data length");
-SET GLOBAL max_allowed_packet = 100*1024*1024;
-connect big_packets,localhost,root,,;
-connection big_packets;
-CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB;
-INSERT INTO t1 (a, b) VALUES (1, '1');
-INSERT INTO t1 (a, b) VALUES (2, '2');
-INSERT INTO t1 (a, b) VALUES (3, '3');
-INSERT INTO t1 (a, b) VALUES (4, '4');
-INSERT INTO t1 (a, b) VALUES (5, '5');
-start transaction;
-INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024));
-ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size.
-connection default;
-# Quick shutdown and restart server
-connection default;
-SELECT a FROM t1;
-a
-1
-2
-3
-4
-5
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug12400341.result b/mysql-test/suite/innodb/r/innodb_bug12400341.result
index 31a064e..3bb786c 100644
--- a/mysql-test/suite/innodb/r/innodb_bug12400341.result
+++ b/mysql-test/suite/innodb/r/innodb_bug12400341.result
@@ -1,4 +1,5 @@
 call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too*");
+call mtr.add_suppression("\\[Warning\\] InnoDB: Cannot find a free slot for an undo log. Do you have too");
 set @old_innodb_undo_logs = @@innodb_undo_logs;
 set global innodb_undo_logs=1;
 show variables like "max_connections";
diff --git a/mysql-test/suite/innodb/r/innodb_bug12902967.result b/mysql-test/suite/innodb/r/innodb_bug12902967.result
index 5958a8d..e784c6b 100644
--- a/mysql-test/suite/innodb/r/innodb_bug12902967.result
+++ b/mysql-test/suite/innodb/r/innodb_bug12902967.result
@@ -1,6 +1,5 @@
+call mtr.add_suppression("In ALTER TABLE .* has or is referenced in foreign key constraints which are not compatible with the new table definition.");
 create table t1 (f1 integer primary key) engine innodb;
 alter table t1 add constraint c1 foreign key (f1) references t1(f1);
 ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150 "Foreign key constraint is incorrectly formed")
-InnoDB: has or is referenced in foreign key constraints
-InnoDB: which are not compatible with the new table definition.
 drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug14147491.result b/mysql-test/suite/innodb/r/innodb_bug14147491.result
index bd3c388..cf960e3 100644
--- a/mysql-test/suite/innodb/r/innodb_bug14147491.result
+++ b/mysql-test/suite/innodb/r/innodb_bug14147491.result
@@ -1,31 +1,10 @@
-call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*");
-CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
-CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
-CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed");
-CALL mtr.add_suppression("InnoDB: Space .* file test/t1 read of page .*");
-CALL mtr.add_suppression("InnoDB: You may have to recover from a backup.");
-CALL mtr.add_suppression("InnoDB: It is also possible that your operatingsystem has corrupted its own file cache.");
-CALL mtr.add_suppression("InnoDB: and rebooting your computer removes the error.");
-CALL mtr.add_suppression("InnoDB: If the corrupt page is an index page you can also try to");
-CALL mtr.add_suppression("InnoDB: fix the corruption by dumping, dropping, and reimporting");
-CALL mtr.add_suppression("InnoDB: the corrupt table. You can use CHECK");
-CALL mtr.add_suppression("InnoDB: TABLE to scan your table for corruption.");
-CALL mtr.add_suppression("InnoDB: See also .* about forcing recovery.");
-# Create and populate the table to be corrupted
-CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=InnoDB;
 INSERT INTO t1 (b) VALUES ('corrupt me');
 INSERT INTO t1 (b) VALUES ('corrupt me');
-# Write file to make mysql-test-run.pl expect the "crash", but don't
-# start it until it's told to
-# We give 30 seconds to do a clean shutdown because we do not want
-# to redo apply the pages of t1.ibd at the time of recovery.
-# We want SQL to initiate the first access to t1.ibd.
-# Wait until disconnected.
 # Backup the t1.ibd before corrupting
 # Corrupt the table
 Munged a string.
 Munged a string.
-# Write file to make mysql-test-run.pl start up the server again
 SET DEBUG_DBUG = '+d,innodb_page_corruption_retries';
 # Write file to make mysql-test-run.pl expect the "crash", but don't
 # start it until it's told to
@@ -34,6 +13,5 @@ SET DEBUG_DBUG = '+d,innodb_page_corruption_retries';
 SELECT * FROM t1;
 ERROR HY000: Lost connection to MySQL server during query
 # Restore the original t1.ibd
-# Write file to make mysql-test-run.pl start up the server again
 # Cleanup
 DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug30423.result b/mysql-test/suite/innodb/r/innodb_bug30423.result
index d7b72b1..c7f823a 100644
--- a/mysql-test/suite/innodb/r/innodb_bug30423.result
+++ b/mysql-test/suite/innodb/r/innodb_bug30423.result
@@ -48,9 +48,9 @@ ON orgs.org_id=sa_opportunities.org_id
 LEFT JOIN bug30243_2 contacts
 ON orgs.org_id=contacts.org_id ;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	orgs	index	NULL	org_id	4	NULL	128	Using index
-1	SIMPLE	sa_opportunities	ref	org_id	org_id	5	test.orgs.org_id	1	Using index
-1	SIMPLE	contacts	ref	contacts$org_id	contacts$org_id	5	test.orgs.org_id	1	Using index
+1	SIMPLE	orgs	index	NULL	org_id	4	NULL	ROWS	Using index
+1	SIMPLE	sa_opportunities	ref	org_id	org_id	5	test.orgs.org_id	ROWS	Using index
+1	SIMPLE	contacts	ref	contacts$org_id	contacts$org_id	5	test.orgs.org_id	ROWS	Using index
 select @@innodb_stats_method;
 @@innodb_stats_method
 nulls_ignored
@@ -74,9 +74,9 @@ ON orgs.org_id=sa_opportunities.org_id
 LEFT JOIN bug30243_2 contacts
 ON orgs.org_id=contacts.org_id;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	orgs	index	NULL	org_id	4	NULL	128	Using index
-1	SIMPLE	sa_opportunities	ref	org_id	org_id	5	test.orgs.org_id	1	Using index
-1	SIMPLE	contacts	ref	contacts$org_id	contacts$org_id	5	test.orgs.org_id	1	Using index
+1	SIMPLE	orgs	index	NULL	org_id	4	NULL	ROWS	Using index
+1	SIMPLE	sa_opportunities	ref	org_id	org_id	5	test.orgs.org_id	ROWS	Using index
+1	SIMPLE	contacts	ref	contacts$org_id	contacts$org_id	5	test.orgs.org_id	ROWS	Using index
 SELECT COUNT(*) FROM table_bug30423 WHERE org_id IS NULL;
 COUNT(*)
 1024
diff --git a/mysql-test/suite/innodb/r/innodb_bug34053.result b/mysql-test/suite/innodb/r/innodb_bug34053.result
index 195775f..23c5b0cc 100644
--- a/mysql-test/suite/innodb/r/innodb_bug34053.result
+++ b/mysql-test/suite/innodb/r/innodb_bug34053.result
@@ -1 +1 @@
-SET storage_engine=InnoDB;
+SET default_storage_engine=InnoDB;
diff --git a/mysql-test/suite/innodb/r/innodb_bug34300.result b/mysql-test/suite/innodb/r/innodb_bug34300.result
index 09fc0b4..b168c77 100644
--- a/mysql-test/suite/innodb/r/innodb_bug34300.result
+++ b/mysql-test/suite/innodb/r/innodb_bug34300.result
@@ -1,3 +1,20 @@
-ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size.
+#
+# Bug#34300 Tinyblob & tinytext fields currupted after export/import and alter in 5.1
+#
+SET @@global.max_allowed_packet=16777216;
+connect  newconn, localhost, root,,;
+CREATE TABLE bug34300 (
+f4 TINYTEXT,
+f6 MEDIUMTEXT,
+f8 TINYBLOB
+) ENGINE=InnoDB;
+INSERT INTO bug34300 VALUES ('xxx', repeat('a', 8459264), 'zzz');
+SELECT f4, f8 FROM bug34300;
 f4	f8
+xxx	zzz
+ALTER TABLE bug34300 ADD COLUMN (f10 INT);
+SELECT f4, f8 FROM bug34300;
 f4	f8
+xxx	zzz
+# Cleanup
+DROP TABLE bug34300;
diff --git a/mysql-test/suite/innodb/r/innodb_bug46000.result b/mysql-test/suite/innodb/r/innodb_bug46000.result
index 0e3f0ef..7c5ef13 100644
--- a/mysql-test/suite/innodb/r/innodb_bug46000.result
+++ b/mysql-test/suite/innodb/r/innodb_bug46000.result
@@ -6,7 +6,7 @@ show warnings;
 Level	Code	Message
 Warning	1280	Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
 Error	1280	Incorrect index name 'GEN_CLUST_INDEX'
-Warning	1030	Got error -1 "Internal error < 0 (Not system error)" from storage engine InnoDB
+Warning	1030	Got error 124 "Wrong index given to function" from storage engine InnoDB
 create table bug46000(id int) engine=innodb;
 create index GEN_CLUST_INDEX on bug46000(id);
 ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX'
diff --git a/mysql-test/suite/innodb/r/innodb_bug47167.result b/mysql-test/suite/innodb/r/innodb_bug47167.result
index 656a484..b678046 100644
--- a/mysql-test/suite/innodb/r/innodb_bug47167.result
+++ b/mysql-test/suite/innodb/r/innodb_bug47167.result
@@ -1,19 +1,25 @@
 set @old_innodb_file_format_max=@@innodb_file_format_max;
 select @old_innodb_file_format_max;
 @old_innodb_file_format_max
-Antelope
+Barracuda
 set global innodb_file_format_max = Barracuda;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@innodb_file_format_max;
 @@innodb_file_format_max
 Barracuda
 set global innodb_file_format_max = DEFAULT;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@innodb_file_format_max;
 @@innodb_file_format_max
 Antelope
 set global innodb_file_format_max = @old_innodb_file_format_max;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@innodb_file_format_max;
 @@innodb_file_format_max
-Antelope
+Barracuda
 set global innodb_file_format_max = cheetah;
 ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'cheetah'
 set global innodb_file_format_max = Bear;
@@ -22,3 +28,5 @@ set global innodb_file_format_max = on;
 ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'ON'
 set global innodb_file_format_max = off;
 ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'off'
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb_bug54044.result b/mysql-test/suite/innodb/r/innodb_bug54044.result
index d80c451..1c34ea9 100644
--- a/mysql-test/suite/innodb/r/innodb_bug54044.result
+++ b/mysql-test/suite/innodb/r/innodb_bug54044.result
@@ -19,5 +19,5 @@ CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
 INSERT INTO t1 VALUES ('foo'),('bar');
 FLUSH TABLES;
 CREATE TEMPORARY TABLE tmp ENGINE=InnoDB AS SELECT VALUES(a) FROM t1;
-ERROR HY000: Can't create table `test`.`tmp` (errno: -1 "Internal error < 0 (Not system error)")
+ERROR HY000: Can't create table `test`.`tmp` (errno: 168 "Unknown (generic) error from engine")
 DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug60049.result b/mysql-test/suite/innodb/r/innodb_bug60049.result
index 8e3be13..f34ebc0 100644
--- a/mysql-test/suite/innodb/r/innodb_bug60049.result
+++ b/mysql-test/suite/innodb/r/innodb_bug60049.result
@@ -1,5 +1,3 @@
-call mtr.add_suppression('InnoDB: Error: Table "mysql"."innodb_(table|index)_stats" not found');
-call mtr.add_suppression('InnoDB: Error: Fetch of persistent statistics requested');
 CREATE TABLE t(a INT)ENGINE=InnoDB STATS_PERSISTENT=0;
 RENAME TABLE t TO u;
 DROP TABLE u;
diff --git a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
index 0ef6f65..d68879d 100644
--- a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
+++ b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result
@@ -1,48 +1,74 @@
+set names utf8;
+CREATE TABLE corrupt_bit_test_ā(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(100),
+c INT,
+z INT,
+INDEX idx(b))
+ENGINE=InnoDB STATS_PERSISTENT=0;
+INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1);
+CREATE UNIQUE INDEX idxā ON corrupt_bit_test_ā(c, b);
+CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b);
+SELECT * FROM corrupt_bit_test_ā;
 a	b	c	z
 1	x	1	1
+INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
+select count(*) from corrupt_bit_test_ā;
 count(*)
 2
+SET SESSION debug="+d,dict_set_index_corrupted";
+Warnings:
+Warning	1287	'@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+check table corrupt_bit_test_ā;
 Table	Op	Msg_type	Msg_text
-test.corrupt_bit_test_ā	check	Warning	InnoDB: Index "idx" is marked as corrupted
-test.corrupt_bit_test_ā	check	Warning	InnoDB: Index "idxā" is marked as corrupted
-test.corrupt_bit_test_ā	check	Warning	InnoDB: Index "idxē" is marked as corrupted
+test.corrupt_bit_test_ā	check	Warning	InnoDB: Index idx is marked as corrupted
+test.corrupt_bit_test_ā	check	Warning	InnoDB: Index idxā is marked as corrupted
+test.corrupt_bit_test_ā	check	Warning	InnoDB: Index idxē is marked as corrupted
 test.corrupt_bit_test_ā	check	error	Corrupt
-ERROR HY000: Index "idx" is corrupted
-ERROR HY000: Index "idx" is corrupted
+SET SESSION debug="-d,dict_set_index_corrupted";
+Warnings:
+Warning	1287	'@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
+ERROR HY000: Index idx is corrupted
+CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
+ERROR HY000: Index idx is corrupted
+select c from corrupt_bit_test_ā;
 ERROR HY000: Index corrupt_bit_test_ā is corrupted
+select z from corrupt_bit_test_ā;
 ERROR HY000: Index corrupt_bit_test_ā is corrupted
+show warnings;
 Level	Code	Message
-Warning	180	InnoDB: Index "idxē" for table "test"."corrupt_bit_test_ā" is marked as corrupted
+Warning	180	InnoDB: Index idxē for table "test"."corrupt_bit_test_ā" is marked as corrupted
 Error	1712	Index corrupt_bit_test_ā is corrupted
+insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
+select * from corrupt_bit_test_ā use index(primary) where a = 10001;
 a	b	c	z
 10001	a	20001	20001
+begin;
+insert into corrupt_bit_test_ā values (10002, "a", 20002, 20002);
+delete from corrupt_bit_test_ā where a = 10001;
+insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
+rollback;
+drop index idxā on corrupt_bit_test_ā;
+check table corrupt_bit_test_ā;
 Table	Op	Msg_type	Msg_text
-test.corrupt_bit_test_ā	check	Warning	InnoDB: Index "idx" is marked as corrupted
-test.corrupt_bit_test_ā	check	Warning	InnoDB: Index "idxē" is marked as corrupted
+test.corrupt_bit_test_ā	check	Warning	InnoDB: Index idx is marked as corrupted
+test.corrupt_bit_test_ā	check	Warning	InnoDB: Index idxē is marked as corrupted
 test.corrupt_bit_test_ā	check	error	Corrupt
+set names utf8;
+select z from corrupt_bit_test_ā;
 ERROR HY000: Index corrupt_bit_test_ā is corrupted
-Table	Create Table
-corrupt_bit_test_ā	CREATE TABLE `corrupt_bit_test_ā` (
-  `a` int(11) NOT NULL AUTO_INCREMENT,
-  `b` char(100) DEFAULT NULL,
-  `c` int(11) DEFAULT NULL,
-  `z` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `idxē` (`z`,`b`),
-  KEY `idx` (`b`)
-) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1
-ERROR HY000: Index "idx" is corrupted
-ERROR HY000: Index "idx" is corrupted
-Table	Create Table
-corrupt_bit_test_ā	CREATE TABLE `corrupt_bit_test_ā` (
-  `a` int(11) NOT NULL AUTO_INCREMENT,
-  `b` char(100) DEFAULT NULL,
-  `c` int(11) DEFAULT NULL,
-  `z` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `idx` (`b`)
-) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1
+drop index idxē on corrupt_bit_test_ā;
+CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
+ERROR HY000: Index idx is corrupted
+CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
+ERROR HY000: Index idx is corrupted
+drop index idx on corrupt_bit_test_ā;
+CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
+CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
+select z from corrupt_bit_test_ā limit 10;
 z
 20001
 1
 2
+drop table corrupt_bit_test_ā;
diff --git a/mysql-test/suite/innodb/r/innodb_file_format.result b/mysql-test/suite/innodb/r/innodb_file_format.result
index 77328a3..e489911 100644
--- a/mysql-test/suite/innodb/r/innodb_file_format.result
+++ b/mysql-test/suite/innodb/r/innodb_file_format.result
@@ -1,38 +1,50 @@
 select @@innodb_file_format;
 @@innodb_file_format
-Antelope
+Barracuda
 select @@innodb_file_format_check;
 @@innodb_file_format_check
 1
 select @@innodb_file_format_max;
 @@innodb_file_format_max
-Antelope
+Barracuda
 set global innodb_file_format=antelope;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_format=barracuda;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_format=cheetah;
 ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'cheetah'
 select @@innodb_file_format;
 @@innodb_file_format
 Barracuda
 set global innodb_file_format=default;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@innodb_file_format;
 @@innodb_file_format
-Antelope
+Barracuda
 set global innodb_file_format=on;
 ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'ON'
 set global innodb_file_format=off;
 ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off'
 select @@innodb_file_format;
 @@innodb_file_format
-Antelope
+Barracuda
 set global innodb_file_format_max=antelope;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_format_max=barracuda;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_format_max=cheetah;
 ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'cheetah'
 select @@innodb_file_format_max;
 @@innodb_file_format_max
 Barracuda
 set global innodb_file_format_max=default;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@innodb_file_format_max;
 @@innodb_file_format_max
 Antelope
@@ -44,5 +56,11 @@ select @@innodb_file_format_max;
 @@innodb_file_format_max
 Antelope
 set global innodb_file_format_max=antelope;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_format_check=off;
 ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb_gis.result b/mysql-test/suite/innodb/r/innodb_gis.result
index fc13ba1..5a978ea 100644
--- a/mysql-test/suite/innodb/r/innodb_gis.result
+++ b/mysql-test/suite/innodb/r/innodb_gis.result
@@ -598,4 +598,4 @@ create table t1 (a int not null, b linestring not null, unique key b (b(12)));
 create unique index a on t1(a);
 drop table t1;
 create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
-ERROR HY000: The storage engine InnoDB doesn't support SPATIAL indexes
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb_information_schema.result b/mysql-test/suite/innodb/r/innodb_information_schema.result
index 1b83bc2..15c3af3 100644
--- a/mysql-test/suite/innodb/r/innodb_information_schema.result
+++ b/mysql-test/suite/innodb/r/innodb_information_schema.result
@@ -47,7 +47,7 @@ trx_adaptive_hash_timeout	bigint(21) unsigned	NO		0
 trx_is_read_only	int(1)	NO		0	
 trx_autocommit_non_locking	int(1)	NO		0	
 trx_state	trx_weight	trx_tables_in_use	trx_tables_locked	trx_rows_locked	trx_rows_modified	trx_concurrency_tickets	trx_isolation_level	trx_unique_checks	trx_foreign_key_checks
-RUNNING	4	0	0	7	1	0	REPEATABLE READ	1	1
+RUNNING	4	0	1	7	1	0	REPEATABLE READ	1	1
 trx_isolation_level	trx_unique_checks	trx_foreign_key_checks
 SERIALIZABLE	0	0
 trx_state	trx_isolation_level	trx_last_foreign_key_error
diff --git a/mysql-test/suite/innodb/r/innodb_information_schema_buffer.result b/mysql-test/suite/innodb/r/innodb_information_schema_buffer.result
index dcdf308..6328458 100644
--- a/mysql-test/suite/innodb/r/innodb_information_schema_buffer.result
+++ b/mysql-test/suite/innodb/r/innodb_information_schema_buffer.result
@@ -24,6 +24,7 @@ WHERE TABLE_NAME like "%infoschema_buffer_test%"
 and PAGE_STATE="file_page" and INDEX_NAME = "idx" and PAGE_TYPE="index";
 TABLE_NAME	INDEX_NAME	NUMBER_RECORDS	DATA_SIZE	PAGE_STATE	PAGE_TYPE
 `test`.`infoschema_buffer_test`	idx	2	32	FILE_PAGE	INDEX
+`test`.`infoschema_buffer_test`	idx	2	32	FILE_PAGE	INDEX
 DROP TABLE infoschema_buffer_test;
 SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE
 FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
diff --git a/mysql-test/suite/innodb/r/innodb_monitor.result b/mysql-test/suite/innodb/r/innodb_monitor.result
index 8c58034..bda1462 100644
--- a/mysql-test/suite/innodb/r/innodb_monitor.result
+++ b/mysql-test/suite/innodb/r/innodb_monitor.result
@@ -4,7 +4,6 @@ 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
@@ -47,7 +46,6 @@ 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
@@ -55,6 +53,19 @@ buffer_flush_neighbor_total_pages	disabled
 buffer_flush_neighbor	disabled
 buffer_flush_neighbor_pages	disabled
 buffer_flush_n_to_flush_requested	disabled
+buffer_flush_n_to_flush_by_age	disabled
+buffer_flush_adaptive_avg_time_slot	disabled
+buffer_LRU_batch_flush_avg_time_slot	disabled
+buffer_flush_adaptive_avg_time_thread	disabled
+buffer_LRU_batch_flush_avg_time_thread	disabled
+buffer_flush_adaptive_avg_time_est	disabled
+buffer_LRU_batch_flush_avg_time_est	disabled
+buffer_flush_avg_time	disabled
+buffer_flush_adaptive_avg_pass	disabled
+buffer_LRU_batch_flush_avg_pass	disabled
+buffer_flush_avg_pass	disabled
+buffer_LRU_get_free_loops	disabled
+buffer_LRU_get_free_waits	disabled
 buffer_flush_avg_page_rate	disabled
 buffer_flush_lsn_avg_rate	disabled
 buffer_flush_pct_for_dirty	disabled
@@ -157,12 +168,13 @@ 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_log_flushes	disabled
 log_pending_checkpoint_writes	disabled
 log_num_log_io	disabled
 log_waits	disabled
 log_write_requests	disabled
 log_writes	disabled
+log_padded	disabled
 compress_pages_compressed	disabled
 compress_pages_decompressed	disabled
 compression_pad_increments	disabled
@@ -223,10 +235,13 @@ innodb_dblwr_pages_written	disabled
 innodb_page_size	disabled
 innodb_rwlock_s_spin_waits	disabled
 innodb_rwlock_x_spin_waits	disabled
+innodb_rwlock_sx_spin_waits	disabled
 innodb_rwlock_s_spin_rounds	disabled
 innodb_rwlock_x_spin_rounds	disabled
+innodb_rwlock_sx_spin_rounds	disabled
 innodb_rwlock_s_os_waits	disabled
 innodb_rwlock_x_os_waits	disabled
+innodb_rwlock_sx_os_waits	disabled
 dml_reads	disabled
 dml_inserts	disabled
 dml_deletes	disabled
@@ -239,6 +254,8 @@ ddl_background_drop_indexes	disabled
 ddl_background_drop_tables	disabled
 ddl_online_create_index	disabled
 ddl_pending_alter_table	disabled
+ddl_sort_file_alter_table	disabled
+ddl_log_file_alter_table	disabled
 icp_attempts	disabled
 icp_no_match	disabled
 icp_out_of_range	disabled
@@ -280,10 +297,13 @@ 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_sx_spin_waits	disabled
 innodb_rwlock_s_spin_rounds	disabled
 innodb_rwlock_x_spin_rounds	disabled
+innodb_rwlock_sx_spin_rounds	disabled
 innodb_rwlock_s_os_waits	disabled
 innodb_rwlock_x_os_waits	disabled
+innodb_rwlock_sx_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="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
@@ -408,7 +428,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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,
@@ -419,7 +438,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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
@@ -429,7 +447,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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);
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
index cf5d77a..5ae1384 100644
--- a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
+++ b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
@@ -1,6 +1,10 @@
 set global innodb_file_format="Barracuda";
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 set global innodb_file_per_table=1;
 set global innodb_large_prefix=1;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 DROP TABLE IF EXISTS worklog5743;
 CREATE TABLE worklog5743 (
 col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
@@ -88,6 +92,10 @@ worklog5743;
 col_1_text = REPEAT("a", 3500)	col_2_text  = REPEAT("o", 3500)
 1	1
 DROP TABLE worklog5743;
-SET GLOBAL innodb_file_format=Antelope;
+SET GLOBAL innodb_file_format=Barracuda;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table=1;
-SET GLOBAL innodb_large_prefix=0;
+SET GLOBAL innodb_large_prefix=1;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures_small.result b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures_small.result
index 92ae163..099c673b 100644
--- a/mysql-test/suite/innodb/r/innodb_simulate_comp_failures_small.result
+++ b/mysql-test/suite/innodb/r/innodb_simulate_comp_failures_small.result
@@ -2,7 +2,16 @@
 # Testing robustness against random compression failures
 #
 CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255), KEY msg_i(msg)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `msg` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  KEY `msg_i` (`msg`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8
 SET GLOBAL innodb_simulate_comp_failures = 25;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
+COMMIT;
+SELECT COUNT(id) FROM t1;
+COUNT(id)
 1000
diff --git a/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result b/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result
index c351b22..b942904 100644
--- a/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result
+++ b/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result
@@ -1,5 +1,5 @@
-call mtr.add_suppression("InnoDB: Error: Table \"mysql\".\"innodb_index_stats\" not found");
-call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table");
+call mtr.add_suppression("InnoDB: Table .*innodb_index_stats.* not found");
+call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table .*");
 ALTER TABLE mysql.innodb_index_stats RENAME TO mysql.innodb_index_stats_;
 CREATE TABLE test_ps_create_on_corrupted
 (a INT, PRIMARY KEY (a))
diff --git a/mysql-test/suite/innodb/r/innodb_stats_fetch_corrupted.result b/mysql-test/suite/innodb/r/innodb_stats_fetch_corrupted.result
index f6cce75..42862fb 100644
--- a/mysql-test/suite/innodb/r/innodb_stats_fetch_corrupted.result
+++ b/mysql-test/suite/innodb/r/innodb_stats_fetch_corrupted.result
@@ -1,5 +1,5 @@
-call mtr.add_suppression("InnoDB: Error: Table \"mysql\".\"innodb_index_stats\" not found");
-call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table");
+call mtr.add_suppression("InnoDB: Table \"mysql\".\"innodb_index_stats\" not found");
+call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table.*");
 CREATE TABLE test_ps_fetch_corrupted
 (a INT, PRIMARY KEY (a))
 ENGINE=INNODB STATS_PERSISTENT=1;
diff --git a/mysql-test/suite/innodb/r/strict_mode.result b/mysql-test/suite/innodb/r/strict_mode.result
index d6a6212..2f120af 100644
--- a/mysql-test/suite/innodb/r/strict_mode.result
+++ b/mysql-test/suite/innodb/r/strict_mode.result
@@ -2,6 +2,7 @@
 # Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN
 # INNODB_STRICT_MODE = 1
 #
+call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
 set innodb_strict_mode = 0;
 create table t1 (id int auto_increment primary key,
 v varchar(32),
@@ -235,7 +236,7 @@ col227 text,
 col228 text
 ) ENGINE=InnoDB;
 Warnings:
-Warning	139	Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+Warning	139	Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
 set innodb_strict_mode = 1;
 alter table t1 engine=InnoDB;
 ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
diff --git a/mysql-test/suite/innodb/t/auto_increment_dup.opt b/mysql-test/suite/innodb/t/auto_increment_dup.opt
new file mode 100644
index 0000000..8235b0a
--- /dev/null
+++ b/mysql-test/suite/innodb/t/auto_increment_dup.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=1
diff --git a/mysql-test/suite/innodb/t/create_isl_with_direct.test b/mysql-test/suite/innodb/t/create_isl_with_direct.test
index 34ea9c7..83c7507 100644
--- a/mysql-test/suite/innodb/t/create_isl_with_direct.test
+++ b/mysql-test/suite/innodb/t/create_isl_with_direct.test
@@ -3,7 +3,7 @@
 --source include/not_windows.inc
 
 --disable_query_log
-CALL mtr.add_suppression("\\[Warning\\] InnoDB: Failed to set O_DIRECT on file ./ibdata1: OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs, see MySQL Bug#26662.");
+CALL mtr.add_suppression(".*Failed to set O_DIRECT on file.*");
 
 # The below mtr suppression to avoid failure in solaris platform.
 CALL mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to set DIRECTIO_ON on file.*");
diff --git a/mysql-test/suite/innodb/t/innodb-16k.test b/mysql-test/suite/innodb/t/innodb-16k.test
index 3cd90a0..ad09666 100644
--- a/mysql-test/suite/innodb/t/innodb-16k.test
+++ b/mysql-test/suite/innodb/t/innodb-16k.test
@@ -3,16 +3,20 @@
 --source include/have_innodb.inc
 --source include/have_innodb_16k.inc
 
+call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
+
 --disable_query_log
 let $MYSQLD_DATADIR= `select @@datadir`;
 # These values can change during the test
 let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
 let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
 let $innodb_strict_mode_orig = `SELECT @@session.innodb_strict_mode`;
+let $innodb_large_prefix_orig = `SELECT @@innodb_large_prefix`;
 --enable_query_log
 
 SET GLOBAL innodb_file_format = `Barracuda`;
 SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_large_prefix = OFF;
 
 
 --echo # Test 1) Show the page size from Information Schema
@@ -374,16 +378,6 @@ CREATE INDEX t1t ON t1 (t(767));
 --error 1713
 UPDATE t1 SET t=@e;
 
-# The function dict_index_too_big_for_undo() prevents us from adding
-# one more index.  But it is too late.  The record is already too big.
-
---error ER_TOO_BIG_ROWSIZE
-CREATE INDEX t1u ON t1 (u(767));
-
---error ER_TOO_BIG_ROWSIZE
-CREATE INDEX t1ut ON t1 (u(767), t(767));
-CREATE INDEX t1st ON t1 (s(767), t(767));
-
 SHOW CREATE TABLE t1;
 DROP TABLE t1;
 
@@ -520,11 +514,7 @@ UPDATE bug12547647 SET c = REPEAT('b',16928);
 SHOW WARNINGS;
 DROP TABLE bug12547647;
 
-
-
-# The following should fail in non-strict mode too.
-
-SET SESSION innodb_strict_mode = off;
+SET SESSION innodb_strict_mode = on;
 --error ER_TOO_BIG_ROWSIZE
 CREATE TABLE t1(
 	c text NOT NULL, d text NOT NULL,
@@ -974,4 +964,5 @@ row_format=compact,ENGINE=INNODB;
 EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
 EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
 EVAL SET SESSION innodb_strict_mode = $innodb_strict_mode_orig;
+EVAL SET GLOBAL innodb_large_prefix = $innodb_large_prefix_orig;
 --enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-alter-discard.test b/mysql-test/suite/innodb/t/innodb-alter-discard.test
index 80678ce..792882b 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-discard.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-discard.test
@@ -23,6 +23,12 @@ EOF
 -- enable_reconnect
 -- source include/wait_until_connected_again.inc
 
+call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
+call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified.");
+call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.");
+call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: './test/t.ibd' OS error: .*");
+call mtr.add_suppression("InnoDB: Ignoring tablespace `test/t` because it could not be opened.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .*");
 call mtr.add_suppression("InnoDB: Error: trying to open a table, but could not$");
 call mtr.add_suppression("MySQL is trying to open a table handle but the \.ibd file for$");
 call mtr.add_suppression("InnoDB: Table 'test/t'$");
diff --git a/mysql-test/suite/innodb/t/innodb-blob.test b/mysql-test/suite/innodb/t/innodb-blob.test
index 8aa113f..c1f9ee5 100644
--- a/mysql-test/suite/innodb/t/innodb-blob.test
+++ b/mysql-test/suite/innodb/t/innodb-blob.test
@@ -3,6 +3,7 @@
 # columns are stored off-page.
 
 --source include/have_innodb.inc
+# The 7000 in this test is a bit less than half the innodb_page_size.
 --source include/have_innodb_16k.inc
 
 # DEBUG_SYNC must be compiled in.
@@ -15,6 +16,8 @@
 # Avoid CrashReporter popup on Mac
 --source include/not_crashrep.inc
 
+call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles!");
+
 CREATE TABLE t1 (a INT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
 CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
 CREATE TABLE t3 (a INT PRIMARY KEY, b TEXT, c TEXT) ENGINE=InnoDB;
@@ -41,7 +44,7 @@ connect (con2,localhost,root,,);
 # Check that the above SELECT is blocked
 let $wait_condition=
   select count(*) = 1 from information_schema.processlist
-  where state = 'Sending data' and
+  where state in ('Sending data', 'Opening tables') and
         info = 'SELECT a, RIGHT(b,20) FROM t1';
 --source include/wait_condition.inc
 
@@ -51,7 +54,7 @@ connection con1;
 reap;
 connection default;
 reap;
-SET DEBUG_DBUG='+d,row_ins_extern_checkpoint';
+SET DEBUG='+d,row_ins_extern_checkpoint';
 SET DEBUG_SYNC='before_row_ins_extern_latch SIGNAL rec_not_blob WAIT_FOR crash';
 ROLLBACK;
 BEGIN;
@@ -68,7 +71,8 @@ SELECT a, RIGHT(b,20) FROM t1;
 SELECT a FROM t1;
 
 # Request a crash, and restart the server.
-SET DEBUG_DBUG='+d,crash_commit_before';
+SET DEBUG='+d,crash_commit_before';
+# Write file to make mysql-test-run.pl restart the server
 --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --error 2013
 INSERT INTO t2 VALUES (42);
@@ -80,7 +84,6 @@ connection default;
 --error 2013
 reap;
 
-# Write file to make mysql-test-run.pl restart the server
 --enable_reconnect
 --source include/wait_until_connected_again.inc
 --disable_reconnect
@@ -90,41 +93,34 @@ CHECK TABLE t1;
 INSERT INTO t3 VALUES
        (1,REPEAT('d',7000),REPEAT('e',100)),
        (2,REPEAT('g',7000),REPEAT('h',100));
-SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR go';
+SET DEBUG_SYNC='blob_write_middle SIGNAL go_sel WAIT_FOR go_upd';
 # This should move column b off-page.
 --send
 UPDATE t3 SET c=REPEAT('f',3000) WHERE a=1;
 
+--echo # Connection con1:
 connect (con1,localhost,root,,);
-SET DEBUG_SYNC='now WAIT_FOR have_latch';
+SET DEBUG_SYNC='now WAIT_FOR go_sel';
 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
 SELECT @@tx_isolation;
-
-# this one should block
--- send
 SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3;
+set debug_sync='now SIGNAL go_upd';
 
-connect (con2,localhost,root,,);
-
-# Check that the above SELECT is blocked
-let $wait_condition=
-  select count(*) = 1 from information_schema.processlist
-  where state = 'Sending data' and
-        info = 'SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3';
---source include/wait_condition.inc
-
-SET DEBUG_SYNC='now SIGNAL go';
+--echo # Connection default:
+connection default;
+--echo # reap UPDATE t3 SET c=REPEAT('f',3000) WHERE a=1;
+reap;
 
+--echo # Connection con1:
 connection con1;
-reap;
+SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3;
+
 disconnect con1;
 
 connection default;
-reap;
-
 CHECK TABLE t1,t2,t3;
 
-connection con2;
+connect (con2,localhost,root,,);
 BEGIN;
 INSERT INTO t2 VALUES (347);
 connection default;
@@ -134,7 +130,7 @@ connection default;
 # remain open while we are writing the off-page columns and are
 # stuck in the DEBUG_SYNC. A checkpoint involves a flush, which
 # would wait for the buffer-fix to cease.
-SET DEBUG_DBUG='+d,row_upd_extern_checkpoint';
+SET DEBUG='+d,row_upd_extern_checkpoint';
 SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR crash';
 # This should move column b off-page.
 --send
@@ -148,7 +144,8 @@ SELECT info FROM information_schema.processlist
 WHERE state = 'debug sync point: before_row_upd_extern';
 
 # Request a crash, and restart the server.
-SET DEBUG_DBUG='+d,crash_commit_before';
+SET DEBUG='+d,crash_commit_before';
+# Write file to make mysql-test-run.pl restart the server
 --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --error 2013
 COMMIT;
@@ -159,7 +156,6 @@ connection default;
 --error 2013
 reap;
 
-# Write file to make mysql-test-run.pl restart the server
 --enable_reconnect
 --source include/wait_until_connected_again.inc
 --disable_reconnect
@@ -178,7 +174,7 @@ connection default;
 # remain open while we are writing the off-page columns and are
 # stuck in the DEBUG_SYNC. A checkpoint involves a flush, which
 # would wait for the buffer-fix to cease.
-SET DEBUG_DBUG='+d,row_upd_extern_checkpoint';
+SET DEBUG='+d,row_upd_extern_checkpoint';
 SET DEBUG_SYNC='after_row_upd_extern SIGNAL have_latch WAIT_FOR crash';
 # This should move column b off-page.
 --send
@@ -192,7 +188,8 @@ SELECT info FROM information_schema.processlist
 WHERE state = 'debug sync point: after_row_upd_extern';
 
 # Request a crash, and restart the server.
-SET DEBUG_DBUG='+d,crash_commit_before';
+SET DEBUG='+d,crash_commit_before';
+# Write file to make mysql-test-run.pl restart the server
 --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --error 2013
 COMMIT;
@@ -203,7 +200,6 @@ connection default;
 --error 2013
 reap;
 
-# Write file to make mysql-test-run.pl restart the server
 --enable_reconnect
 --source include/wait_until_connected_again.inc
 --disable_reconnect
diff --git a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery-master.opt b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery-master.opt
index 33e2b86..97b259e 100644
--- a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery-master.opt
+++ b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery-master.opt
@@ -1 +1,2 @@
 --log-error=$MYSQLTEST_VARDIR/tmp/my_restart.err
+--innodb_buffer_pool_size=24M
diff --git a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
index 79f7999..cbf2d0c 100644
--- a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
+++ b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
@@ -1,8 +1,3 @@
-if (`select plugin_auth_version < "5.6.17" from information_schema.plugins where plugin_name='innodb'`)
-{
-  --skip Not fixed in InnoDB before 5.6.17
-}
-
 --echo #
 --echo # Bug#69122 - INNODB DOESN'T REDO-LOG INSERT BUFFER MERGE
 --echo #             OPERATION IF IT IS DONE IN-PLACE
@@ -14,8 +9,13 @@ if (`select plugin_auth_version < "5.6.17" from information_schema.plugins where
 --source include/not_embedded.inc
 # DBUG_SUICIDE() hangs under valgrind
 --source include/not_valgrind.inc
-# No windows, need perl
---source include/not_windows.inc
+
+CREATE TABLE t1(
+	a INT AUTO_INCREMENT PRIMARY KEY,
+	b CHAR(1),
+	c INT,
+	INDEX(b))
+ENGINE=InnoDB STATS_PERSISTENT=0;
 
 # The flag innodb_change_buffering_debug is only available in debug builds.
 # It instructs InnoDB to try to evict pages from the buffer pool when
@@ -24,13 +24,6 @@ if (`select plugin_auth_version < "5.6.17" from information_schema.plugins where
 SET GLOBAL innodb_change_buffering_debug = 1;
 let SEARCH_FILE = $MYSQLTEST_VARDIR/tmp/my_restart.err;
 
-CREATE TABLE t1(
-	a INT AUTO_INCREMENT PRIMARY KEY,
-	b CHAR(1),
-	c INT,
-	INDEX(b))
-ENGINE=InnoDB;
-
 # Create enough rows for the table, so that the change buffer will be
 # used for modifying the secondary index page. There must be multiple
 # index pages, because changes to the root page are never buffered.
@@ -48,7 +41,6 @@ INSERT INTO t1 SELECT 0,b,c FROM t1;
 INSERT INTO t1 SELECT 0,b,c FROM t1;
 INSERT INTO t1 SELECT 0,b,c FROM t1;
 INSERT INTO t1 SELECT 0,b,c FROM t1;
-INSERT INTO t1 SELECT 0,b,c FROM t1;
 
 BEGIN;
 SELECT b FROM t1 LIMIT 3;
@@ -60,7 +52,7 @@ DELETE FROM t1 WHERE a=1;
 # This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
 INSERT INTO t1 VALUES(1,'X',1);
 
-SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace';
+SET DEBUG='+d,crash_after_log_ibuf_upd_inplace';
 --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
 --error 2013
 # This should force a change buffer merge
diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7408.test b/mysql-test/suite/innodb/t/innodb-mdev-7408.test
index d1cd187..46f1afc 100644
--- a/mysql-test/suite/innodb/t/innodb-mdev-7408.test
+++ b/mysql-test/suite/innodb/t/innodb-mdev-7408.test
@@ -1,5 +1,7 @@
 --source include/have_innodb.inc
 
+call mtr.add_suppression("InnoDB: User stopword table .* does not exist.");
+
 select @@global.innodb_ft_server_stopword_table;
 CREATE TABLE `stop_it-IT` ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
 --error 1231
diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7513.test b/mysql-test/suite/innodb/t/innodb-mdev-7513.test
index b929ea1..88f941e 100644
--- a/mysql-test/suite/innodb/t/innodb-mdev-7513.test
+++ b/mysql-test/suite/innodb/t/innodb-mdev-7513.test
@@ -3,6 +3,7 @@
 
 # MDEV-7513: ib_warn_row_too_big dereferences null thd
 
+call mtr.add_suppression("InnoDB: Cannot add field `.* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
 call mtr.add_suppression("Row size too large (> 8126)*");
 
 --disable_warnings
diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test
index b408522..208dcd5 100644
--- a/mysql-test/suite/innodb/t/innodb-mdev7046.test
+++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test
@@ -12,6 +12,7 @@
 call mtr.add_suppression("InnoDB: File ./test/t1*");
 call mtr.add_suppression("InnoDB: Error number*");
 call mtr.add_suppression("InnoDB: File ./test/t1#p#p1#sp#p1sp0.ibd: 'rename' returned OS error*");
+call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
 
 # MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type) 
 # after Operating system error number 36 in a file operation
diff --git a/mysql-test/suite/innodb/t/innodb-virtual-columns.test b/mysql-test/suite/innodb/t/innodb-virtual-columns.test
index 368c6fc..0e0d6db 100644
--- a/mysql-test/suite/innodb/t/innodb-virtual-columns.test
+++ b/mysql-test/suite/innodb/t/innodb-virtual-columns.test
@@ -33,6 +33,8 @@ CREATE TABLE IF NOT EXISTS grad_degree (
   CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
+SHOW CREATE TABLE grad_degree;
+
 CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
 CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term);
 
@@ -137,6 +139,8 @@ CREATE TABLE IF NOT EXISTS grad_degree (
   CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
+SHOW CREATE TABLE grad_degree;
+
 CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
 CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term);
 
@@ -251,6 +255,8 @@ CREATE TABLE IF NOT EXISTS grad_degree (
   CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
+SHOW CREATE TABLE grad_degree;
+
 CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn);
 
 ALTER TABLE grad_degree DROP COLUMN ofis_deg_status2, DROP COLUMN ofis_deg_status3,
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-1.test b/mysql-test/suite/innodb/t/innodb-wl5522-1.test
index b1db349..6c2607e 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522-1.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522-1.test
@@ -3,6 +3,8 @@
 
 -- source include/have_innodb.inc
 
+call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists.  Please DISCARD the tablespace before IMPORT.");
+
 --disable_warnings
 DROP TABLE IF EXISTS t1;
 --enable_warnings
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test
index 4b03ac0..c61d10e 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test
@@ -17,6 +17,9 @@
 # allow test to run only when innodb-page-size=16  
 --source include/have_innodb_16k.inc
 
+call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
+call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
+call mtr.add_suppression("InnoDB: Error: Tablespace flags .* corrupted unused .*");
 
 let MYSQLD_DATADIR =`SELECT @@datadir`;
 let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-zip.test b/mysql-test/suite/innodb/t/innodb-wl5522-zip.test
index d139e0b..395e4de 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522-zip.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522-zip.test
@@ -7,6 +7,8 @@
 # allow test to run only when innodb-page-size=16  
 --source include/have_innodb_16k.inc
 
+call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists.  Please DISCARD the tablespace before IMPORT.");
+
 --disable_warnings
 DROP TABLE IF EXISTS t1;
 --enable_warnings
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522.test b/mysql-test/suite/innodb/t/innodb-wl5522.test
index c9e7748..b04c726 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522.test
@@ -3,6 +3,8 @@
 
 -- source include/have_innodb.inc
 
+call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists.  Please DISCARD the tablespace before IMPORT.");
+
 --disable_warnings
 DROP TABLE IF EXISTS t1;
 --enable_warnings
diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index 2e7306c..79a00c2 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -31,8 +31,15 @@ set optimizer_switch = 'mrr=on,mrr_sort_keys=on,index_condition_pushdown=on';
 # the test to be run multiple times without restarting the mysqld server.
 # See Bug#43309 Test main.innodb can't be run twice
 -- disable_query_log
+call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
+call mtr.add_suppression("\\[ERROR\\] InnoDB: in ALTER TABLE `test`.`t1`");
+call mtr.add_suppression("\\[ERROR\\] InnoDB: in RENAME TABLE table `test`.`t1`");
+
+SET @innodb_thread_sleep_delay_orig = @@innodb_thread_sleep_delay;
+
 SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency;
 
+--disable_warnings
 SET @innodb_rows_deleted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted');
 SET @innodb_rows_inserted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted');
 SET @innodb_rows_updated_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated');
@@ -41,6 +48,7 @@ SET @innodb_row_lock_current_waits_orig = (SELECT variable_value FROM informatio
 SET @innodb_row_lock_time_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time');
 SET @innodb_row_lock_time_max_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max');
 SET @innodb_row_lock_time_avg_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg');
+--enable_warnings
 -- enable_query_log
 
 --disable_warnings
@@ -677,6 +685,8 @@ drop table t1;
 # Test of multi-table-delete
 #
 
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
+
 CREATE TABLE t1 (
   number bigint(20) NOT NULL default '0',
   cname char(15) NOT NULL default '',
@@ -720,6 +730,7 @@ select * from t1;
 select * from t2; 
 select * from t2;
 drop table t1,t2;
+SET sql_mode = default;
 
 #
 # A simple test with some isolation levels
@@ -1056,18 +1067,84 @@ UPDATE t1 SET c1 = 'other' WHERE c1 = 'old';
 DROP TABLE t2,t1;
 
 #
-# test for recursion depth limit
+# test for FK cascade depth limit
 #
+call mtr.add_suppression("Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 255. Please drop excessive foreign constraints and try again");
+
 create table t1(
 	id int primary key,
 	pid int,
 	index(pid),
 	foreign key(pid) references t1(id) on delete cascade) engine=innodb;
-insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
-	(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
--- error 1451
+insert into t1 values
+(  0,   0), (  1,   0), (  2,   1), (  3,   2),
+(  4,   3), (  5,   4), (  6,   5), (  7,   6),
+(  8,   7), (  9,   8), ( 10,   9), ( 11,  10),
+( 12,  11), ( 13,  12), ( 14,  13), ( 15,  14),
+( 16,  15), ( 17,  16), ( 18,  17), ( 19,  18),
+( 20,  19), ( 21,  20), ( 22,  21), ( 23,  22),
+( 24,  23), ( 25,  24), ( 26,  25), ( 27,  26),
+( 28,  27), ( 29,  28), ( 30,  29), ( 31,  30),
+( 32,  31), ( 33,  32), ( 34,  33), ( 35,  34),
+( 36,  35), ( 37,  36), ( 38,  37), ( 39,  38),
+( 40,  39), ( 41,  40), ( 42,  41), ( 43,  42),
+( 44,  43), ( 45,  44), ( 46,  45), ( 47,  46),
+( 48,  47), ( 49,  48), ( 50,  49), ( 51,  50),
+( 52,  51), ( 53,  52), ( 54,  53), ( 55,  54),
+( 56,  55), ( 57,  56), ( 58,  57), ( 59,  58),
+( 60,  59), ( 61,  60), ( 62,  61), ( 63,  62),
+( 64,  63), ( 65,  64), ( 66,  65), ( 67,  66),
+( 68,  67), ( 69,  68), ( 70,  69), ( 71,  70),
+( 72,  71), ( 73,  72), ( 74,  73), ( 75,  74),
+( 76,  75), ( 77,  76), ( 78,  77), ( 79,  78),
+( 80,  79), ( 81,  80), ( 82,  81), ( 83,  82),
+( 84,  83), ( 85,  84), ( 86,  85), ( 87,  86),
+( 88,  87), ( 89,  88), ( 90,  89), ( 91,  90),
+( 92,  91), ( 93,  92), ( 94,  93), ( 95,  94),
+( 96,  95), ( 97,  96), ( 98,  97), ( 99,  98),
+(100,  99), (101, 100), (102, 101), (103, 102),
+(104, 103), (105, 104), (106, 105), (107, 106),
+(108, 107), (109, 108), (110, 109), (111, 110),
+(112, 111), (113, 112), (114, 113), (115, 114),
+(116, 115), (117, 116), (118, 117), (119, 118),
+(120, 119), (121, 120), (122, 121), (123, 122),
+(124, 123), (125, 124), (126, 125), (127, 126),
+(128, 127), (129, 128), (130, 129), (131, 130),
+(132, 131), (133, 132), (134, 133), (135, 134),
+(136, 135), (137, 136), (138, 137), (139, 138),
+(140, 139), (141, 140), (142, 141), (143, 142),
+(144, 143), (145, 144), (146, 145), (147, 146),
+(148, 147), (149, 148), (150, 149), (151, 150),
+(152, 151), (153, 152), (154, 153), (155, 154),
+(156, 155), (157, 156), (158, 157), (159, 158),
+(160, 159), (161, 160), (162, 161), (163, 162),
+(164, 163), (165, 164), (166, 165), (167, 166),
+(168, 167), (169, 168), (170, 169), (171, 170),
+(172, 171), (173, 172), (174, 173), (175, 174),
+(176, 175), (177, 176), (178, 177), (179, 178),
+(180, 179), (181, 180), (182, 181), (183, 182),
+(184, 183), (185, 184), (186, 185), (187, 186),
+(188, 187), (189, 188), (190, 189), (191, 190),
+(192, 191), (193, 192), (194, 193), (195, 194),
+(196, 195), (197, 196), (198, 197), (199, 198),
+(200, 199), (201, 200), (202, 201), (203, 202),
+(204, 203), (205, 204), (206, 205), (207, 206),
+(208, 207), (209, 208), (210, 209), (211, 210),
+(212, 211), (213, 212), (214, 213), (215, 214),
+(216, 215), (217, 216), (218, 217), (219, 218),
+(220, 219), (221, 220), (222, 221), (223, 222),
+(224, 223), (225, 224), (226, 225), (227, 226),
+(228, 227), (229, 228), (230, 229), (231, 230),
+(232, 231), (233, 232), (234, 233), (235, 234),
+(236, 235), (237, 236), (238, 237), (239, 238),
+(240, 239), (241, 240), (242, 241), (243, 242),
+(244, 243), (245, 244), (246, 245), (247, 246),
+(248, 247), (249, 248), (250, 249), (251, 250),
+(252, 251), (253, 252), (254, 253), (255, 254);
+--error 1296,1451
 delete from t1 where id=0;
-delete from t1 where id=15;
+delete from t1 where id=255;
+--error 0,1451
 delete from t1 where id=0;
 
 drop table t1;
@@ -1279,6 +1356,9 @@ drop table t1;
 
 create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb;
 insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
+-- disable_result_log
+analyze table t1;
+-- enable_result_log
 select * from t1 order by a,b,c,d;
 explain select * from t1 order by a,b,c,d;
 drop table t1;
@@ -1342,10 +1422,12 @@ source include/varchar.inc;
 #
 # Some errors/warnings on create
 #
-
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
 # Embedded server doesn't chdir to data directory
 --replace_result $MYSQLTEST_VARDIR . master-data/ ''
+SET GLOBAL innodb_large_prefix=OFF;
 create table t1 (v varchar(65530), key(v));
+SET GLOBAL innodb_large_prefix=default;
 drop table t1;
 create table t1 (v varchar(65536));
 show create table t1;
@@ -1353,8 +1435,8 @@ drop table t1;
 create table t1 (v varchar(65530) character set utf8);
 show create table t1;
 drop table t1;
-
-eval set storage_engine=$default;
+SET sql_mode = default;
+eval set default_storage_engine=$default;
 
 # InnoDB specific varchar tests
 create table t1 (v varchar(16384)) engine=innodb;
@@ -1459,7 +1541,7 @@ CREATE TABLE t1
  id INT PRIMARY KEY
 ) ENGINE=InnoDB;
 
---error 1005,1005
+--error ER_CANNOT_ADD_FOREIGN,1005
 CREATE TEMPORARY TABLE t2
 (
  id INT NOT NULL PRIMARY KEY,
@@ -1500,6 +1582,8 @@ show create table t9;
 
 drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
 
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
+SET GLOBAL innodb_large_prefix=OFF;
 # these should have their index length trimmed
 create table t1 (col1 varchar(768), index(col1))
  character set = latin1 engine = innodb;
@@ -1509,25 +1593,28 @@ create table t3 (col1 text, index(col1(768)))
  character set = latin1 engine = innodb;
 create table t4 (col1 blob, index(col1(768)))
  character set = latin1 engine = innodb;
+SET GLOBAL innodb_large_prefix=default;
 
 show create table t1;
 
 drop table t1, t2, t3, t4;
 
 # these should be refused
---error 1071
+set global innodb_large_prefix=OFF;
+--error ER_TOO_LONG_KEY
 create table t1 (col1 varchar(768) primary key)
  character set = latin1 engine = innodb;
---error 1071
+--error ER_TOO_LONG_KEY
 create table t2 (col1 varbinary(768) primary key)
  character set = latin1 engine = innodb;
---error 1071
+--error ER_TOO_LONG_KEY
 create table t3 (col1 text, primary key(col1(768)))
  character set = latin1 engine = innodb;
---error 1071
+--error ER_TOO_LONG_KEY
 create table t4 (col1 blob, primary key(col1(768)))
  character set = latin1 engine = innodb;
-
+SET sql_mode = default;
+set global innodb_large_prefix=default;
 #
 # Test improved foreign key error messages (bug #3443)
 #
@@ -1552,7 +1639,7 @@ INSERT INTO t2 VALUES(1);
 --error 1451
 DELETE FROM t1 WHERE id = 1;
 
---error 1451
+--error 1451, 1217
 DROP TABLE t1;
 
 SET FOREIGN_KEY_CHECKS=0;
@@ -1719,7 +1806,7 @@ create table t1 (a varchar(255) character set utf8,
 
 
 # test the padding of BINARY types and collations (Bug #14189)
-
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
 create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb;
 create table t2 (s1 binary(2),primary key (s1)) engine=innodb;
 create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
@@ -1803,7 +1890,7 @@ ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a);
 ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0;
 SHOW CREATE TABLE t2;
 DROP TABLE t2,t1;
-
+SET sql_mode = default;
 #
 # Test case for bug #16229: MySQL/InnoDB uses full explicit table locks in trigger processing
 #
@@ -2344,8 +2431,9 @@ DROP TABLE t1,t2;
 #
 # Bug #21101 (Prints wrong error message if max row size is too large)
 #
-set innodb_strict_mode=on;
---error 1118
+SET innodb_strict_mode=ON;
+--replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid}
+--error ER_TOO_BIG_ROWSIZE
 CREATE TABLE t1 (
 	c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
 	c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
@@ -2356,6 +2444,7 @@ CREATE TABLE t1 (
 	c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
 	c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
 	) ENGINE = InnoDB;
+SET innodb_strict_mode=OFF;
 
 #
 # Bug #31860 InnoDB assumes AUTOINC values can only be positive.
@@ -2512,6 +2601,7 @@ DROP TABLE bug35537;
 DISCONNECT c1;
 CONNECTION default;
 
+SET GLOBAL innodb_thread_sleep_delay = @innodb_thread_sleep_delay_orig;
 SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
 
 -- enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test
deleted file mode 100644
index 8553d97..0000000
--- a/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test
+++ /dev/null
@@ -1,52 +0,0 @@
---source include/not_embedded.inc
---source include/not_crashrep.inc
---source include/have_innodb.inc
-
-call mtr.add_suppression("InnoDB: The total blob data length");
-
-let $old_max_allowed_packet = `select @@max_allowed_packet`;
-SET GLOBAL max_allowed_packet = 100*1024*1024;
-
-connect(big_packets,localhost,root,,);
-connection big_packets;
-
-CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB;
-
-# Insert a few rows (it doesn't really matter how many). These transactions
-# are committed once they are acked, so they should not be lost.
-INSERT INTO t1 (a, b) VALUES (1, '1');
-INSERT INTO t1 (a, b) VALUES (2, '2');
-INSERT INTO t1 (a, b) VALUES (3, '3');
-INSERT INTO t1 (a, b) VALUES (4, '4');
-INSERT INTO t1 (a, b) VALUES (5, '5');
-
-# The BLOB insert will fail, and should disappear. However all data committed
-# up to this point should not be lost.
-start transaction;
---replace_regex /\(> [0-9]*\)/(> ####)/
---error ER_TOO_BIG_ROWSIZE
-INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024));
-
-connection default;
-
-# We expect a restart.
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
---echo # Quick shutdown and restart server
---shutdown_server 0
-
-# Wait for the server to come back up, and reconnect.
---enable_reconnect
---source include/wait_until_connected_again.inc
-
-connection default;
-
-# We should see (1,2,3,4,5) here.
-SELECT a FROM t1;
-
-# Clean up.
-DROP TABLE t1;
-
---disable_query_log
-eval set global max_allowed_packet = $old_max_allowed_packet;
---enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test
index 235ece0..9a96f29 100644
--- a/mysql-test/suite/innodb/t/innodb_bug12400341.test
+++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test
@@ -14,10 +14,8 @@ if (`select count(*)=0 from information_schema.global_variables where variable_n
 # undo slots of the previous test might exist still
 --source include/not_windows.inc
 
-# Previous undo slots cause unnecessary failures
---source include/not_windows.inc
-
 call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too*");
+call mtr.add_suppression("\\[Warning\\] InnoDB: Cannot find a free slot for an undo log. Do you have too");
 
 --disable_query_log
 set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug;
diff --git a/mysql-test/suite/innodb/t/innodb_bug12902967.test b/mysql-test/suite/innodb/t/innodb_bug12902967.test
index 8e1b819..1b5df7f 100644
--- a/mysql-test/suite/innodb/t/innodb_bug12902967.test
+++ b/mysql-test/suite/innodb/t/innodb_bug12902967.test
@@ -9,6 +9,8 @@
 --source include/have_innodb.inc
 --source include/not_embedded.inc
 
+call mtr.add_suppression("In ALTER TABLE .* has or is referenced in foreign key constraints which are not compatible with the new table definition.");
+
 let error_log= $MYSQLTEST_VARDIR/log/mysqld.1.err;
 --source include/restart_mysqld.inc
 
@@ -20,11 +22,4 @@ create table t1 (f1 integer primary key) engine innodb;
 --replace_regex /'\.\/test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
 --error ER_ERROR_ON_RENAME
 alter table t1 add constraint c1 foreign key (f1) references t1(f1);
---source include/restart_mysqld.inc
-perl;
-$file = $ENV{error_log};
-open (FILE, '<', $file) or die "can't open(< $file): $!\n";
-print ((grep { /^InnoDB:/ and not /aio/i and not /io_setup\(\) attempt [0-9]+ failed/ } <FILE>)[-2..-1]);
-EOF
-
 drop table t1;
diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt b/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt
index 6b82bac..4107382 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt
+++ b/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt
@@ -1 +1,4 @@
---innodb_file_per_table=1 --skip-stack-trace --skip-core-file
+--innodb_file_per_table=1
+--skip-stack-trace
+--skip-core-file
+--loose-innodb_buffer_pool_load_at_startup=OFF
diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test
index 16e8882..c73571a 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14147491.test
+++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test
@@ -1,41 +1,29 @@
 #
 # Test opening a corrupted table.
 #
-
--- source include/not_encrypted.inc
-
-call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*");
-
-# Don't test under valgrind, memory leaks will occur
+# Valgrind can hang or return spurious messages on DBUG_SUICIDE
 source include/not_valgrind.inc;
 # Avoid CrashReporter popup on Mac
 source include/not_crashrep.inc;
-# Don't test under embedded
+# Restarting is not supported under embedded
 source include/not_embedded.inc;
 # Require InnoDB
 source include/have_innodb.inc;
 # Require Debug for SET DEBUG
 source include/have_debug.inc;
+# Not encrypted tables
+source include/not_encrypted.inc;
 # Test could open crash reporter on Windows 
 # if compiler set up
 source include/not_windows.inc;
 
-CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
-CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
-CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed");
-CALL mtr.add_suppression("InnoDB: Space .* file test/t1 read of page .*");
-CALL mtr.add_suppression("InnoDB: You may have to recover from a backup.");
-CALL mtr.add_suppression("InnoDB: It is also possible that your operatingsystem has corrupted its own file cache.");
-CALL mtr.add_suppression("InnoDB: and rebooting your computer removes the error.");
-CALL mtr.add_suppression("InnoDB: If the corrupt page is an index page you can also try to");
-CALL mtr.add_suppression("InnoDB: fix the corruption by dumping, dropping, and reimporting");
-CALL mtr.add_suppression("InnoDB: the corrupt table. You can use CHECK");
-CALL mtr.add_suppression("InnoDB: TABLE to scan your table for corruption.");
-CALL mtr.add_suppression("InnoDB: See also .* about forcing recovery.");
-
-
---echo # Create and populate the table to be corrupted
-CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
+--disable_query_log
+CALL mtr.add_suppression("\\[ERROR\\] \\[FATAL\\] InnoDB: Unable to read page \\[page id: space=.*, page number=.*\\] into the buffer pool after 100 attempts");
+CALL mtr.add_suppression("\\[ERROR\\] InnoDB: Database page corruption on disk or a failed");
+--enable_query_log
+
+
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=InnoDB;
 INSERT INTO t1 (b) VALUES ('corrupt me');
 --disable_query_log
 --let $i = 10
@@ -50,17 +38,7 @@ INSERT INTO t1 (b) VALUES ('corrupt me');
 let $MYSQLD_DATADIR=`select @@datadir`;
 let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
 
---echo # Write file to make mysql-test-run.pl expect the "crash", but don't
---echo # start it until it's told to
---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-
---echo # We give 30 seconds to do a clean shutdown because we do not want
---echo # to redo apply the pages of t1.ibd at the time of recovery.
---echo # We want SQL to initiate the first access to t1.ibd.
-shutdown_server 30;
-
---echo # Wait until disconnected.
---source include/wait_until_disconnected.inc
+--source include/shutdown_mysqld.inc
 
 --echo # Backup the t1.ibd before corrupting
 --copy_file $t1_IBD $MYSQLD_DATADIR/test/t1.ibd.backup
@@ -92,10 +70,7 @@ while ($len = sysread IBD_FILE, $chunk, 1024)
 close IBD_FILE;
 EOF
 
---echo # Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
+--source include/start_mysqld.inc
 
 SET DEBUG_DBUG = '+d,innodb_page_corruption_retries';
 
@@ -117,10 +92,7 @@ SLEEP 1;
 --remove_file $MYSQLD_DATADIR/test/t1.ibd
 --move_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
 
---echo # Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---enable_reconnect
---source include/wait_until_connected_again.inc
+--source include/start_mysqld.inc
 
 # Note SET DEBUG = '-d,innodb_page_corruption_retries' is not required
 # because the session information is lost after server restart
diff --git a/mysql-test/suite/innodb/t/innodb_bug30423.test b/mysql-test/suite/innodb/t/innodb_bug30423.test
index bbb6f11..de53a93 100644
--- a/mysql-test/suite/innodb/t/innodb_bug30423.test
+++ b/mysql-test/suite/innodb/t/innodb_bug30423.test
@@ -139,6 +139,7 @@ analyze table bug30243_3;
 
 # Following query plan shows that we get the correct rows per
 # unique value (should be approximately 1 row per value)
+-- replace_column 9 ROWS
 explain SELECT COUNT(*), 0
 	FROM bug30243_1 orgs
 	LEFT JOIN bug30243_3 sa_opportunities
@@ -159,6 +160,7 @@ analyze table bug30243_3;
 
 # Following query plan shows that we get the correct rows per
 # unique value (~1)
+-- replace_column 9 ROWS
 explain SELECT COUNT(*), 0
 	FROM bug30243_1 orgs
 	LEFT JOIN bug30243_3 sa_opportunities
diff --git a/mysql-test/suite/innodb/t/innodb_bug34053.test b/mysql-test/suite/innodb/t/innodb_bug34053.test
index 56c26ac..d93d510 100644
--- a/mysql-test/suite/innodb/t/innodb_bug34053.test
+++ b/mysql-test/suite/innodb/t/innodb_bug34053.test
@@ -5,7 +5,7 @@
 -- source include/not_embedded.inc
 -- source include/have_innodb.inc
 
-SET storage_engine=InnoDB;
+SET default_storage_engine=InnoDB;
 
 # we do not really care about what gets printed, we are only
 # interested in getting success or failure according to our
@@ -20,8 +20,12 @@ FLUSH PRIVILEGES;
 
 -- connection con1
 -- error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET GLOBAL innodb_status_output=ON;
+-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET GLOBAL innodb_status_output_locks=ON;
+
 CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB;
-# this should only fail with UNIV_MEM_DEBUG
+DROP TABLE innodb_monitor;
 CREATE TABLE innodb_mem_validate (a INT) ENGINE=INNODB;
 DROP TABLE innodb_mem_validate;
 CREATE TABLE innodb_sql (a INT) ENGINE=INNODB;
@@ -36,16 +40,18 @@ CREATE TABLE nnodb_monitor (a INT) ENGINE=INNODB;
 DROP TABLE nnodb_monitor;
 
 -- connection default
-CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB;
-CREATE TABLE innodb_mem_validate (a INT) ENGINE=INNODB;
+SET GLOBAL innodb_status_output=ON;
+SET GLOBAL innodb_status_output_locks=ON;
 
 -- connection con1
 -- error ER_SPECIFIC_ACCESS_DENIED_ERROR
-DROP TABLE innodb_monitor;
-DROP TABLE innodb_mem_validate;
+SET GLOBAL innodb_status_output=OFF;
+-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET GLOBAL innodb_status_output_locks=OFF;
 
 -- connection default
-DROP TABLE innodb_monitor;
+SET GLOBAL innodb_status_output=OFF;
+SET GLOBAL innodb_status_output_locks=OFF;
 DROP USER 'shane'@'localhost';
 
 -- disconnect con1
diff --git a/mysql-test/suite/innodb/t/innodb_bug34300.test b/mysql-test/suite/innodb/t/innodb_bug34300.test
index 13c708b..8c73af1 100644
--- a/mysql-test/suite/innodb/t/innodb_bug34300.test
+++ b/mysql-test/suite/innodb/t/innodb_bug34300.test
@@ -1,35 +1,26 @@
-#
-# Bug#34300 Tinyblob & tinytext fields currupted after export/import and alter in 5.1
-# http://bugs.mysql.com/34300
-#
+--echo #
+--echo # Bug#34300 Tinyblob & tinytext fields currupted after export/import and alter in 5.1
+--echo #
 
 -- source include/have_innodb.inc
 
-if (`select plugin_auth_version <= "5.6.22-MariaDB-72.0" from information_schema.plugins where plugin_name='innodb'`)
-{
-  --skip Not fixed in XtraDB as of 5.6.22-MariaDB-72.0 or earlier
-}
-
 -- disable_query_log
--- disable_result_log
-
-call mtr.add_suppression("InnoDB: The total blob data length");
+call mtr.add_suppression("InnoDB: Warning: a long semaphore wait:");
+call mtr.add_suppression("The age of the last checkpoint is");
 
 # set packet size and reconnect 
 let $max_packet=`select @@global.max_allowed_packet`;
+-- enable_query_log
+
 SET @@global.max_allowed_packet=16777216;
 --connect (newconn, localhost, root,,)
 
---enable_result_log
-
 CREATE TABLE bug34300 (
   f4 TINYTEXT,
   f6 MEDIUMTEXT,
   f8 TINYBLOB
 ) ENGINE=InnoDB;
 
---replace_regex /\(> [0-9]*\)/(> ####)/
---error ER_TOO_BIG_ROWSIZE
 INSERT INTO bug34300 VALUES ('xxx', repeat('a', 8459264), 'zzz');
 
 SELECT f4, f8 FROM bug34300;
@@ -38,5 +29,10 @@ ALTER TABLE bug34300 ADD COLUMN (f10 INT);
 
 SELECT f4, f8 FROM bug34300;
 
+--echo # Cleanup
 DROP TABLE bug34300;
+
+-- disable_query_log
 EVAL SET @@global.max_allowed_packet=$max_packet;
+-- enable_query_log
+
diff --git a/mysql-test/suite/innodb/t/innodb_bug60049-master.opt b/mysql-test/suite/innodb/t/innodb_bug60049-master.opt
index 741d868..22a5d4e 100644
--- a/mysql-test/suite/innodb/t/innodb_bug60049-master.opt
+++ b/mysql-test/suite/innodb/t/innodb_bug60049-master.opt
@@ -1 +1 @@
---loose-innodb-fast-shutdown=0
+--innodb_fast_shutdown=0
diff --git a/mysql-test/suite/innodb/t/innodb_bug60049.test b/mysql-test/suite/innodb/t/innodb_bug60049.test
index b1d56d1..cb05ca2 100644
--- a/mysql-test/suite/innodb/t/innodb_bug60049.test
+++ b/mysql-test/suite/innodb/t/innodb_bug60049.test
@@ -5,12 +5,11 @@
 -- source include/not_embedded.inc
 -- source include/have_innodb.inc
 -- source include/have_innodb_16k.inc
--- source include/not_encrypted.inc
-
-call mtr.add_suppression('InnoDB: Error: Table "mysql"."innodb_(table|index)_stats" not found');
-call mtr.add_suppression('InnoDB: Error: Fetch of persistent statistics requested');
 
 -- disable_query_log
+call mtr.add_suppression('\\[ERROR\\] InnoDB: Table `mysql`.`innodb_(table|index)_stats` not found');
+call mtr.add_suppression('\\[ERROR\\] InnoDB: Fetch of persistent statistics requested for table `mysql`.`gtid_executed`');
+
 let $create1 = query_get_value(SHOW CREATE TABLE mysql.innodb_table_stats, Create Table, 1);
 let $create2 = query_get_value(SHOW CREATE TABLE mysql.innodb_index_stats, Create Table, 1);
 DROP TABLE mysql.innodb_index_stats;
@@ -23,10 +22,7 @@ DROP TABLE u;
 SELECT @@innodb_fast_shutdown;
 let $MYSQLD_DATADIR=`select @@datadir`;
 
-# Shut down the server
--- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--- shutdown_server 30
--- source include/wait_until_disconnected.inc
+--source include/shutdown_mysqld.inc
 
 # Check the tail of ID_IND (SYS_TABLES.ID)
 let IBDATA1=$MYSQLD_DATADIR/ibdata1;
@@ -45,10 +41,7 @@ close(FILE);
 print unpack("H*", $_), "\n";
 EOF
 
-# Restart the server.
--- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--- enable_reconnect
--- source include/wait_until_connected_again.inc
+--source include/start_mysqld.inc
 
 -- disable_query_log
 USE mysql;
diff --git a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
index ee04e8d..52a318f 100644
--- a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
+++ b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test
@@ -2,32 +2,28 @@
 # Test for persistent corrupt bit for corrupted index and table
 #
 -- source include/have_innodb.inc
-#-- source include/have_innodb_16k.inc
--- source include/not_embedded.inc
+--source include/not_embedded.inc
 # This test needs debug server
 -- source include/have_debug.inc
 
--- disable_query_log
-call mtr.add_suppression("Flagged corruption of idx.*in");
+--disable_query_log
+call mtr.add_suppression("Flagged corruption of.* in table .* in .*");
+--enable_query_log
 
 set names utf8;
 
-SET UNIQUE_CHECKS=0;
-
 CREATE TABLE corrupt_bit_test_ā(
        a INT AUTO_INCREMENT PRIMARY KEY,
        b CHAR(100),
        c INT,
        z INT,
        INDEX idx(b))
-ENGINE=InnoDB;
+ENGINE=InnoDB STATS_PERSISTENT=0;
 
 INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1);
 
-# This is the first unique index we intend to corrupt
 CREATE UNIQUE INDEX idxā ON corrupt_bit_test_ā(c, b);
 
-# This is the second unique index we intend to corrupt
 CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b);
 
 SELECT * FROM corrupt_bit_test_ā;
@@ -37,9 +33,9 @@ INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
 select count(*) from corrupt_bit_test_ā;
 
 # This will flag all secondary indexes corrupted
-SET SESSION debug_dbug="+d,dict_set_index_corrupted";
+SET SESSION debug="+d,dict_set_index_corrupted";
 check table corrupt_bit_test_ā;
-SET SESSION debug_dbug="";
+SET SESSION debug="-d,dict_set_index_corrupted";
 
 # Cannot create new indexes while corrupted indexes exist
 --error ER_INDEX_CORRUPT
@@ -79,8 +75,6 @@ set names utf8;
 -- error ER_INDEX_CORRUPT
 select z from corrupt_bit_test_ā;
 
-show create table corrupt_bit_test_ā;
-
 # Drop the corrupted index
 drop index idxē on corrupt_bit_test_ā;
 
@@ -90,13 +84,13 @@ CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
 --error ER_INDEX_CORRUPT
 CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
 
-show create table corrupt_bit_test_ā;
 drop index idx on corrupt_bit_test_ā;
 
 # Now that there exist no corrupted indexes, we can create new indexes.
 CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
 CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
 
+
 # Now select back to normal
 select z from corrupt_bit_test_ā limit 10;
 
diff --git a/mysql-test/suite/innodb/t/innodb_gis.test b/mysql-test/suite/innodb/t/innodb_gis.test
index 1adb14e..45d66d9 100644
--- a/mysql-test/suite/innodb/t/innodb_gis.test
+++ b/mysql-test/suite/innodb/t/innodb_gis.test
@@ -6,5 +6,8 @@ SET storage_engine=innodb;
 #
 # Bug #15680 (SPATIAL key in innodb)
 #
---error ER_TABLE_CANT_HANDLE_SPKEYS
+# MySQL 5.7 Introduces SPATIAL keys for InnoDB
+#--error ER_TABLE_CANT_HANDLE_SPKEYS
 create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
+drop table t1;
+
diff --git a/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test b/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test
index c932e45..5d36cfd 100644
--- a/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test
+++ b/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test
@@ -10,8 +10,8 @@
 -- source include/have_innodb_16k.inc
 -- source include/not_embedded.inc
 
-call mtr.add_suppression("InnoDB: Error: Table \"mysql\".\"innodb_index_stats\" not found");
-call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table");
+call mtr.add_suppression("InnoDB: Table .*innodb_index_stats.* not found");
+call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table .*");
 
 -- vertical_results
 
diff --git a/mysql-test/suite/innodb/t/innodb_stats_fetch_corrupted.test b/mysql-test/suite/innodb/t/innodb_stats_fetch_corrupted.test
index 4a3f752..81fd52c 100644
--- a/mysql-test/suite/innodb/t/innodb_stats_fetch_corrupted.test
+++ b/mysql-test/suite/innodb/t/innodb_stats_fetch_corrupted.test
@@ -8,8 +8,8 @@
 # test with 16k page size.
 -- source include/have_innodb_16k.inc
 
-call mtr.add_suppression("InnoDB: Error: Table \"mysql\".\"innodb_index_stats\" not found");
-call mtr.add_suppression("InnoDB: Error: Fetch of persistent statistics requested for table");
+call mtr.add_suppression("InnoDB: Table \"mysql\".\"innodb_index_stats\" not found");
+call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table.*");
 
 -- vertical_results
 
diff --git a/mysql-test/suite/innodb/t/strict_mode.test b/mysql-test/suite/innodb/t/strict_mode.test
index 86b56a0..48fc1ef 100644
--- a/mysql-test/suite/innodb/t/strict_mode.test
+++ b/mysql-test/suite/innodb/t/strict_mode.test
@@ -5,6 +5,8 @@
 --echo # INNODB_STRICT_MODE = 1
 --echo #
 
+call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
+
 set innodb_strict_mode = 0;
 
 create table t1 (id int auto_increment primary key,
diff --git a/mysql-test/suite/rpl/disabled.def b/mysql-test/suite/rpl/disabled.def
index de3091a..c879947 100644
--- a/mysql-test/suite/rpl/disabled.def
+++ b/mysql-test/suite/rpl/disabled.def
@@ -13,3 +13,6 @@
 rpl_spec_variables        : BUG#11755836 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
 rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock
 rpl_partition_archive     : MDEV-5077 2013-09-27 svoj Cannot exchange partition with archive table
+
+
+
diff --git a/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_parts_basic.result b/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_parts_basic.result
new file mode 100644
index 0000000..965e2ef
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_parts_basic.result
@@ -0,0 +1,48 @@
+SELECT COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts);
+COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts)
+1
+1 Expected
+SET @@GLOBAL.innodb_adaptive_hash_index_parts=1;
+ERROR HY000: Variable 'innodb_adaptive_hash_index_parts' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts);
+COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts)
+1
+1 Expected
+SELECT @@GLOBAL.innodb_adaptive_hash_index_parts = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_adaptive_hash_index_parts';
+@@GLOBAL.innodb_adaptive_hash_index_parts = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts);
+COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_adaptive_hash_index_parts';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+SELECT @@innodb_adaptive_hash_index_parts = @@GLOBAL.innodb_adaptive_hash_index_parts;
+@@innodb_adaptive_hash_index_parts = @@GLOBAL.innodb_adaptive_hash_index_parts
+1
+1 Expected
+SELECT COUNT(@@innodb_adaptive_hash_index_parts);
+COUNT(@@innodb_adaptive_hash_index_parts)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_adaptive_hash_index_parts);
+ERROR HY000: Variable 'innodb_adaptive_hash_index_parts' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_adaptive_hash_index_parts);
+ERROR HY000: Variable 'innodb_adaptive_hash_index_parts' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts);
+COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts)
+1
+1 Expected
+SELECT innodb_adaptive_hash_index_parts = @@SESSION.innodb_adaptive_hash_index_parts;
+ERROR 42S22: Unknown column 'innodb_adaptive_hash_index_parts' in 'field list'
+Expected error 'Readonly variable'
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
index 54b1c1e..b3ba28a 100644
--- 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
@@ -3,6 +3,18 @@ SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
 150000
 150000 Expected
 SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100;
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=0;
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+@@GLOBAL.innodb_adaptive_max_sleep_delay
+0
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100000;
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+@@GLOBAL.innodb_adaptive_max_sleep_delay
+100000
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000000;
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+@@GLOBAL.innodb_adaptive_max_sleep_delay
+1000000
 SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000001;
 Warnings:
 Warning	1292	Truncated incorrect innodb_adaptive_max_sleep_delay value: '1000001'
@@ -10,6 +22,13 @@ SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
 @@GLOBAL.innodb_adaptive_max_sleep_delay
 1000000
 1000000 Expected
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=4294967295;
+Warnings:
+Warning	1292	Truncated incorrect innodb_adaptive_max_sleep_delay value: '4294967295'
+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'
@@ -17,6 +36,13 @@ SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
 @@GLOBAL.innodb_adaptive_max_sleep_delay
 0
 0 Expected
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=-1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_adaptive_max_sleep_delay value: '-1024'
+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
diff --git a/mysql-test/suite/sys_vars/r/innodb_additional_mem_pool_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_additional_mem_pool_size_basic.result
deleted file mode 100644
index fb062d6..0000000
--- a/mysql-test/suite/sys_vars/r/innodb_additional_mem_pool_size_basic.result
+++ /dev/null
@@ -1,53 +0,0 @@
-'#---------------------BS_STVARS_020_01----------------------#'
-SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size);
-COUNT(@@GLOBAL.innodb_additional_mem_pool_size)
-1
-1 Expected
-'#---------------------BS_STVARS_020_02----------------------#'
-SET @@GLOBAL.innodb_additional_mem_pool_size=1;
-ERROR HY000: Variable 'innodb_additional_mem_pool_size' is a read only variable
-Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size);
-COUNT(@@GLOBAL.innodb_additional_mem_pool_size)
-1
-1 Expected
-'#---------------------BS_STVARS_020_03----------------------#'
-SELECT @@GLOBAL.innodb_additional_mem_pool_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_additional_mem_pool_size';
-@@GLOBAL.innodb_additional_mem_pool_size = VARIABLE_VALUE
-1
-1 Expected
-SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size);
-COUNT(@@GLOBAL.innodb_additional_mem_pool_size)
-1
-1 Expected
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='innodb_additional_mem_pool_size';
-COUNT(VARIABLE_VALUE)
-1
-1 Expected
-'#---------------------BS_STVARS_020_04----------------------#'
-SELECT @@innodb_additional_mem_pool_size = @@GLOBAL.innodb_additional_mem_pool_size;
-@@innodb_additional_mem_pool_size = @@GLOBAL.innodb_additional_mem_pool_size
-1
-1 Expected
-'#---------------------BS_STVARS_020_05----------------------#'
-SELECT COUNT(@@innodb_additional_mem_pool_size);
-COUNT(@@innodb_additional_mem_pool_size)
-1
-1 Expected
-SELECT COUNT(@@local.innodb_additional_mem_pool_size);
-ERROR HY000: Variable 'innodb_additional_mem_pool_size' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@SESSION.innodb_additional_mem_pool_size);
-ERROR HY000: Variable 'innodb_additional_mem_pool_size' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size);
-COUNT(@@GLOBAL.innodb_additional_mem_pool_size)
-1
-1 Expected
-SELECT innodb_additional_mem_pool_size = @@SESSION.innodb_additional_mem_pool_size;
-ERROR 42S22: Unknown column 'innodb_additional_mem_pool_size' in 'field list'
-Expected error 'Readonly variable'
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
index d2773b7..0bc17e1 100644
--- 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
@@ -42,6 +42,42 @@ 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;
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+1
+SET global innodb_api_bk_commit_interval=100000;
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+100000
+SET global innodb_api_bk_commit_interval=1073741824;
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+1073741824
+SET global innodb_api_bk_commit_interval=0;
+Warnings:
+Warning	1292	Truncated incorrect innodb_api_bk_commit_interval value: '0'
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+1
+SET global innodb_api_bk_commit_interval=-1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_api_bk_commit_interval value: '-1024'
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+1
+SET global innodb_api_bk_commit_interval=1073741825;
+Warnings:
+Warning	1292	Truncated incorrect innodb_api_bk_commit_interval value: '1073741825'
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+1073741824
+SET global innodb_api_bk_commit_interval=4294967295;
+Warnings:
+Warning	1292	Truncated incorrect innodb_api_bk_commit_interval value: '4294967295'
+SELECT @@global.innodb_api_bk_commit_interval;
+@@global.innodb_api_bk_commit_interval
+1073741824
 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;
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 900f016..6bcca05 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
@@ -53,6 +53,12 @@ Warning	1292	Truncated incorrect innodb_autoextend_increment value: '1001'
 SELECT @@global.innodb_autoextend_increment;
 @@global.innodb_autoextend_increment
 1000
+SET @@global.innodb_autoextend_increment  = 2000 ;
+Warnings:
+Warning	1292	Truncated incorrect innodb_autoextend_increment value: '2000'
+SELECT @@global.innodb_autoextend_increment;
+@@global.innodb_autoextend_increment
+1000
 '#----------------------FN_DYNVARS_046_05------------------------#'
 SELECT @@global.innodb_autoextend_increment  = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_chunk_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_chunk_size_basic.result
new file mode 100644
index 0000000..e9fd551
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_chunk_size_basic.result
@@ -0,0 +1,48 @@
+SELECT COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size);
+COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size)
+1
+1 Expected
+SET @@GLOBAL.innodb_buffer_pool_chunk_size=1;
+ERROR HY000: Variable 'innodb_buffer_pool_chunk_size' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size);
+COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size)
+1
+1 Expected
+SELECT @@GLOBAL.innodb_buffer_pool_chunk_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_buffer_pool_chunk_size';
+@@GLOBAL.innodb_buffer_pool_chunk_size = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size);
+COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_buffer_pool_chunk_size';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+SELECT @@innodb_buffer_pool_chunk_size = @@GLOBAL.innodb_buffer_pool_chunk_size;
+@@innodb_buffer_pool_chunk_size = @@GLOBAL.innodb_buffer_pool_chunk_size
+1
+1 Expected
+SELECT COUNT(@@innodb_buffer_pool_chunk_size);
+COUNT(@@innodb_buffer_pool_chunk_size)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_buffer_pool_chunk_size);
+ERROR HY000: Variable 'innodb_buffer_pool_chunk_size' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_buffer_pool_chunk_size);
+ERROR HY000: Variable 'innodb_buffer_pool_chunk_size' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size);
+COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size)
+1
+1 Expected
+SELECT innodb_buffer_pool_chunk_size = @@SESSION.innodb_buffer_pool_chunk_size;
+ERROR 42S22: Unknown column 'innodb_buffer_pool_chunk_size' in 'field list'
+Expected error 'Readonly variable'
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
index 26bb44b..ad329cd 100644
--- 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
@@ -1,7 +1,7 @@
 SET @orig = @@global.innodb_buffer_pool_dump_at_shutdown;
 SELECT @orig;
 @orig
-0
+1
 SET GLOBAL innodb_buffer_pool_dump_at_shutdown = OFF;
 SELECT @@global.innodb_buffer_pool_dump_at_shutdown;
 @@global.innodb_buffer_pool_dump_at_shutdown
@@ -16,3 +16,4 @@ 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
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = default;
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
index 51c72cf..b2cc55c 100644
--- 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
@@ -1,20 +1,35 @@
-SET @orig = @@global.innodb_buffer_pool_dump_pct;
-SELECT @orig;
- at 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
+25
+SET GLOBAL innodb_buffer_pool_dump_pct=20;
+SELECT @@global.innodb_buffer_pool_dump_pct;
+@@global.innodb_buffer_pool_dump_pct
+20
+SET GLOBAL innodb_buffer_pool_dump_pct=1;
 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;
+SET GLOBAL innodb_buffer_pool_dump_pct=100;
 SELECT @@global.innodb_buffer_pool_dump_pct;
 @@global.innodb_buffer_pool_dump_pct
 100
-SHOW WARNINGS;
-Level	Code	Message
+SET GLOBAL innodb_buffer_pool_dump_pct=101;
+Warnings:
 Warning	1292	Truncated incorrect innodb_buffer_pool_dump_pct value: '101'
-SET GLOBAL innodb_buffer_pool_dump_pct=@orig;
+SELECT @@global.innodb_buffer_pool_dump_pct;
+@@global.innodb_buffer_pool_dump_pct
+100
+SET GLOBAL innodb_buffer_pool_dump_pct=-1;
+Warnings:
+Warning	1292	Truncated incorrect innodb_buffer_pool_dump_pct value: '-1'
+SELECT @@global.innodb_buffer_pool_dump_pct;
+@@global.innodb_buffer_pool_dump_pct
+1
+SET GLOBAL innodb_buffer_pool_dump_pct=Default;
+SELECT @@global.innodb_buffer_pool_dump_pct;
+@@global.innodb_buffer_pool_dump_pct
+25
+SET GLOBAL innodb_buffer_pool_dump_pct='foo';
+ERROR 42000: Incorrect argument type to variable 'innodb_buffer_pool_dump_pct'
+SET innodb_buffer_pool_dump_pct=50;
+ERROR HY000: Variable 'innodb_buffer_pool_dump_pct' is a GLOBAL variable and should be set with SET GLOBAL
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
deleted file mode 100644
index 5e50a71..0000000
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_filename_basic.result
+++ /dev/null
@@ -1,7 +0,0 @@
-SET @orig = @@global.innodb_buffer_pool_filename;
-SELECT @orig;
- at 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_at_startup_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_at_startup_basic.result
index 1dad72b..cd4c924 100644
--- 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
@@ -1,7 +1,7 @@
 SET @orig = @@global.innodb_buffer_pool_load_at_startup;
 SELECT @orig;
 @orig
-0
+1
 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;
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result
index 27e6cae..e621016 100644
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_size_basic.result
@@ -1,12 +1,12 @@
+SET @start_buffer_pool_size = @@GLOBAL.innodb_buffer_pool_size;
 '#---------------------BS_STVARS_022_01----------------------#'
 SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size);
 COUNT(@@GLOBAL.innodb_buffer_pool_size)
 1
 1 Expected
 '#---------------------BS_STVARS_022_02----------------------#'
-SET @@GLOBAL.innodb_buffer_pool_size=1;
-ERROR HY000: Variable 'innodb_buffer_pool_size' is a read only variable
-Expected error 'Read only variable'
+SET @@GLOBAL.innodb_buffer_pool_size=10485760;
+Expected succeeded
 SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size);
 COUNT(@@GLOBAL.innodb_buffer_pool_size)
 1
@@ -51,3 +51,4 @@ COUNT(@@GLOBAL.innodb_buffer_pool_size)
 SELECT innodb_buffer_pool_size = @@SESSION.innodb_buffer_pool_size;
 ERROR 42S22: Unknown column 'innodb_buffer_pool_size' in 'field list'
 Expected error 'Readonly variable'
+SET @@GLOBAL.innodb_buffer_pool_size = @start_buffer_pool_size;
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
index 8e05db1..9c2e95b 100644
--- a/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_checksum_algorithm_basic.result
@@ -1,47 +1,47 @@
 SET @orig = @@global.innodb_checksum_algorithm;
 SELECT @orig;
 @orig
-INNODB
+crc32
 SET GLOBAL innodb_checksum_algorithm = 'crc32';
 SELECT @@global.innodb_checksum_algorithm;
 @@global.innodb_checksum_algorithm
-CRC32
+crc32
 SET GLOBAL innodb_checksum_algorithm = 'strict_crc32';
 SELECT @@global.innodb_checksum_algorithm;
 @@global.innodb_checksum_algorithm
-STRICT_CRC32
+strict_crc32
 SET GLOBAL innodb_checksum_algorithm = 'innodb';
 SELECT @@global.innodb_checksum_algorithm;
 @@global.innodb_checksum_algorithm
-INNODB
+innodb
 SET GLOBAL innodb_checksum_algorithm = 'strict_innodb';
 SELECT @@global.innodb_checksum_algorithm;
 @@global.innodb_checksum_algorithm
-STRICT_INNODB
+strict_innodb
 SET GLOBAL innodb_checksum_algorithm = 'none';
 SELECT @@global.innodb_checksum_algorithm;
 @@global.innodb_checksum_algorithm
-NONE
+none
 SET GLOBAL innodb_checksum_algorithm = 'strict_none';
 SELECT @@global.innodb_checksum_algorithm;
 @@global.innodb_checksum_algorithm
-STRICT_NONE
+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
+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
+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
+strict_none
 SET GLOBAL innodb_checksum_algorithm = @orig;
 SELECT @@global.innodb_checksum_algorithm;
 @@global.innodb_checksum_algorithm
-INNODB
+crc32
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
index 3ee9448..31bc11d 100644
--- 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
@@ -21,7 +21,6 @@ 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);
@@ -61,5 +60,4 @@ 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_commit_concurrency_basic.result b/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
index 85a4b00..4748188 100644
--- a/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_commit_concurrency_basic.result
@@ -28,14 +28,34 @@ SELECT @@global.innodb_commit_concurrency;
 '#--------------------FN_DYNVARS_046_04-------------------------#'
 SET @@global.innodb_commit_concurrency = 1;
 ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1'
+SELECT @@global.innodb_commit_concurrency;
+@@global.innodb_commit_concurrency
+0
 SET @@global.innodb_commit_concurrency = -1;
 ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '-1'
+SELECT @@global.innodb_commit_concurrency;
+@@global.innodb_commit_concurrency
+0
 SET @@global.innodb_commit_concurrency = "T";
 ERROR 42000: Incorrect argument type to variable 'innodb_commit_concurrency'
+SELECT @@global.innodb_commit_concurrency;
+@@global.innodb_commit_concurrency
+0
 SET @@global.innodb_commit_concurrency = "Y";
 ERROR 42000: Incorrect argument type to variable 'innodb_commit_concurrency'
+SELECT @@global.innodb_commit_concurrency;
+@@global.innodb_commit_concurrency
+0
+SET @@global.innodb_commit_concurrency = 1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_commit_concurrency'
+SELECT @@global.innodb_commit_concurrency;
+@@global.innodb_commit_concurrency
+0
 SET @@global.innodb_commit_concurrency = 1001;
 ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1001'
+SELECT @@global.innodb_commit_concurrency;
+@@global.innodb_commit_concurrency
+0
 '#----------------------FN_DYNVARS_046_05------------------------#'
 SELECT @@global.innodb_commit_concurrency =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
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
index 9f85ecc..ae556ce 100644
--- 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
@@ -45,6 +45,11 @@ ERROR 42000: Incorrect argument type to variable 'innodb_compression_failure_thr
 SELECT @@global.innodb_compression_failure_threshold_pct;
 @@global.innodb_compression_failure_threshold_pct
 0
+SET @@global.innodb_compression_failure_threshold_pct = 1.1;
+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;
@@ -56,6 +61,16 @@ Warning	1292	Truncated incorrect innodb_compression_failure_thres value: '101'
 SELECT @@global.innodb_compression_failure_threshold_pct;
 @@global.innodb_compression_failure_threshold_pct
 100
+SET @@global.innodb_compression_failure_threshold_pct = " ";
+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 = ' ';
+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_05------------------------#'
 SELECT @@global.innodb_compression_failure_threshold_pct =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
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
index 628993e..6735d87 100644
--- 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
@@ -40,12 +40,27 @@ 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 = 1.1;
+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
+SET @@global.innodb_compression_pad_pct_max = " ";
+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 = ' ';
+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_05------------------------#'
 SELECT @@global.innodb_compression_pad_pct_max =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
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 0b790fb..dd4488a 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
@@ -38,12 +38,31 @@ SELECT @@global.innodb_concurrency_tickets;
 @@global.innodb_concurrency_tickets
 4294967295
 '#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_concurrency_tickets = 4294967296;
+SELECT @@global.innodb_concurrency_tickets IN (4294967296,4294967295);
+@@global.innodb_concurrency_tickets IN (4294967296,4294967295)
+1
+SET @@global.innodb_concurrency_tickets = 12345678901;
+SELECT @@global.innodb_concurrency_tickets IN (12345678901,4294967295);
+@@global.innodb_concurrency_tickets IN (12345678901,4294967295)
+1
+SET @@global.innodb_concurrency_tickets = 18446744073709551615;
+SELECT @@global.innodb_concurrency_tickets IN (18446744073709551615,4294967295);
+@@global.innodb_concurrency_tickets IN (18446744073709551615,4294967295)
+1
+'#--------------------FN_DYNVARS_046_05-------------------------#'
 SET @@global.innodb_concurrency_tickets = -1;
 Warnings:
 Warning	1292	Truncated incorrect innodb_concurrency_tickets value: '-1'
 SELECT @@global.innodb_concurrency_tickets;
 @@global.innodb_concurrency_tickets
 1
+SET @@global.innodb_concurrency_tickets = -1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_concurrency_tickets value: '-1024'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
 SET @@global.innodb_concurrency_tickets = "T";
 ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
 SELECT @@global.innodb_concurrency_tickets;
@@ -54,11 +73,22 @@ ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
 SELECT @@global.innodb_concurrency_tickets;
 @@global.innodb_concurrency_tickets
 1
-SET @@global.innodb_concurrency_tickets = 1001;
+SET @@global.innodb_concurrency_tickets = 1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
 SELECT @@global.innodb_concurrency_tickets;
 @@global.innodb_concurrency_tickets
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
+1
+SET @@global.innodb_concurrency_tickets = " ";
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
+SET @@global.innodb_concurrency_tickets = ' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
+'#----------------------FN_DYNVARS_046_06------------------------#'
 SELECT @@global.innodb_concurrency_tickets =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_concurrency_tickets';
@@ -67,23 +97,23 @@ VARIABLE_VALUE
 1
 SELECT @@global.innodb_concurrency_tickets;
 @@global.innodb_concurrency_tickets
-1001
+1
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_concurrency_tickets';
 VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
+1
+'#---------------------FN_DYNVARS_046_07-------------------------#'
 SET @@global.innodb_concurrency_tickets = OFF;
 ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
 SELECT @@global.innodb_concurrency_tickets;
 @@global.innodb_concurrency_tickets
-1001
+1
 SET @@global.innodb_concurrency_tickets = ON;
 ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
 SELECT @@global.innodb_concurrency_tickets;
 @@global.innodb_concurrency_tickets
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
+1
+'#---------------------FN_DYNVARS_046_08----------------------#'
 SET @@global.innodb_concurrency_tickets = TRUE;
 SELECT @@global.innodb_concurrency_tickets;
 @@global.innodb_concurrency_tickets
diff --git a/mysql-test/suite/sys_vars/r/innodb_default_row_format_basic.result b/mysql-test/suite/sys_vars/r/innodb_default_row_format_basic.result
new file mode 100644
index 0000000..9710c3e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_default_row_format_basic.result
@@ -0,0 +1,48 @@
+SELECT  @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+dynamic
+SET GLOBAL innodb_default_row_format = 'redundant';
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+redundant
+SET GLOBAL innodb_default_row_format = 'dynamic';
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+dynamic
+SET GLOBAL innodb_default_row_format = 'compact';
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+compact
+SET GLOBAL innodb_default_row_format = 'compressed';
+ERROR 42000: Variable 'innodb_default_row_format' can't be set to the value of 'compressed'
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+compact
+SET GLOBAL innodb_default_row_format = 'foobar';
+ERROR 42000: Variable 'innodb_default_row_format' can't be set to the value of 'foobar'
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+compact
+SET GLOBAL innodb_default_row_format = 0;
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+redundant
+SET GLOBAL innodb_default_row_format = 1;
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+compact
+SET GLOBAL innodb_default_row_format = 2;
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+dynamic
+SET GLOBAL innodb_default_row_format = 3;
+ERROR 42000: Variable 'innodb_default_row_format' can't be set to the value of '3'
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+dynamic
+SET GLOBAL innodb_default_row_format = 123;
+ERROR 42000: Variable 'innodb_default_row_format' can't be set to the value of '123'
+SELECT @@global.innodb_default_row_format;
+@@global.innodb_default_row_format
+dynamic
+SET GLOBAL innodb_default_row_format = default;
diff --git a/mysql-test/suite/sys_vars/r/innodb_disable_resize_buffer_pool_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_disable_resize_buffer_pool_debug_basic.result
new file mode 100644
index 0000000..bbac9a4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_disable_resize_buffer_pool_debug_basic.result
@@ -0,0 +1,60 @@
+#
+# Basic test for innodb_disable_resize_buffer_pool_debug
+#
+SET @start_global_value = @@global.innodb_disable_resize_buffer_pool_debug;
+SET @@global.innodb_disable_resize_buffer_pool_debug = 0;
+SELECT @@global.innodb_disable_resize_buffer_pool_debug;
+@@global.innodb_disable_resize_buffer_pool_debug
+0
+SET @@global.innodb_disable_resize_buffer_pool_debug ='On' ;
+SELECT @@global.innodb_disable_resize_buffer_pool_debug;
+@@global.innodb_disable_resize_buffer_pool_debug
+1
+SET @@global.innodb_disable_resize_buffer_pool_debug ='Off' ;
+SELECT @@global.innodb_disable_resize_buffer_pool_debug;
+@@global.innodb_disable_resize_buffer_pool_debug
+0
+SET @@global.innodb_disable_resize_buffer_pool_debug = 1;
+SELECT @@global.innodb_disable_resize_buffer_pool_debug;
+@@global.innodb_disable_resize_buffer_pool_debug
+1
+SELECT IF(@@GLOBAL.innodb_disable_resize_buffer_pool_debug,'ON','OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_disable_resize_buffer_pool_debug';
+IF(@@GLOBAL.innodb_disable_resize_buffer_pool_debug,'ON','OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug);
+COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_disable_resize_buffer_pool_debug';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+SELECT @@innodb_disable_resize_buffer_pool_debug = @@GLOBAL.innodb_disable_resize_buffer_pool_debug;
+@@innodb_disable_resize_buffer_pool_debug = @@GLOBAL.innodb_disable_resize_buffer_pool_debug
+1
+1 Expected
+SELECT COUNT(@@innodb_disable_resize_buffer_pool_debug);
+COUNT(@@innodb_disable_resize_buffer_pool_debug)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_disable_resize_buffer_pool_debug);
+ERROR HY000: Variable 'innodb_disable_resize_buffer_pool_debug' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_disable_resize_buffer_pool_debug);
+ERROR HY000: Variable 'innodb_disable_resize_buffer_pool_debug' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug);
+COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug)
+1
+1 Expected
+SELECT innodb_disable_resize_buffer_pool_debug = @@SESSION.innodb_disable_resize_buffer_pool_debug;
+ERROR 42S22: Unknown column 'innodb_disable_resize_buffer_pool_debug' in 'field list'
+SET @@global.innodb_disable_resize_buffer_pool_debug = @start_global_value;
+SELECT @@global.innodb_disable_resize_buffer_pool_debug;
+@@global.innodb_disable_resize_buffer_pool_debug
+1
diff --git a/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result b/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
index fe09a65..38d5365 100644
--- a/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_fast_shutdown_basic.result
@@ -85,6 +85,21 @@ ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
 SELECT @@global.innodb_fast_shutdown;
 @@global.innodb_fast_shutdown
 0
+SET @@global.innodb_fast_shutdown = 1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
+SELECT @@global.innodb_fast_shutdown;
+@@global.innodb_fast_shutdown
+0
+SET @@global.innodb_fast_shutdown = ' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
+SELECT @@global.innodb_fast_shutdown;
+@@global.innodb_fast_shutdown
+0
+SET @@global.innodb_fast_shutdown = " ";
+ERROR 42000: Incorrect argument type to variable 'innodb_fast_shutdown'
+SELECT @@global.innodb_fast_shutdown;
+@@global.innodb_fast_shutdown
+0
 '#-------------------FN_DYNVARS_042_05----------------------------#'
 SET @@session.innodb_fast_shutdown = 0;
 ERROR HY000: Variable 'innodb_fast_shutdown' is a GLOBAL variable and should be set with SET GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result
index 58e009e..c330bbf 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result
@@ -1,29 +1,31 @@
 SET @start_global_value = @@global.innodb_file_format;
 SELECT @start_global_value;
 @start_global_value
-Antelope
+Barracuda
 Valid values are 'Antelope' and 'Barracuda' 
 select @@global.innodb_file_format in ('Antelope', 'Barracuda');
 @@global.innodb_file_format in ('Antelope', 'Barracuda')
 1
 select @@global.innodb_file_format;
 @@global.innodb_file_format
-Antelope
+Barracuda
 select @@session.innodb_file_format;
 ERROR HY000: Variable 'innodb_file_format' is a GLOBAL variable
 show global variables like 'innodb_file_format';
 Variable_name	Value
-innodb_file_format	Antelope
+innodb_file_format	Barracuda
 show session variables like 'innodb_file_format';
 Variable_name	Value
-innodb_file_format	Antelope
+innodb_file_format	Barracuda
 select * from information_schema.global_variables where variable_name='innodb_file_format';
 VARIABLE_NAME	VARIABLE_VALUE
-INNODB_FILE_FORMAT	Antelope
+INNODB_FILE_FORMAT	Barracuda
 select * from information_schema.session_variables where variable_name='innodb_file_format';
 VARIABLE_NAME	VARIABLE_VALUE
-INNODB_FILE_FORMAT	Antelope
+INNODB_FILE_FORMAT	Barracuda
 set global innodb_file_format='Antelope';
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@global.innodb_file_format;
 @@global.innodb_file_format
 Antelope
@@ -34,6 +36,8 @@ select * from information_schema.session_variables where variable_name='innodb_f
 VARIABLE_NAME	VARIABLE_VALUE
 INNODB_FILE_FORMAT	Antelope
 set @@global.innodb_file_format='Barracuda';
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@global.innodb_file_format;
 @@global.innodb_file_format
 Barracuda
@@ -54,6 +58,8 @@ ERROR 42000: Incorrect argument type to variable 'innodb_file_format'
 set global innodb_file_format='Salmon';
 ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Salmon'
 SET @@global.innodb_file_format = @start_global_value;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@global.innodb_file_format;
 @@global.innodb_file_format
-Antelope
+Barracuda
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
index 32b2262..5402e16 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_format_max_basic.result
@@ -1,31 +1,33 @@
 SET @start_global_value = @@global.innodb_file_format_max;
 SELECT @start_global_value;
 @start_global_value
-Antelope
+Barracuda
 Valid values are 'Antelope' and 'Barracuda' 
 SELECT @@global.innodb_file_format_max in ('Antelope', 'Barracuda');
 @@global.innodb_file_format_max in ('Antelope', 'Barracuda')
 1
 SELECT @@global.innodb_file_format_max;
 @@global.innodb_file_format_max
-Antelope
+Barracuda
 SELECT @@session.innodb_file_format_max;
 ERROR HY000: Variable 'innodb_file_format_max' is a GLOBAL variable
 SHOW global variables LIKE 'innodb_file_format_max';
 Variable_name	Value
-innodb_file_format_max	Antelope
+innodb_file_format_max	Barracuda
 SHOW session variables LIKE 'innodb_file_format_max';
 Variable_name	Value
-innodb_file_format_max	Antelope
+innodb_file_format_max	Barracuda
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_file_format_max';
 VARIABLE_NAME	VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX	Antelope
+INNODB_FILE_FORMAT_MAX	Barracuda
 SELECT * FROM information_schema.session_variables
 WHERE variable_name='innodb_file_format_max';
 VARIABLE_NAME	VARIABLE_VALUE
-INNODB_FILE_FORMAT_MAX	Antelope
+INNODB_FILE_FORMAT_MAX	Barracuda
 SET global innodb_file_format_max='Antelope';
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@global.innodb_file_format_max;
 @@global.innodb_file_format_max
 Antelope
@@ -38,6 +40,8 @@ WHERE variable_name='innodb_file_format_max';
 VARIABLE_NAME	VARIABLE_VALUE
 INNODB_FILE_FORMAT_MAX	Antelope
 SET @@global.innodb_file_format_max='Barracuda';
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@global.innodb_file_format_max;
 @@global.innodb_file_format_max
 Barracuda
@@ -60,6 +64,8 @@ ERROR 42000: Incorrect argument type to variable 'innodb_file_format_max'
 SET global innodb_file_format_max='Salmon';
 ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Salmon'
 SET @@global.innodb_file_format_max = @start_global_value;
+Warnings:
+Warning	131	Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@global.innodb_file_format_max;
 @@global.innodb_file_format_max
-Antelope
+Barracuda
diff --git a/mysql-test/suite/sys_vars/r/innodb_fill_factor_basic.result b/mysql-test/suite/sys_vars/r/innodb_fill_factor_basic.result
new file mode 100644
index 0000000..7a4cef2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_fill_factor_basic.result
@@ -0,0 +1,42 @@
+select @@global.innodb_fill_factor;
+@@global.innodb_fill_factor
+100
+select @@session.innodb_fill_factor;
+ERROR HY000: Variable 'innodb_fill_factor' is a GLOBAL variable
+show global variables like 'innodb_fill_factor';
+Variable_name	Value
+innodb_fill_factor	100
+show session variables like 'innodb_fill_factor';
+Variable_name	Value
+innodb_fill_factor	100
+select * from information_schema.global_variables where variable_name='innodb_fill_factor';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FILL_FACTOR	100
+select * from information_schema.session_variables where variable_name='innodb_fill_factor';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FILL_FACTOR	100
+set global innodb_fill_factor=9;
+Warnings:
+Warning	1292	Truncated incorrect innodb_fill_factor value: '9'
+select @@innodb_fill_factor;
+@@innodb_fill_factor
+10
+set global innodb_fill_factor=10;
+select @@innodb_fill_factor;
+@@innodb_fill_factor
+10
+set global innodb_fill_factor=75;
+select @@innodb_fill_factor;
+@@innodb_fill_factor
+75
+set global innodb_fill_factor=100;
+select @@innodb_fill_factor;
+@@innodb_fill_factor
+100
+set global innodb_fill_factor=101;
+Warnings:
+Warning	1292	Truncated incorrect innodb_fill_factor value: '101'
+select @@innodb_fill_factor;
+@@innodb_fill_factor
+100
+set global innodb_fill_factor=100;
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
index 60a4081..79455e2 100644
--- 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
@@ -56,6 +56,21 @@ 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
+SET @@global.innodb_flush_log_at_timeout = ' ';
+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 = " ";
+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 = 1.1;
+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_05------------------------#'
 SELECT @@global.innodb_flush_log_at_timeout =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
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 268d40c..0d990d7 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
@@ -9,6 +9,11 @@ SELECT @@global.innodb_flush_log_at_trx_commit;
 @@global.innodb_flush_log_at_trx_commit
 1
 '#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_flush_log_at_trx_commit = 1;
+ERROR HY000: Variable 'innodb_flush_log_at_trx_commit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_flush_log_at_trx_commit;
+@@innodb_flush_log_at_trx_commit
+1
 SELECT local.innodb_flush_log_at_trx_commit;
 ERROR 42S02: Unknown table 'local' in field list
 SET global innodb_flush_log_at_trx_commit = 0;
@@ -51,6 +56,27 @@ 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
 3
+SET @@global.innodb_flush_log_at_trx_commit = 100156787;
+Warnings:
+Warning	1292	Truncated incorrect innodb_flush_log_at_trx_commit value: '100156787'
+SELECT @@global.innodb_flush_log_at_trx_commit;
+@@global.innodb_flush_log_at_trx_commit
+3
+SET @@global.innodb_flush_log_at_trx_commit = " ";
+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
+3
+SET @@global.innodb_flush_log_at_trx_commit = 1.1;
+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
+3
+SET @@global.innodb_flush_log_at_trx_commit = ' ';
+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
+3
 '#----------------------FN_DYNVARS_046_05------------------------#'
 SELECT @@global.innodb_flush_log_at_trx_commit =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
diff --git a/mysql-test/suite/sys_vars/r/innodb_flush_sync_basic.result b/mysql-test/suite/sys_vars/r/innodb_flush_sync_basic.result
new file mode 100644
index 0000000..9e3f7d9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_flush_sync_basic.result
@@ -0,0 +1,92 @@
+SET @start_global_value = @@global.innodb_flush_sync;
+SELECT @start_global_value;
+ at start_global_value
+1
+Valid values are 'ON' and 'OFF'
+select @@global.innodb_flush_sync in (0, 1);
+@@global.innodb_flush_sync in (0, 1)
+1
+select @@global.innodb_flush_sync;
+@@global.innodb_flush_sync
+1
+select @@session.innodb_flush_sync;
+ERROR HY000: Variable 'innodb_flush_sync' is a GLOBAL variable
+show global variables like 'innodb_flush_sync';
+Variable_name	Value
+innodb_flush_sync	ON
+show session variables like 'innodb_flush_sync';
+Variable_name	Value
+innodb_flush_sync	ON
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	ON
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	ON
+set global innodb_flush_sync='OFF';
+select @@global.innodb_flush_sync;
+@@global.innodb_flush_sync
+0
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	OFF
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	OFF
+set @@global.innodb_flush_sync=1;
+select @@global.innodb_flush_sync;
+@@global.innodb_flush_sync
+1
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	ON
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	ON
+set global innodb_flush_sync=0;
+select @@global.innodb_flush_sync;
+@@global.innodb_flush_sync
+0
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	OFF
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	OFF
+set @@global.innodb_flush_sync='ON';
+select @@global.innodb_flush_sync;
+@@global.innodb_flush_sync
+1
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	ON
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	ON
+set session innodb_flush_sync='OFF';
+ERROR HY000: Variable 'innodb_flush_sync' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_flush_sync='ON';
+ERROR HY000: Variable 'innodb_flush_sync' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_flush_sync=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_sync'
+set global innodb_flush_sync=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_flush_sync'
+set global innodb_flush_sync=2;
+ERROR 42000: Variable 'innodb_flush_sync' can't be set to the value of '2'
+set global innodb_flush_sync=-3;
+ERROR 42000: Variable 'innodb_flush_sync' can't be set to the value of '-3'
+select @@global.innodb_flush_sync;
+@@global.innodb_flush_sync
+1
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	ON
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_FLUSH_SYNC	ON
+set global innodb_flush_sync='AUTO';
+ERROR 42000: Variable 'innodb_flush_sync' can't be set to the value of 'AUTO'
+SET @@global.innodb_flush_sync = @start_global_value;
+SELECT @@global.innodb_flush_sync;
+@@global.innodb_flush_sync
+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
index caa41bd..e024581 100644
--- 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
@@ -56,6 +56,16 @@ Warning	1292	Truncated incorrect innodb_flushing_avg_loops value: '1001'
 SELECT @@global.innodb_flushing_avg_loops;
 @@global.innodb_flushing_avg_loops
 1000
+SET @@global.innodb_flushing_avg_loops = ' ';
+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 = " ";
+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_05------------------------#'
 SELECT @@global.innodb_flushing_avg_loops =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
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
index 0aefabd..59f6431 100644
--- 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
@@ -25,8 +25,14 @@ 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;
+set global innodb_ft_result_cache_limit=4294967295;
 select @@innodb_ft_result_cache_limit;
 @@innodb_ft_result_cache_limit
-4000000000
+4294967295
+set global innodb_ft_result_cache_limit=4*1024*1024*1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_ft_result_cache_limit value: '4294967296'
+select @@innodb_ft_result_cache_limit;
+@@innodb_ft_result_cache_limit
+4294967295
 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
index 044e8f8..1851c07 100644
--- 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
@@ -16,6 +16,7 @@ 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	
+call mtr.add_suppression("\\[ERROR\\] InnoDB: user stopword table Salmon does not exist.");
 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';
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
index 6629848..ca54f5f 100644
--- 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
@@ -17,6 +17,7 @@ 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	
+call mtr.add_suppression("\\[ERROR\\] InnoDB: user stopword table Salmon does not exist.");
 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';
@@ -27,4 +28,3 @@ 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_large_prefix_basic.result b/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
index 3877988..c6e803f 100644
--- a/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result
@@ -1,29 +1,31 @@
 SET @start_global_value = @@global.innodb_large_prefix;
 SELECT @start_global_value;
 @start_global_value
-0
+1
 Valid values are 'ON' and 'OFF' 
 select @@global.innodb_large_prefix in (0, 1);
 @@global.innodb_large_prefix in (0, 1)
 1
 select @@global.innodb_large_prefix;
 @@global.innodb_large_prefix
-0
+1
 select @@session.innodb_large_prefix;
 ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable
 show global variables like 'innodb_large_prefix';
 Variable_name	Value
-innodb_large_prefix	OFF
+innodb_large_prefix	ON
 show session variables like 'innodb_large_prefix';
 Variable_name	Value
-innodb_large_prefix	OFF
+innodb_large_prefix	ON
 select * from information_schema.global_variables where variable_name='innodb_large_prefix';
 VARIABLE_NAME	VARIABLE_VALUE
-INNODB_LARGE_PREFIX	OFF
+INNODB_LARGE_PREFIX	ON
 select * from information_schema.session_variables where variable_name='innodb_large_prefix';
 VARIABLE_NAME	VARIABLE_VALUE
-INNODB_LARGE_PREFIX	OFF
+INNODB_LARGE_PREFIX	ON
 set global innodb_large_prefix='OFF';
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@global.innodb_large_prefix;
 @@global.innodb_large_prefix
 0
@@ -34,6 +36,8 @@ select * from information_schema.session_variables where variable_name='innodb_l
 VARIABLE_NAME	VARIABLE_VALUE
 INNODB_LARGE_PREFIX	OFF
 set @@global.innodb_large_prefix=1;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@global.innodb_large_prefix;
 @@global.innodb_large_prefix
 1
@@ -44,6 +48,8 @@ select * from information_schema.session_variables where variable_name='innodb_l
 VARIABLE_NAME	VARIABLE_VALUE
 INNODB_LARGE_PREFIX	ON
 set global innodb_large_prefix=0;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@global.innodb_large_prefix;
 @@global.innodb_large_prefix
 0
@@ -54,6 +60,8 @@ select * from information_schema.session_variables where variable_name='innodb_l
 VARIABLE_NAME	VARIABLE_VALUE
 INNODB_LARGE_PREFIX	OFF
 set @@global.innodb_large_prefix='ON';
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 select @@global.innodb_large_prefix;
 @@global.innodb_large_prefix
 1
@@ -87,6 +95,8 @@ INNODB_LARGE_PREFIX	ON
 set global innodb_large_prefix='AUTO';
 ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of 'AUTO'
 SET @@global.innodb_large_prefix = @start_global_value;
+Warnings:
+Warning	131	Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SELECT @@global.innodb_large_prefix;
 @@global.innodb_large_prefix
-0
+1
diff --git a/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result b/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
index 1dcc2d5..74b1d21 100644
--- a/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result
@@ -55,6 +55,104 @@ COUNT(@@GLOBAL.innodb_lock_wait_timeout)
 1 Expected
 SELECT innodb_lock_wait_timeout = @@SESSION.innodb_lock_wait_timeout;
 ERROR 42S22: Unknown column 'innodb_lock_wait_timeout' in 'field list'
+set @@global.innodb_lock_wait_timeout=100;
+set @@global.innodb_lock_wait_timeout=DEFAULT;
+select @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+50
+set @@session.innodb_lock_wait_timeout=100;
+set @@session.innodb_lock_wait_timeout=DEFAULT;
+select @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+50
+SET @@global.innodb_lock_wait_timeout=1;
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1
+SET @@global.innodb_lock_wait_timeout=1024;
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1024
+SET @@global.innodb_lock_wait_timeout=1073741824;
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1073741824
+SET @@session.innodb_lock_wait_timeout=1;
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+1
+SET @@session.innodb_lock_wait_timeout=1024;
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+1024
+SET @@session.innodb_lock_wait_timeout=1073741824;
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+1073741824
+SET @@global.innodb_lock_wait_timeout="t";
+ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1073741824
+SET @@global.innodb_lock_wait_timeout=-1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_lock_wait_timeout value: '-1024'
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1
+SET @@global.innodb_lock_wait_timeout=1073741825;
+Warnings:
+Warning	1292	Truncated incorrect innodb_lock_wait_timeout value: '1073741825'
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1073741824
+SET @@global.innodb_lock_wait_timeout=" ";
+ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1073741824
+SET @@global.innodb_lock_wait_timeout=' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1073741824
+SET @@global.innodb_lock_wait_timeout=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
+SELECT @@global.innodb_lock_wait_timeout;
+@@global.innodb_lock_wait_timeout
+1073741824
+SET @@session.innodb_lock_wait_timeout="T";
+ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+1073741824
+SET @@session.innodb_lock_wait_timeout=-1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_lock_wait_timeout value: '-1024'
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+1
+SET @@session.innodb_lock_wait_timeout=1073999999;
+Warnings:
+Warning	1292	Truncated incorrect innodb_lock_wait_timeout value: '1073999999'
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+1073741824
+SET @@session.innodb_lock_wait_timeout=' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+1073741824
+SET @@session.innodb_lock_wait_timeout=" ";
+ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+1073741824
+SET @@session.innodb_lock_wait_timeout=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_lock_wait_timeout'
+SELECT @@session.innodb_lock_wait_timeout;
+@@session.innodb_lock_wait_timeout
+1073741824
 SET @@global.innodb_lock_wait_timeout = @start_global_value;
 SELECT @@global.innodb_lock_wait_timeout;
 @@global.innodb_lock_wait_timeout
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_checkpoint_now_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_checkpoint_now_basic.result
index d9d067c..4774c2f 100644
--- a/mysql-test/suite/sys_vars/r/innodb_log_checkpoint_now_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_log_checkpoint_now_basic.result
@@ -1 +1,80 @@
-XtraDB extension
+SET @start_global_value = @@global.innodb_log_checkpoint_now;
+SELECT @start_global_value;
+ at start_global_value
+0
+select @@global.innodb_log_checkpoint_now in (0, 1);
+@@global.innodb_log_checkpoint_now in (0, 1)
+1
+select @@global.innodb_log_checkpoint_now;
+@@global.innodb_log_checkpoint_now
+0
+select @@session.innodb_log_checkpoint_now;
+ERROR HY000: Variable 'innodb_log_checkpoint_now' is a GLOBAL variable
+show global variables like 'innodb_log_checkpoint_now';
+Variable_name	Value
+innodb_log_checkpoint_now	OFF
+show session variables like 'innodb_log_checkpoint_now';
+Variable_name	Value
+innodb_log_checkpoint_now	OFF
+select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_CHECKPOINT_NOW	OFF
+select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_CHECKPOINT_NOW	OFF
+set global innodb_log_checkpoint_now=1;
+select @@global.innodb_log_checkpoint_now;
+@@global.innodb_log_checkpoint_now
+0
+select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_CHECKPOINT_NOW	OFF
+select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_CHECKPOINT_NOW	OFF
+set @@global.innodb_log_checkpoint_now=0;
+select @@global.innodb_log_checkpoint_now;
+@@global.innodb_log_checkpoint_now
+0
+select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_CHECKPOINT_NOW	OFF
+select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_CHECKPOINT_NOW	OFF
+set global innodb_log_checkpoint_now=ON;
+select @@global.innodb_log_checkpoint_now;
+@@global.innodb_log_checkpoint_now
+0
+select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_CHECKPOINT_NOW	OFF
+select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_CHECKPOINT_NOW	OFF
+set global innodb_log_checkpoint_now=OFF;
+select @@global.innodb_log_checkpoint_now;
+@@global.innodb_log_checkpoint_now
+0
+select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_CHECKPOINT_NOW	OFF
+select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_CHECKPOINT_NOW	OFF
+set session innodb_log_checkpoint_now='some';
+ERROR HY000: Variable 'innodb_log_checkpoint_now' is a GLOBAL variable and should be set with SET GLOBAL
+set @@session.innodb_log_checkpoint_now='some';
+ERROR HY000: Variable 'innodb_log_checkpoint_now' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_log_checkpoint_now=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_log_checkpoint_now'
+set global innodb_log_checkpoint_now='foo';
+ERROR 42000: Variable 'innodb_log_checkpoint_now' can't be set to the value of 'foo'
+set global innodb_log_checkpoint_now=-2;
+ERROR 42000: Variable 'innodb_log_checkpoint_now' can't be set to the value of '-2'
+set global innodb_log_checkpoint_now=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_log_checkpoint_now'
+SET @@global.innodb_log_checkpoint_now = @start_global_value;
+SELECT @@global.innodb_log_checkpoint_now;
+@@global.innodb_log_checkpoint_now
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_checksums_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_checksums_basic.result
new file mode 100644
index 0000000..6679ca8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_log_checksums_basic.result
@@ -0,0 +1,42 @@
+SET @orig = @@global.innodb_log_checksums;
+SELECT @orig;
+ at orig
+1
+SET GLOBAL innodb_log_checksums = 'crc32';
+ERROR 42000: Variable 'innodb_log_checksums' can't be set to the value of 'crc32'
+SELECT @@global.innodb_log_checksums;
+@@global.innodb_log_checksums
+1
+SET GLOBAL innodb_log_checksums = 2;
+ERROR 42000: Variable 'innodb_log_checksums' can't be set to the value of '2'
+SELECT @@global.innodb_log_checksums;
+@@global.innodb_log_checksums
+1
+SET GLOBAL innodb_log_checksums = 1e2;
+ERROR 42000: Incorrect argument type to variable 'innodb_log_checksums'
+SELECT @@global.innodb_log_checksums;
+@@global.innodb_log_checksums
+1
+SET GLOBAL innodb_log_checksums = 1.0;
+ERROR 42000: Incorrect argument type to variable 'innodb_log_checksums'
+SELECT @@global.innodb_log_checksums;
+@@global.innodb_log_checksums
+1
+SET innodb_log_checksums = OFF;
+ERROR HY000: Variable 'innodb_log_checksums' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@global.innodb_log_checksums;
+@@global.innodb_log_checksums
+1
+SET GLOBAL innodb_log_checksums = OFF;
+SELECT @@global.innodb_log_checksums;
+@@global.innodb_log_checksums
+0
+SET GLOBAL innodb_log_checksums = default;
+SET GLOBAL innodb_log_checksums = ON;
+SELECT @@global.innodb_log_checksums;
+@@global.innodb_log_checksums
+1
+SET GLOBAL innodb_log_checksums = @orig;
+SELECT @@global.innodb_log_checksums;
+@@global.innodb_log_checksums
+1
diff --git a/mysql-test/suite/sys_vars/r/innodb_log_write_ahead_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_write_ahead_size_basic.result
new file mode 100644
index 0000000..5c9eb69
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_log_write_ahead_size_basic.result
@@ -0,0 +1,88 @@
+SET @start_global_value = @@global.innodb_log_write_ahead_size;
+SET global innodb_log_write_ahead_size=4096;
+Valid values are positive number
+SELECT @@global.innodb_log_write_ahead_size >= 512;
+@@global.innodb_log_write_ahead_size >= 512
+1
+SELECT @@global.innodb_log_write_ahead_size <= 16*1024;
+@@global.innodb_log_write_ahead_size <= 16*1024
+1
+SELECT @@session.innodb_log_write_ahead_size;
+ERROR HY000: Variable 'innodb_log_write_ahead_size' is a GLOBAL variable
+SHOW global variables LIKE 'innodb_log_write_ahead_size';
+Variable_name	Value
+innodb_log_write_ahead_size	4096
+SHOW session variables LIKE 'innodb_log_write_ahead_size';
+Variable_name	Value
+innodb_log_write_ahead_size	4096
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_log_write_ahead_size';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_WRITE_AHEAD_SIZE	4096
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_log_write_ahead_size';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_WRITE_AHEAD_SIZE	4096
+SET global innodb_log_write_ahead_size=1024;
+SELECT @@global.innodb_log_write_ahead_size;
+@@global.innodb_log_write_ahead_size
+1024
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_log_write_ahead_size';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_WRITE_AHEAD_SIZE	1024
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_log_write_ahead_size';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_WRITE_AHEAD_SIZE	1024
+SET session innodb_log_write_ahead_size=2048;
+ERROR HY000: Variable 'innodb_log_write_ahead_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET global innodb_log_write_ahead_size=512;
+SELECT @@global.innodb_log_write_ahead_size;
+@@global.innodb_log_write_ahead_size
+512
+SET global innodb_log_write_ahead_size=2048;
+SELECT @@global.innodb_log_write_ahead_size;
+@@global.innodb_log_write_ahead_size
+2048
+SET global innodb_log_write_ahead_size=4096;
+SELECT @@global.innodb_log_write_ahead_size;
+@@global.innodb_log_write_ahead_size
+4096
+SET global innodb_log_write_ahead_size=0;
+Warnings:
+Warning	1292	Truncated incorrect innodb_log_write_ahead_size value: '0'
+SELECT @@global.innodb_log_write_ahead_size;
+@@global.innodb_log_write_ahead_size
+512
+SET global innodb_log_write_ahead_size=-1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_log_write_ahead_size value: '-1024'
+SELECT @@global.innodb_log_write_ahead_size;
+@@global.innodb_log_write_ahead_size
+512
+SET global innodb_log_write_ahead_size=3000;
+Warnings:
+Warning	1292	Truncated incorrect innodb_log_write_ahead_size value: '3000'
+Warning	1210	innodb_log_write_ahead_size should be set 2^n value and larger than 512.
+Warning	1210	Setting innodb_log_write_ahead_size to 4096
+SELECT @@global.innodb_log_write_ahead_size;
+@@global.innodb_log_write_ahead_size
+4096
+SET global innodb_log_write_ahead_size=1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_log_write_ahead_size'
+SET global innodb_log_write_ahead_size=1e1;
+ERROR 42000: Incorrect argument type to variable 'innodb_log_write_ahead_size'
+SET global innodb_log_write_ahead_size="foo";
+ERROR 42000: Incorrect argument type to variable 'innodb_log_write_ahead_size'
+SET global innodb_log_write_ahead_size=-7;
+Warnings:
+Warning	1292	Truncated incorrect innodb_log_write_ahead_size value: '-7'
+SELECT @@global.innodb_log_write_ahead_size;
+@@global.innodb_log_write_ahead_size
+512
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_log_write_ahead_size';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_LOG_WRITE_AHEAD_SIZE	512
+SET @@global.innodb_log_write_ahead_size = @start_global_value;
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 d705624..13ae982 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
@@ -2,11 +2,17 @@ SET @global_start_value = @@global.innodb_max_dirty_pages_pct;
 SELECT @global_start_value;
 @global_start_value
 75
+SET @global_start_max_dirty_lwm_value = @@global.innodb_max_dirty_pages_pct_lwm;
+SELECT @global_start_max_dirty_lwm_value;
+ at global_start_max_dirty_lwm_value
+0
+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_01------------------------#'
 SET @@global.innodb_max_dirty_pages_pct = 0;
-Warnings:
-Warning	1292	Truncated incorrect innodb_max_dirty_pages_pct value: '0'
-SET @@global.innodb_max_dirty_pages_pct = @global_start_value;
+SET @@global.innodb_max_dirty_pages_pct = DEFAULT;
 SELECT @@global.innodb_max_dirty_pages_pct;
 @@global.innodb_max_dirty_pages_pct
 75.000000
@@ -19,18 +25,14 @@ SELECT @@innodb_max_dirty_pages_pct;
 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.001000
+0.000000
 '#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@global.innodb_max_dirty_pages_pct = 0;
-Warnings:
-Warning	1292	Truncated incorrect innodb_max_dirty_pages_pct value: '0'
+SET @@global.innodb_max_dirty_pages_pct = 0.0;
 SELECT @@global.innodb_max_dirty_pages_pct;
 @@global.innodb_max_dirty_pages_pct
-0.001000
+0.000000
 SET @@global.innodb_max_dirty_pages_pct = 1;
 SELECT @@global.innodb_max_dirty_pages_pct;
 @@global.innodb_max_dirty_pages_pct
@@ -39,30 +41,94 @@ SET @@global.innodb_max_dirty_pages_pct = 99;
 SELECT @@global.innodb_max_dirty_pages_pct;
 @@global.innodb_max_dirty_pages_pct
 99.000000
-'#--------------------FN_DYNVARS_046_04-------------------------#'
+'#--------------------FN_DYNVARS_046_04------------------------#'
+SET @@global.innodb_max_dirty_pages_pct_lwm = @global_start_value - 1;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+74.000000
+SET @@global.innodb_max_dirty_pages_pct = @global_start_value - 2;
+Warnings:
+Warning	1210	innodb_max_dirty_pages_pct cannot be set lower than innodb_max_dirty_pages_pct_lwm.
+Warning	1210	Lowering innodb_max_dirty_page_pct_lwm to 73.000000
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+73.000000
+'#--------------------FN_DYNVARS_046_05-------------------------#'
 SET @@global.innodb_max_dirty_pages_pct = -1;
 Warnings:
 Warning	1292	Truncated incorrect innodb_max_dirty_pages_pct value: '-1'
+Warning	1210	innodb_max_dirty_pages_pct cannot be set lower than innodb_max_dirty_pages_pct_lwm.
+Warning	1210	Lowering innodb_max_dirty_page_pct_lwm to 0.000000
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+0.000000
+SET @@global.innodb_max_dirty_pages_pct = -1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_dirty_pages_pct value: '-1024'
 SELECT @@global.innodb_max_dirty_pages_pct;
 @@global.innodb_max_dirty_pages_pct
-0.001000
+0.000000
 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.001000
+0.000000
 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.001000
+0.000000
+SET @@global.innodb_max_dirty_pages_pct = 100;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_dirty_pages_pct value: '100'
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+99.999000
 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.999000
-'#----------------------FN_DYNVARS_046_05------------------------#'
+SET @@global.innodb_max_dirty_pages_pct = 100000;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_dirty_pages_pct value: '100000'
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+99.999000
+SET @@global.innodb_max_dirty_pages_pct = ' ';
+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.999000
+SET @@global.innodb_max_dirty_pages_pct = " ";
+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.999000
+SET @@global.innodb_max_dirty_pages_pct = 1.1;
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+1.100000
+set global innodb_max_dirty_pages_pct = 0.1;
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+0.100000
+set global innodb_max_dirty_pages_pct = 31.34;
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+31.340000
+set global innodb_max_dirty_pages_pct = 100;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_dirty_pages_pct value: '100'
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+99.999000
+set global innodb_max_dirty_pages_pct = 99.999;
+SELECT @@global.innodb_max_dirty_pages_pct;
+@@global.innodb_max_dirty_pages_pct
+99.999000
+'#----------------------FN_DYNVARS_046_06------------------------#'
 SELECT @@global.innodb_max_dirty_pages_pct =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct';
@@ -76,7 +142,7 @@ SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct';
 VARIABLE_VALUE
 99.999000
-'#---------------------FN_DYNVARS_046_06-------------------------#'
+'#---------------------FN_DYNVARS_046_07-------------------------#'
 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;
@@ -87,18 +153,20 @@ 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.999000
-'#---------------------FN_DYNVARS_046_07----------------------#'
+'#---------------------FN_DYNVARS_046_08----------------------#'
 SET @@global.innodb_max_dirty_pages_pct = TRUE;
 SELECT @@global.innodb_max_dirty_pages_pct;
 @@global.innodb_max_dirty_pages_pct
 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.001000
+0.000000
 SET @@global.innodb_max_dirty_pages_pct = @global_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 = @global_start_max_dirty_lwm_value;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+0.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 eb0de04..8b68f18 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
@@ -1,19 +1,26 @@
 SET @innodb_max_dirty_pages_pct = @@global.innodb_max_dirty_pages_pct;
 '#--------------------FN_DYNVARS_044_02-------------------------#'
 SET @@global.innodb_max_dirty_pages_pct = 80;
+'connect (con1,localhost,root,,,,)'
 connect  con1,localhost,root,,,,;
+'connection con1'
 connection con1;
 SELECT @@global.innodb_max_dirty_pages_pct;
 @@global.innodb_max_dirty_pages_pct
 80.000000
 SET @@global.innodb_max_dirty_pages_pct = 70;
+'connect (con2,localhost,root,,,,)'
 connect  con2,localhost,root,,,,;
+'connection con2'
 connection con2;
 SELECT @@global.innodb_max_dirty_pages_pct;
 @@global.innodb_max_dirty_pages_pct
 70.000000
+'connection default'
 connection default;
+'disconnect con2'
 disconnect con2;
+'disconnect con1'
 disconnect con1;
 SET @@global.innodb_max_dirty_pages_pct = @innodb_max_dirty_pages_pct;
 '#--------------------FN_DYNVARS_044_02-------------------------#'
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
index 676ec10..b6394d0 100644
--- 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
@@ -1,23 +1,23 @@
 SET @pct_lwm_start_value = @@global.innodb_max_dirty_pages_pct_lwm;
 SELECT @pct_lwm_start_value;
 @pct_lwm_start_value
-0.001
+0
 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;
+SET @@global.innodb_max_dirty_pages_pct_lwm = DEFAULT;
 SELECT @@global.innodb_max_dirty_pages_pct_lwm;
 @@global.innodb_max_dirty_pages_pct_lwm
-0.001000
+0.000000
 '#---------------------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
+0.000000
 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;
@@ -57,6 +57,18 @@ 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 = 0.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 = 1.1;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+1.100000
+SET @@global.innodb_max_dirty_pages_pct_lwm = 51.12;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+@@global.innodb_max_dirty_pages_pct_lwm
+51.120000
 SET @@global.innodb_max_dirty_pages_pct_lwm = 100;
 Warnings:
 Warning	1292	Truncated incorrect innodb_max_dirty_pages_pct_lwm value: '100'
@@ -65,6 +77,16 @@ 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 = " ";
+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 = ' ';
+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_05------------------------#'
 SELECT @@global.innodb_max_dirty_pages_pct_lwm =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@@ -106,4 +128,4 @@ 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;
 @@global.innodb_max_dirty_pages_pct_lwm
-0.001000
+0.000000
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic.result b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic.result
index a01d2f2..bf526fc 100644
--- a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic.result
@@ -33,13 +33,32 @@ SET @@global.innodb_max_purge_lag = 4294967295;
 SELECT @@global.innodb_max_purge_lag;
 @@global.innodb_max_purge_lag
 4294967295
-'#--------------------FN_DYNVARS_046_04-------------------------#'
+'#--------------------FN_DYNVARS_046_04------------------------#'
+SET @@global.innodb_max_purge_lag = 4294967296;
+SELECT @@global.innodb_max_purge_lag IN (4294967296,4294967295);
+@@global.innodb_max_purge_lag IN (4294967296,4294967295)
+1
+SET @@global.innodb_max_purge_lag = 12345678901;
+SELECT @@global.innodb_max_purge_lag IN (12345678901,4294967295);
+@@global.innodb_max_purge_lag IN (12345678901,4294967295)
+1
+SET @@global.innodb_max_purge_lag = 18446744073709551615;
+SELECT @@global.innodb_max_purge_lag IN (18446744073709551615,4294967295);
+@@global.innodb_max_purge_lag IN (18446744073709551615,4294967295)
+1
+'#--------------------FN_DYNVARS_046_05-------------------------#'
 SET @@global.innodb_max_purge_lag = -1;
 Warnings:
 Warning	1292	Truncated incorrect innodb_max_purge_lag value: '-1'
 SELECT @@global.innodb_max_purge_lag;
 @@global.innodb_max_purge_lag
 0
+SET @@global.innodb_max_purge_lag = -1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_purge_lag value: '-1024'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
 SET @@global.innodb_max_purge_lag = "T";
 ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
 SELECT @@global.innodb_max_purge_lag;
@@ -50,11 +69,22 @@ ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
 SELECT @@global.innodb_max_purge_lag;
 @@global.innodb_max_purge_lag
 0
-SET @@global.innodb_max_purge_lag = 1001;
+SET @@global.innodb_max_purge_lag = 1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
 SELECT @@global.innodb_max_purge_lag;
 @@global.innodb_max_purge_lag
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
+0
+SET @@global.innodb_max_purge_lag = ' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
+SET @@global.innodb_max_purge_lag = " ";
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
+'#----------------------FN_DYNVARS_046_06------------------------#'
 SELECT @@global.innodb_max_purge_lag =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_max_purge_lag';
@@ -63,23 +93,23 @@ VARIABLE_VALUE
 1
 SELECT @@global.innodb_max_purge_lag;
 @@global.innodb_max_purge_lag
-1001
+0
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_max_purge_lag';
 VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
+0
+'#---------------------FN_DYNVARS_046_07-------------------------#'
 SET @@global.innodb_max_purge_lag = OFF;
 ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
 SELECT @@global.innodb_max_purge_lag;
 @@global.innodb_max_purge_lag
-1001
+0
 SET @@global.innodb_max_purge_lag = ON;
 ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
 SELECT @@global.innodb_max_purge_lag;
 @@global.innodb_max_purge_lag
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
+0
+'#---------------------FN_DYNVARS_046_08----------------------#'
 SET @@global.innodb_max_purge_lag = TRUE;
 SELECT @@global.innodb_max_purge_lag;
 @@global.innodb_max_purge_lag
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_undo_log_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_max_undo_log_size_basic.result
new file mode 100644
index 0000000..3854060
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_max_undo_log_size_basic.result
@@ -0,0 +1,54 @@
+'#---------------------BS_STVARS_035_01----------------------#'
+SELECT COUNT(@@GLOBAL.innodb_max_undo_log_size);
+COUNT(@@GLOBAL.innodb_max_undo_log_size)
+1
+1 Expected
+'#---------------------BS_STVARS_035_02----------------------#'
+SET @@GLOBAL.innodb_max_undo_log_size=1073741824;
+SELECT COUNT(@@GLOBAL.innodb_max_undo_log_size);
+COUNT(@@GLOBAL.innodb_max_undo_log_size)
+1
+1 Expected
+SET @@GLOBAL.innodb_max_undo_log_size=18446744073709551615;
+SELECT @@GLOBAL.innodb_max_undo_log_size;
+@@GLOBAL.innodb_max_undo_log_size
+18446744073709551615
+18446744073709551615 Expected
+SET @@GLOBAL.innodb_max_undo_log_size=1073741824;
+'#---------------------BS_STVARS_035_03----------------------#'
+SELECT @@GLOBAL.innodb_max_undo_log_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_undo_log_size';
+@@GLOBAL.innodb_max_undo_log_size = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_max_undo_log_size);
+COUNT(@@GLOBAL.innodb_max_undo_log_size)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_undo_log_size';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_035_04----------------------#'
+SELECT @@innodb_max_undo_log_size = @@GLOBAL.innodb_max_undo_log_size;
+@@innodb_max_undo_log_size = @@GLOBAL.innodb_max_undo_log_size
+1
+1 Expected
+'#---------------------BS_STVARS_035_05----------------------#'
+SELECT COUNT(@@innodb_max_undo_log_size);
+COUNT(@@innodb_max_undo_log_size)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_max_undo_log_size);
+ERROR HY000: Variable 'innodb_max_undo_log_size' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_max_undo_log_size);
+ERROR HY000: Variable 'innodb_max_undo_log_size' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_max_undo_log_size);
+COUNT(@@GLOBAL.innodb_max_undo_log_size)
+1
+1 Expected
diff --git a/mysql-test/suite/sys_vars/r/innodb_merge_threshold_set_all_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_merge_threshold_set_all_debug_basic.result
new file mode 100644
index 0000000..6e325d0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_merge_threshold_set_all_debug_basic.result
@@ -0,0 +1,28 @@
+#
+# Basic test for innodb_merge_threshold_set_all_debug
+#
+SELECT @@global.innodb_merge_threshold_set_all_debug;
+@@global.innodb_merge_threshold_set_all_debug
+50
+set global innodb_merge_threshold_set_all_debug = 1;
+SELECT @@global.innodb_merge_threshold_set_all_debug;
+@@global.innodb_merge_threshold_set_all_debug
+1
+set global innodb_merge_threshold_set_all_debug = 51;
+Warnings:
+Warning	1292	Truncated incorrect innodb_merge_threshold_set_all_d value: '51'
+SELECT @@global.innodb_merge_threshold_set_all_debug;
+@@global.innodb_merge_threshold_set_all_debug
+50
+set global innodb_merge_threshold_set_all_debug = 0;
+Warnings:
+Warning	1292	Truncated incorrect innodb_merge_threshold_set_all_d value: '0'
+SELECT @@global.innodb_merge_threshold_set_all_debug;
+@@global.innodb_merge_threshold_set_all_debug
+1
+set innodb_merge_threshold_set_all_debug = 50;
+ERROR HY000: Variable 'innodb_merge_threshold_set_all_debug' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_merge_threshold_set_all_debug = 50;
+SELECT @@global.innodb_merge_threshold_set_all_debug;
+@@global.innodb_merge_threshold_set_all_debug
+50
diff --git a/mysql-test/suite/sys_vars/r/innodb_mirrored_log_groups_basic.result b/mysql-test/suite/sys_vars/r/innodb_mirrored_log_groups_basic.result
deleted file mode 100644
index 1645d81..0000000
--- a/mysql-test/suite/sys_vars/r/innodb_mirrored_log_groups_basic.result
+++ /dev/null
@@ -1,53 +0,0 @@
-'#---------------------BS_STVARS_037_01----------------------#'
-SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups);
-COUNT(@@GLOBAL.innodb_mirrored_log_groups)
-1
-1 Expected
-'#---------------------BS_STVARS_037_02----------------------#'
-SET @@GLOBAL.innodb_mirrored_log_groups=1;
-ERROR HY000: Variable 'innodb_mirrored_log_groups' is a read only variable
-Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups);
-COUNT(@@GLOBAL.innodb_mirrored_log_groups)
-1
-1 Expected
-'#---------------------BS_STVARS_037_03----------------------#'
-SELECT @@GLOBAL.innodb_mirrored_log_groups = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_mirrored_log_groups';
-@@GLOBAL.innodb_mirrored_log_groups = VARIABLE_VALUE
-1
-1 Expected
-SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups);
-COUNT(@@GLOBAL.innodb_mirrored_log_groups)
-1
-1 Expected
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='innodb_mirrored_log_groups';
-COUNT(VARIABLE_VALUE)
-1
-1 Expected
-'#---------------------BS_STVARS_037_04----------------------#'
-SELECT @@innodb_mirrored_log_groups = @@GLOBAL.innodb_mirrored_log_groups;
-@@innodb_mirrored_log_groups = @@GLOBAL.innodb_mirrored_log_groups
-1
-1 Expected
-'#---------------------BS_STVARS_037_05----------------------#'
-SELECT COUNT(@@innodb_mirrored_log_groups);
-COUNT(@@innodb_mirrored_log_groups)
-1
-1 Expected
-SELECT COUNT(@@local.innodb_mirrored_log_groups);
-ERROR HY000: Variable 'innodb_mirrored_log_groups' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@SESSION.innodb_mirrored_log_groups);
-ERROR HY000: Variable 'innodb_mirrored_log_groups' is a GLOBAL variable
-Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups);
-COUNT(@@GLOBAL.innodb_mirrored_log_groups)
-1
-1 Expected
-SELECT innodb_mirrored_log_groups = @@SESSION.innodb_mirrored_log_groups;
-ERROR 42S22: Unknown column 'innodb_mirrored_log_groups' in 'field list'
-Expected error 'Readonly variable'
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
index 6c7051d..3764b00 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
@@ -4,7 +4,6 @@ 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
@@ -47,7 +46,6 @@ 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
@@ -55,6 +53,19 @@ buffer_flush_neighbor_total_pages	disabled
 buffer_flush_neighbor	disabled
 buffer_flush_neighbor_pages	disabled
 buffer_flush_n_to_flush_requested	disabled
+buffer_flush_n_to_flush_by_age	disabled
+buffer_flush_adaptive_avg_time_slot	disabled
+buffer_LRU_batch_flush_avg_time_slot	disabled
+buffer_flush_adaptive_avg_time_thread	disabled
+buffer_LRU_batch_flush_avg_time_thread	disabled
+buffer_flush_adaptive_avg_time_est	disabled
+buffer_LRU_batch_flush_avg_time_est	disabled
+buffer_flush_avg_time	disabled
+buffer_flush_adaptive_avg_pass	disabled
+buffer_LRU_batch_flush_avg_pass	disabled
+buffer_flush_avg_pass	disabled
+buffer_LRU_get_free_loops	disabled
+buffer_LRU_get_free_waits	disabled
 buffer_flush_avg_page_rate	disabled
 buffer_flush_lsn_avg_rate	disabled
 buffer_flush_pct_for_dirty	disabled
@@ -157,12 +168,13 @@ 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_log_flushes	disabled
 log_pending_checkpoint_writes	disabled
 log_num_log_io	disabled
 log_waits	disabled
 log_write_requests	disabled
 log_writes	disabled
+log_padded	disabled
 compress_pages_compressed	disabled
 compress_pages_decompressed	disabled
 compression_pad_increments	disabled
@@ -223,10 +235,13 @@ innodb_dblwr_pages_written	disabled
 innodb_page_size	disabled
 innodb_rwlock_s_spin_waits	disabled
 innodb_rwlock_x_spin_waits	disabled
+innodb_rwlock_sx_spin_waits	disabled
 innodb_rwlock_s_spin_rounds	disabled
 innodb_rwlock_x_spin_rounds	disabled
+innodb_rwlock_sx_spin_rounds	disabled
 innodb_rwlock_s_os_waits	disabled
 innodb_rwlock_x_os_waits	disabled
+innodb_rwlock_sx_os_waits	disabled
 dml_reads	disabled
 dml_inserts	disabled
 dml_deletes	disabled
@@ -239,6 +254,8 @@ ddl_background_drop_indexes	disabled
 ddl_background_drop_tables	disabled
 ddl_online_create_index	disabled
 ddl_pending_alter_table	disabled
+ddl_sort_file_alter_table	disabled
+ddl_log_file_alter_table	disabled
 icp_attempts	disabled
 icp_no_match	disabled
 icp_out_of_range	disabled
@@ -280,10 +297,13 @@ 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_sx_spin_waits	disabled
 innodb_rwlock_s_spin_rounds	disabled
 innodb_rwlock_x_spin_rounds	disabled
+innodb_rwlock_sx_spin_rounds	disabled
 innodb_rwlock_s_os_waits	disabled
 innodb_rwlock_x_os_waits	disabled
+innodb_rwlock_sx_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="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
@@ -408,7 +428,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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,
@@ -419,7 +438,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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
@@ -429,7 +447,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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);
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
index 6c7051d..3764b00 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
@@ -4,7 +4,6 @@ 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
@@ -47,7 +46,6 @@ 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
@@ -55,6 +53,19 @@ buffer_flush_neighbor_total_pages	disabled
 buffer_flush_neighbor	disabled
 buffer_flush_neighbor_pages	disabled
 buffer_flush_n_to_flush_requested	disabled
+buffer_flush_n_to_flush_by_age	disabled
+buffer_flush_adaptive_avg_time_slot	disabled
+buffer_LRU_batch_flush_avg_time_slot	disabled
+buffer_flush_adaptive_avg_time_thread	disabled
+buffer_LRU_batch_flush_avg_time_thread	disabled
+buffer_flush_adaptive_avg_time_est	disabled
+buffer_LRU_batch_flush_avg_time_est	disabled
+buffer_flush_avg_time	disabled
+buffer_flush_adaptive_avg_pass	disabled
+buffer_LRU_batch_flush_avg_pass	disabled
+buffer_flush_avg_pass	disabled
+buffer_LRU_get_free_loops	disabled
+buffer_LRU_get_free_waits	disabled
 buffer_flush_avg_page_rate	disabled
 buffer_flush_lsn_avg_rate	disabled
 buffer_flush_pct_for_dirty	disabled
@@ -157,12 +168,13 @@ 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_log_flushes	disabled
 log_pending_checkpoint_writes	disabled
 log_num_log_io	disabled
 log_waits	disabled
 log_write_requests	disabled
 log_writes	disabled
+log_padded	disabled
 compress_pages_compressed	disabled
 compress_pages_decompressed	disabled
 compression_pad_increments	disabled
@@ -223,10 +235,13 @@ innodb_dblwr_pages_written	disabled
 innodb_page_size	disabled
 innodb_rwlock_s_spin_waits	disabled
 innodb_rwlock_x_spin_waits	disabled
+innodb_rwlock_sx_spin_waits	disabled
 innodb_rwlock_s_spin_rounds	disabled
 innodb_rwlock_x_spin_rounds	disabled
+innodb_rwlock_sx_spin_rounds	disabled
 innodb_rwlock_s_os_waits	disabled
 innodb_rwlock_x_os_waits	disabled
+innodb_rwlock_sx_os_waits	disabled
 dml_reads	disabled
 dml_inserts	disabled
 dml_deletes	disabled
@@ -239,6 +254,8 @@ ddl_background_drop_indexes	disabled
 ddl_background_drop_tables	disabled
 ddl_online_create_index	disabled
 ddl_pending_alter_table	disabled
+ddl_sort_file_alter_table	disabled
+ddl_log_file_alter_table	disabled
 icp_attempts	disabled
 icp_no_match	disabled
 icp_out_of_range	disabled
@@ -280,10 +297,13 @@ 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_sx_spin_waits	disabled
 innodb_rwlock_s_spin_rounds	disabled
 innodb_rwlock_x_spin_rounds	disabled
+innodb_rwlock_sx_spin_rounds	disabled
 innodb_rwlock_s_os_waits	disabled
 innodb_rwlock_x_os_waits	disabled
+innodb_rwlock_sx_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="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
@@ -408,7 +428,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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,
@@ -419,7 +438,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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
@@ -429,7 +447,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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);
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
index 6c7051d..3764b00 100644
--- 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
@@ -4,7 +4,6 @@ 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
@@ -47,7 +46,6 @@ 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
@@ -55,6 +53,19 @@ buffer_flush_neighbor_total_pages	disabled
 buffer_flush_neighbor	disabled
 buffer_flush_neighbor_pages	disabled
 buffer_flush_n_to_flush_requested	disabled
+buffer_flush_n_to_flush_by_age	disabled
+buffer_flush_adaptive_avg_time_slot	disabled
+buffer_LRU_batch_flush_avg_time_slot	disabled
+buffer_flush_adaptive_avg_time_thread	disabled
+buffer_LRU_batch_flush_avg_time_thread	disabled
+buffer_flush_adaptive_avg_time_est	disabled
+buffer_LRU_batch_flush_avg_time_est	disabled
+buffer_flush_avg_time	disabled
+buffer_flush_adaptive_avg_pass	disabled
+buffer_LRU_batch_flush_avg_pass	disabled
+buffer_flush_avg_pass	disabled
+buffer_LRU_get_free_loops	disabled
+buffer_LRU_get_free_waits	disabled
 buffer_flush_avg_page_rate	disabled
 buffer_flush_lsn_avg_rate	disabled
 buffer_flush_pct_for_dirty	disabled
@@ -157,12 +168,13 @@ 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_log_flushes	disabled
 log_pending_checkpoint_writes	disabled
 log_num_log_io	disabled
 log_waits	disabled
 log_write_requests	disabled
 log_writes	disabled
+log_padded	disabled
 compress_pages_compressed	disabled
 compress_pages_decompressed	disabled
 compression_pad_increments	disabled
@@ -223,10 +235,13 @@ innodb_dblwr_pages_written	disabled
 innodb_page_size	disabled
 innodb_rwlock_s_spin_waits	disabled
 innodb_rwlock_x_spin_waits	disabled
+innodb_rwlock_sx_spin_waits	disabled
 innodb_rwlock_s_spin_rounds	disabled
 innodb_rwlock_x_spin_rounds	disabled
+innodb_rwlock_sx_spin_rounds	disabled
 innodb_rwlock_s_os_waits	disabled
 innodb_rwlock_x_os_waits	disabled
+innodb_rwlock_sx_os_waits	disabled
 dml_reads	disabled
 dml_inserts	disabled
 dml_deletes	disabled
@@ -239,6 +254,8 @@ ddl_background_drop_indexes	disabled
 ddl_background_drop_tables	disabled
 ddl_online_create_index	disabled
 ddl_pending_alter_table	disabled
+ddl_sort_file_alter_table	disabled
+ddl_log_file_alter_table	disabled
 icp_attempts	disabled
 icp_no_match	disabled
 icp_out_of_range	disabled
@@ -280,10 +297,13 @@ 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_sx_spin_waits	disabled
 innodb_rwlock_s_spin_rounds	disabled
 innodb_rwlock_x_spin_rounds	disabled
+innodb_rwlock_sx_spin_rounds	disabled
 innodb_rwlock_s_os_waits	disabled
 innodb_rwlock_x_os_waits	disabled
+innodb_rwlock_sx_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="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
@@ -408,7 +428,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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,
@@ -419,7 +438,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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
@@ -429,7 +447,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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);
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
index 6c7051d..3764b00 100644
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
@@ -4,7 +4,6 @@ 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
@@ -47,7 +46,6 @@ 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
@@ -55,6 +53,19 @@ buffer_flush_neighbor_total_pages	disabled
 buffer_flush_neighbor	disabled
 buffer_flush_neighbor_pages	disabled
 buffer_flush_n_to_flush_requested	disabled
+buffer_flush_n_to_flush_by_age	disabled
+buffer_flush_adaptive_avg_time_slot	disabled
+buffer_LRU_batch_flush_avg_time_slot	disabled
+buffer_flush_adaptive_avg_time_thread	disabled
+buffer_LRU_batch_flush_avg_time_thread	disabled
+buffer_flush_adaptive_avg_time_est	disabled
+buffer_LRU_batch_flush_avg_time_est	disabled
+buffer_flush_avg_time	disabled
+buffer_flush_adaptive_avg_pass	disabled
+buffer_LRU_batch_flush_avg_pass	disabled
+buffer_flush_avg_pass	disabled
+buffer_LRU_get_free_loops	disabled
+buffer_LRU_get_free_waits	disabled
 buffer_flush_avg_page_rate	disabled
 buffer_flush_lsn_avg_rate	disabled
 buffer_flush_pct_for_dirty	disabled
@@ -157,12 +168,13 @@ 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_log_flushes	disabled
 log_pending_checkpoint_writes	disabled
 log_num_log_io	disabled
 log_waits	disabled
 log_write_requests	disabled
 log_writes	disabled
+log_padded	disabled
 compress_pages_compressed	disabled
 compress_pages_decompressed	disabled
 compression_pad_increments	disabled
@@ -223,10 +235,13 @@ innodb_dblwr_pages_written	disabled
 innodb_page_size	disabled
 innodb_rwlock_s_spin_waits	disabled
 innodb_rwlock_x_spin_waits	disabled
+innodb_rwlock_sx_spin_waits	disabled
 innodb_rwlock_s_spin_rounds	disabled
 innodb_rwlock_x_spin_rounds	disabled
+innodb_rwlock_sx_spin_rounds	disabled
 innodb_rwlock_s_os_waits	disabled
 innodb_rwlock_x_os_waits	disabled
+innodb_rwlock_sx_os_waits	disabled
 dml_reads	disabled
 dml_inserts	disabled
 dml_deletes	disabled
@@ -239,6 +254,8 @@ ddl_background_drop_indexes	disabled
 ddl_background_drop_tables	disabled
 ddl_online_create_index	disabled
 ddl_pending_alter_table	disabled
+ddl_sort_file_alter_table	disabled
+ddl_log_file_alter_table	disabled
 icp_attempts	disabled
 icp_no_match	disabled
 icp_out_of_range	disabled
@@ -280,10 +297,13 @@ 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_sx_spin_waits	disabled
 innodb_rwlock_s_spin_rounds	disabled
 innodb_rwlock_x_spin_rounds	disabled
+innodb_rwlock_sx_spin_rounds	disabled
 innodb_rwlock_s_os_waits	disabled
 innodb_rwlock_x_os_waits	disabled
+innodb_rwlock_sx_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="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
@@ -408,7 +428,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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,
@@ -419,7 +438,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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
@@ -429,7 +447,6 @@ name	max_count	min_count	count	max_count_reset	min_count_reset	count_reset	statu
 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);
diff --git a/mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result b/mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result
new file mode 100644
index 0000000..6f6fb35
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_numa_interleave_basic.result
@@ -0,0 +1,10 @@
+SELECT @@GLOBAL.innodb_numa_interleave;
+@@GLOBAL.innodb_numa_interleave
+1
+SET @@GLOBAL.innodb_numa_interleave=off;
+ERROR HY000: Variable 'innodb_numa_interleave' is a read only variable
+SELECT @@GLOBAL.innodb_use_native_aio;
+@@GLOBAL.innodb_use_native_aio
+0
+SELECT @@SESSION.innodb_use_native_aio;
+ERROR HY000: Variable 'innodb_use_native_aio' is a GLOBAL variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_old_blocks_pct_basic.result b/mysql-test/suite/sys_vars/r/innodb_old_blocks_pct_basic.result
index bbcc2da..6309ffc 100644
--- a/mysql-test/suite/sys_vars/r/innodb_old_blocks_pct_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_old_blocks_pct_basic.result
@@ -35,12 +35,20 @@ VARIABLE_NAME	VARIABLE_VALUE
 INNODB_OLD_BLOCKS_PCT	10
 set session innodb_old_blocks_pct=1;
 ERROR HY000: Variable 'innodb_old_blocks_pct' is a GLOBAL variable and should be set with SET GLOBAL
+set @@global.innodb_old_blocks_pct=DEFAULT;
+select @@global.innodb_old_blocks_pct;
+@@global.innodb_old_blocks_pct
+37
 set global innodb_old_blocks_pct=1.1;
 ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_pct'
 set global innodb_old_blocks_pct=1e1;
 ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_pct'
 set global innodb_old_blocks_pct="foo";
 ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_pct'
+set global innodb_old_blocks_pct=" ";
+ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_pct'
+set global innodb_old_blocks_pct='';
+ERROR 42000: Incorrect argument type to variable 'innodb_old_blocks_pct'
 set global innodb_old_blocks_pct=4;
 Warnings:
 Warning	1292	Truncated incorrect innodb_old_blocks_pct value: '4'
diff --git a/mysql-test/suite/sys_vars/r/innodb_page_cleaners_basic.result b/mysql-test/suite/sys_vars/r/innodb_page_cleaners_basic.result
new file mode 100644
index 0000000..5a89af5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_page_cleaners_basic.result
@@ -0,0 +1,41 @@
+SELECT COUNT(@@GLOBAL.innodb_page_cleaners);
+COUNT(@@GLOBAL.innodb_page_cleaners)
+1
+1 Expected
+SELECT COUNT(@@innodb_page_cleaners);
+COUNT(@@innodb_page_cleaners)
+1
+1 Expected
+SET @@GLOBAL.innodb_page_cleaners=1;
+ERROR HY000: Variable 'innodb_page_cleaners' is a read only variable
+Expected error 'Read-only variable'
+SELECT innodb_page_cleaners = @@SESSION.innodb_page_cleaners;
+ERROR 42S22: Unknown column 'innodb_page_cleaners' in 'field list'
+Expected error 'Read-only variable'
+SELECT @@GLOBAL.innodb_page_cleaners = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_page_cleaners';
+@@GLOBAL.innodb_page_cleaners = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_page_cleaners';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+SELECT @@innodb_page_cleaners = @@GLOBAL.innodb_page_cleaners;
+@@innodb_page_cleaners = @@GLOBAL.innodb_page_cleaners
+1
+1 Expected
+SELECT COUNT(@@local.innodb_page_cleaners);
+ERROR HY000: Variable 'innodb_page_cleaners' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_page_cleaners);
+ERROR HY000: Variable 'innodb_page_cleaners' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT VARIABLE_NAME, VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME = 'innodb_page_cleaners';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_PAGE_CLEANERS	1
diff --git a/mysql-test/suite/sys_vars/r/innodb_page_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_page_size_basic.result
index d9d067c..f1a90f0 100644
--- a/mysql-test/suite/sys_vars/r/innodb_page_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_page_size_basic.result
@@ -1 +1,8 @@
-XtraDB extension
+SET @orig = @@global.innodb_page_size;
+SELECT @orig;
+ at orig
+{valid_page_size}
+SET GLOBAL innodb_page_size = 4k;
+ERROR HY000: Variable 'innodb_page_size' is a read only variable
+SET GLOBAL innodb_page_size = 8k;
+ERROR HY000: Variable 'innodb_page_size' is a read only variable
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 8f81df7..6279cd1 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
@@ -29,10 +29,12 @@ SET @@global.innodb_purge_batch_size = 5000;
 SELECT @@global.innodb_purge_batch_size;
 @@global.innodb_purge_batch_size
 5000
-SET @@global.innodb_purge_batch_size = 1000;
+SET @@global.innodb_purge_batch_size = 4294967295;
+Warnings:
+Warning	1292	Truncated incorrect innodb_purge_batch_size value: '4294967295'
 SELECT @@global.innodb_purge_batch_size;
 @@global.innodb_purge_batch_size
-1000
+5000
 '#--------------------FN_DYNVARS_046_04-------------------------#'
 SET @@global.innodb_purge_batch_size = 0;
 Warnings:
@@ -50,9 +52,24 @@ ERROR 42000: Incorrect argument type to variable 'innodb_purge_batch_size'
 SELECT @@global.innodb_purge_batch_size;
 @@global.innodb_purge_batch_size
 1
-SET @@global.innodb_purge_batch_size = 5001;
+SET @@global.innodb_purge_batch_size = ' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_purge_batch_size'
+SELECT @@global.innodb_purge_batch_size;
+@@global.innodb_purge_batch_size
+1
+SET @@global.innodb_purge_batch_size = " ";
+ERROR 42000: Incorrect argument type to variable 'innodb_purge_batch_size'
+SELECT @@global.innodb_purge_batch_size;
+@@global.innodb_purge_batch_size
+1
+SET @@global.innodb_purge_batch_size = 1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_purge_batch_size'
+SELECT @@global.innodb_purge_batch_size;
+@@global.innodb_purge_batch_size
+1
+SET @@global.innodb_purge_batch_size = 4294967297;
 Warnings:
-Warning	1292	Truncated incorrect innodb_purge_batch_size value: '5001'
+Warning	1292	Truncated incorrect innodb_purge_batch_size value: '4294967297'
 SELECT @@global.innodb_purge_batch_size;
 @@global.innodb_purge_batch_size
 5000
diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_rseg_truncate_frequency_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_rseg_truncate_frequency_basic.result
new file mode 100644
index 0000000..79eb074
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_purge_rseg_truncate_frequency_basic.result
@@ -0,0 +1,113 @@
+SET @global_start_value = @@global.innodb_purge_rseg_truncate_frequency;
+SELECT @global_start_value;
+ at global_start_value
+128
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_purge_rseg_truncate_frequency = 1;
+SET @@global.innodb_purge_rseg_truncate_frequency = DEFAULT;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+128
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_purge_rseg_truncate_frequency = 1;
+ERROR HY000: Variable 'innodb_purge_rseg_truncate_frequency' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_purge_rseg_truncate_frequency;
+@@innodb_purge_rseg_truncate_frequency
+128
+SELECT local.innodb_purge_rseg_truncate_frequency;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_purge_rseg_truncate_frequency = 1;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_purge_rseg_truncate_frequency = 1;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = 1;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = 128;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+128
+'#--------------------FN_DYNVARS_046_05-------------------------#'
+SET @@global.innodb_purge_rseg_truncate_frequency = -1;
+Warnings:
+Warning	1292	Truncated incorrect innodb_purge_rseg_truncate_frequ value: '-1'
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = -1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_purge_rseg_truncate_frequ value: '-1024'
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_purge_rseg_truncate_frequency'
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_purge_rseg_truncate_frequency'
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = 1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_purge_rseg_truncate_frequency'
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = ' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_purge_rseg_truncate_frequency'
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = " ";
+ERROR 42000: Incorrect argument type to variable 'innodb_purge_rseg_truncate_frequency'
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+'#----------------------FN_DYNVARS_046_06------------------------#'
+SELECT @@global.innodb_purge_rseg_truncate_frequency =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_purge_rseg_truncate_frequency';
+@@global.innodb_purge_rseg_truncate_frequency =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_purge_rseg_truncate_frequency';
+VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_046_07-------------------------#'
+SET @@global.innodb_purge_rseg_truncate_frequency = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_purge_rseg_truncate_frequency'
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_purge_rseg_truncate_frequency'
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+'#---------------------FN_DYNVARS_046_08----------------------#'
+SET @@global.innodb_purge_rseg_truncate_frequency = TRUE;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect innodb_purge_rseg_truncate_frequ value: '0'
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+1
+SET @@global.innodb_purge_rseg_truncate_frequency = @global_start_value;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+@@global.innodb_purge_rseg_truncate_frequency
+128
diff --git a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
index e3358a1..2cb697a 100644
--- a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
@@ -1,53 +1,41 @@
-'#---------------------BS_STVARS_035_01----------------------#'
 SELECT COUNT(@@GLOBAL.innodb_purge_threads);
 COUNT(@@GLOBAL.innodb_purge_threads)
 1
 1 Expected
-'#---------------------BS_STVARS_035_02----------------------#'
-SET @@GLOBAL.innodb_purge_threads=1;
-ERROR HY000: Variable 'innodb_purge_threads' is a read only variable
-Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
-COUNT(@@GLOBAL.innodb_purge_threads)
+SELECT COUNT(@@innodb_purge_threads);
+COUNT(@@innodb_purge_threads)
 1
 1 Expected
-'#---------------------BS_STVARS_035_03----------------------#'
+SET @@GLOBAL.innodb_purge_threads=1;
+ERROR HY000: Variable 'innodb_purge_threads' is a read only variable
+Expected error 'Read-only variable'
+SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
+ERROR 42S22: Unknown column 'innodb_purge_threads' in 'field list'
+Expected error 'Read-only variable'
 SELECT @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_purge_threads';
 @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE
 1
 1 Expected
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
-COUNT(@@GLOBAL.innodb_purge_threads)
-1
-1 Expected
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_purge_threads';
 COUNT(VARIABLE_VALUE)
 1
 1 Expected
-'#---------------------BS_STVARS_035_04----------------------#'
 SELECT @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads;
 @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads
 1
 1 Expected
-'#---------------------BS_STVARS_035_05----------------------#'
-SELECT COUNT(@@innodb_purge_threads);
-COUNT(@@innodb_purge_threads)
-1
-1 Expected
 SELECT COUNT(@@local.innodb_purge_threads);
 ERROR HY000: Variable 'innodb_purge_threads' is a GLOBAL variable
 Expected error 'Variable is a GLOBAL variable'
 SELECT COUNT(@@SESSION.innodb_purge_threads);
 ERROR HY000: Variable 'innodb_purge_threads' is a GLOBAL variable
 Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
-COUNT(@@GLOBAL.innodb_purge_threads)
-1
-1 Expected
-SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
-ERROR 42S22: Unknown column 'innodb_purge_threads' in 'field list'
-Expected error 'Readonly variable'
+SELECT VARIABLE_NAME, VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME = 'innodb_purge_threads';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_PURGE_THREADS	4
diff --git a/mysql-test/suite/sys_vars/r/innodb_read_ahead_threshold_basic.result b/mysql-test/suite/sys_vars/r/innodb_read_ahead_threshold_basic.result
index 65a1a8e..8ca5862 100644
--- a/mysql-test/suite/sys_vars/r/innodb_read_ahead_threshold_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_read_ahead_threshold_basic.result
@@ -35,12 +35,26 @@ VARIABLE_NAME	VARIABLE_VALUE
 INNODB_READ_AHEAD_THRESHOLD	10
 set session innodb_read_ahead_threshold=1;
 ERROR HY000: Variable 'innodb_read_ahead_threshold' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_read_ahead_threshold=DEFAULT;
+select @@global.innodb_read_ahead_threshold;
+@@global.innodb_read_ahead_threshold
+56
 set global innodb_read_ahead_threshold=1.1;
 ERROR 42000: Incorrect argument type to variable 'innodb_read_ahead_threshold'
 set global innodb_read_ahead_threshold=1e1;
 ERROR 42000: Incorrect argument type to variable 'innodb_read_ahead_threshold'
 set global innodb_read_ahead_threshold="foo";
 ERROR 42000: Incorrect argument type to variable 'innodb_read_ahead_threshold'
+set global innodb_read_ahead_threshold=' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_read_ahead_threshold'
+select @@global.innodb_read_ahead_threshold;
+@@global.innodb_read_ahead_threshold
+56
+set global innodb_read_ahead_threshold=" ";
+ERROR 42000: Incorrect argument type to variable 'innodb_read_ahead_threshold'
+select @@global.innodb_read_ahead_threshold;
+@@global.innodb_read_ahead_threshold
+56
 set global innodb_read_ahead_threshold=-7;
 Warnings:
 Warning	1292	Truncated incorrect innodb_read_ahead_threshold value: '-7'
diff --git a/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result
index fa00baa..5e0fb42 100644
--- a/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_replication_delay_basic.result
@@ -35,21 +35,65 @@ VARIABLE_NAME	VARIABLE_VALUE
 INNODB_REPLICATION_DELAY	10
 set session innodb_replication_delay=1;
 ERROR HY000: Variable 'innodb_replication_delay' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_replication_delay=DEFAULT;
+select @@global.innodb_replication_delay;
+@@global.innodb_replication_delay
+0
+set global innodb_replication_delay=0;
+select @@global.innodb_replication_delay;
+@@global.innodb_replication_delay
+0
+set global innodb_replication_delay=65535;
+select @@global.innodb_replication_delay;
+@@global.innodb_replication_delay
+65535
+set global innodb_replication_delay=4294967295;
+select @@global.innodb_replication_delay;
+@@global.innodb_replication_delay
+4294967295
 set global innodb_replication_delay=1.1;
 ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay'
 set global innodb_replication_delay=1e1;
 ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay'
 set global innodb_replication_delay="foo";
 ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay'
+set global innodb_replication_delay=' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay'
+select @@global.innodb_replication_delay;
+@@global.innodb_replication_delay
+4294967295
+set global innodb_replication_delay=" ";
+ERROR 42000: Incorrect argument type to variable 'innodb_replication_delay'
+select @@global.innodb_replication_delay;
+@@global.innodb_replication_delay
+4294967295
 set global innodb_replication_delay=-7;
 Warnings:
 Warning	1292	Truncated incorrect innodb_replication_delay value: '-7'
 select @@global.innodb_replication_delay;
 @@global.innodb_replication_delay
 0
+set global innodb_replication_delay=-1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_replication_delay value: '-1024'
+select @@global.innodb_replication_delay;
+@@global.innodb_replication_delay
+0
 select * from information_schema.global_variables where variable_name='innodb_replication_delay';
 VARIABLE_NAME	VARIABLE_VALUE
 INNODB_REPLICATION_DELAY	0
+SET @@global.innodb_replication_delay = 4294967296;
+SELECT @@global.innodb_replication_delay IN (4294967296,4294967295);
+@@global.innodb_replication_delay IN (4294967296,4294967295)
+1
+SET @@global.innodb_replication_delay = 12345678901;
+SELECT @@global.innodb_replication_delay IN (12345678901,4294967295);
+@@global.innodb_replication_delay IN (12345678901,4294967295)
+1
+SET @@global.innodb_replication_delay = 18446744073709551615;
+SELECT @@global.innodb_replication_delay IN (18446744073709551615,4294967295);
+@@global.innodb_replication_delay IN (18446744073709551615,4294967295)
+1
 SET @@global.innodb_replication_delay = @start_global_value;
 SELECT @@global.innodb_replication_delay;
 @@global.innodb_replication_delay
diff --git a/mysql-test/suite/sys_vars/r/innodb_spin_wait_delay_basic.result b/mysql-test/suite/sys_vars/r/innodb_spin_wait_delay_basic.result
index 05672cb..621ef56 100644
--- a/mysql-test/suite/sys_vars/r/innodb_spin_wait_delay_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_spin_wait_delay_basic.result
@@ -35,21 +35,65 @@ VARIABLE_NAME	VARIABLE_VALUE
 INNODB_SPIN_WAIT_DELAY	10
 set session innodb_spin_wait_delay=1;
 ERROR HY000: Variable 'innodb_spin_wait_delay' is a GLOBAL variable and should be set with SET GLOBAL
+set global innodb_spin_wait_delay=DEFAULT;
+select @@global.innodb_spin_wait_delay;
+@@global.innodb_spin_wait_delay
+6
+set global innodb_spin_wait_delay=0;
+select @@global.innodb_spin_wait_delay;
+@@global.innodb_spin_wait_delay
+0
+set global innodb_spin_wait_delay=65535;
+select @@global.innodb_spin_wait_delay;
+@@global.innodb_spin_wait_delay
+65535
+set global innodb_spin_wait_delay=4294967295;
+select @@global.innodb_spin_wait_delay;
+@@global.innodb_spin_wait_delay
+4294967295
 set global innodb_spin_wait_delay=1.1;
 ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
 set global innodb_spin_wait_delay=1e1;
 ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
 set global innodb_spin_wait_delay="foo";
 ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
+set global innodb_spin_wait_delay=' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
+select @@global.innodb_spin_wait_delay;
+@@global.innodb_spin_wait_delay
+4294967295
+set global innodb_spin_wait_delay=" ";
+ERROR 42000: Incorrect argument type to variable 'innodb_spin_wait_delay'
+select @@global.innodb_spin_wait_delay;
+@@global.innodb_spin_wait_delay
+4294967295
 set global innodb_spin_wait_delay=-7;
 Warnings:
 Warning	1292	Truncated incorrect innodb_spin_wait_delay value: '-7'
 select @@global.innodb_spin_wait_delay;
 @@global.innodb_spin_wait_delay
 0
+set global innodb_spin_wait_delay=-1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_spin_wait_delay value: '-1024'
+select @@global.innodb_spin_wait_delay;
+@@global.innodb_spin_wait_delay
+0
 select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay';
 VARIABLE_NAME	VARIABLE_VALUE
 INNODB_SPIN_WAIT_DELAY	0
+SET @@global.innodb_spin_wait_delay = 4294967296;
+SELECT @@global.innodb_spin_wait_delay IN (4294967296,4294967295);
+@@global.innodb_spin_wait_delay IN (4294967296,4294967295)
+1
+SET @@global.innodb_spin_wait_delay = 12345678901;
+SELECT @@global.innodb_spin_wait_delay IN (12345678901,4294967295);
+@@global.innodb_spin_wait_delay IN (12345678901,4294967295)
+1
+SET @@global.innodb_spin_wait_delay = 18446744073709551615;
+SELECT @@global.innodb_spin_wait_delay IN (18446744073709551615,4294967295);
+@@global.innodb_spin_wait_delay IN (18446744073709551615,4294967295)
+1
 SET @@global.innodb_spin_wait_delay = @start_global_value;
 SELECT @@global.innodb_spin_wait_delay;
 @@global.innodb_spin_wait_delay
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
index 1cbdd16..94de032 100644
--- a/mysql-test/suite/sys_vars/r/innodb_stats_persistent_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_stats_persistent_basic.result
@@ -21,4 +21,4 @@ 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;
+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
index d2e8486..ec211b6 100644
--- 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
@@ -29,7 +29,7 @@ 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 
+SELECT * FROM information_schema.global_variables
 WHERE variable_name='innodb_stats_persistent_sample_pages';
 VARIABLE_NAME	VARIABLE_VALUE
 INNODB_STATS_PERSISTENT_SAMPLE_PAGES	10
@@ -39,12 +39,36 @@ 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=DEFAULT;
+select @@global.innodb_stats_persistent_sample_pages;
+@@global.innodb_stats_persistent_sample_pages
+20
+SET global innodb_stats_persistent_sample_pages=0;
+Warnings:
+Warning	1292	Truncated incorrect innodb_stats_persistent_sample_p value: '0'
+SELECT @@global.innodb_stats_persistent_sample_pages;
+@@global.innodb_stats_persistent_sample_pages
+1
+SET global innodb_stats_persistent_sample_pages=10;
+SELECT @@global.innodb_stats_persistent_sample_pages;
+@@global.innodb_stats_persistent_sample_pages
+10
 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=' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_persistent_sample_pages'
+SELECT @@global.innodb_stats_persistent_sample_pages;
+@@global.innodb_stats_persistent_sample_pages
+10
+SET global innodb_stats_persistent_sample_pages=" ";
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_persistent_sample_pages'
+SELECT @@global.innodb_stats_persistent_sample_pages;
+@@global.innodb_stats_persistent_sample_pages
+10
 SET global innodb_stats_persistent_sample_pages=-7;
 Warnings:
 Warning	1292	Truncated incorrect innodb_stats_persistent_sample_p value: '-7'
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 e490773..8618d60 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
@@ -37,12 +37,28 @@ VARIABLE_NAME	VARIABLE_VALUE
 INNODB_STATS_SAMPLE_PAGES	10
 set session innodb_stats_sample_pages=1;
 ERROR HY000: Variable 'innodb_stats_sample_pages' is a GLOBAL variable and should be set with SET GLOBAL
-set global innodb_stats_sample_pages=1.1;
+set global innodb_stats_sample_pages=DEFAULT;
+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
+set global innodb_stats_sample_pages = 1.1;
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
+set global innodb_stats_sample_pages = 1e1;
 ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
-set global innodb_stats_sample_pages=1e1;
+set global innodb_stats_sample_pages = "foo";
 ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
-set global innodb_stats_sample_pages="foo";
+set global innodb_stats_sample_pages=' ';
 ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
+select @@global.innodb_stats_sample_pages;
+@@global.innodb_stats_sample_pages
+8
+set global innodb_stats_sample_pages=" ";
+ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
+select @@global.innodb_stats_sample_pages;
+@@global.innodb_stats_sample_pages
+8
 set global innodb_stats_sample_pages=-7;
 Warnings:
 Warning	1292	Truncated incorrect innodb_stats_sample_pages value: '-7'
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
index 4c60dd5..1ea5ac3 100644
--- 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
@@ -25,6 +25,10 @@ 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=DEFAULT;
+select @@global.innodb_stats_transient_sample_pages;
+@@global.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
@@ -45,6 +49,8 @@ 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=' ';
+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'
diff --git a/mysql-test/suite/sys_vars/r/innodb_sync_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_sync_debug_basic.result
new file mode 100644
index 0000000..72420c8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_sync_debug_basic.result
@@ -0,0 +1,11 @@
+#
+# Basic test for innodb_sync_debug
+#
+SELECT @@global.innodb_sync_debug;
+@@global.innodb_sync_debug
+0
+set global innodb_sync_debug = 1;
+ERROR HY000: Variable 'innodb_sync_debug' is a read only variable
+SELECT @@global.innodb_sync_debug;
+@@global.innodb_sync_debug
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic.result b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic.result
index ba45d4f..3377b69 100644
--- a/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic.result
@@ -25,15 +25,28 @@ SET @@global.innodb_sync_spin_loops = 0;
 SELECT @@global.innodb_sync_spin_loops;
 @@global.innodb_sync_spin_loops
 0
-SET @@global.innodb_sync_spin_loops = 1;
+SET @@global.innodb_sync_spin_loops = 65535;
 SELECT @@global.innodb_sync_spin_loops;
 @@global.innodb_sync_spin_loops
-1
-SET @@global.innodb_sync_spin_loops = 1000;
+65535
+SET @@global.innodb_sync_spin_loops = 4294967295;
 SELECT @@global.innodb_sync_spin_loops;
 @@global.innodb_sync_spin_loops
-1000
+4294967295
 '#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_sync_spin_loops = 4294967296;
+SELECT @@global.innodb_sync_spin_loops IN (4294967296,4294967295);
+@@global.innodb_sync_spin_loops IN (4294967296,4294967295)
+1
+SET @@global.innodb_sync_spin_loops = 12345678901;
+SELECT @@global.innodb_sync_spin_loops IN (12345678901,4294967295);
+@@global.innodb_sync_spin_loops IN (12345678901,4294967295)
+1
+SET @@global.innodb_sync_spin_loops = 18446744073709551615;
+SELECT @@global.innodb_sync_spin_loops IN (18446744073709551615,4294967295);
+@@global.innodb_sync_spin_loops IN (18446744073709551615,4294967295)
+1
+'#--------------------FN_DYNVARS_046_05-------------------------#'
 SET @@global.innodb_sync_spin_loops = -1;
 Warnings:
 Warning	1292	Truncated incorrect innodb_sync_spin_loops value: '-1'
@@ -50,11 +63,28 @@ ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
 SELECT @@global.innodb_sync_spin_loops;
 @@global.innodb_sync_spin_loops
 0
-SET @@global.innodb_sync_spin_loops = 1001;
+SET @@global.innodb_sync_spin_loops = 65535.01;
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+0
+SET @@global.innodb_sync_spin_loops = -1024;
+Warnings:
+Warning	1292	Truncated incorrect innodb_sync_spin_loops value: '-1024'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+0
+SET @@global.innodb_sync_spin_loops = " ";
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+0
+SET @@global.innodb_sync_spin_loops = ' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
 SELECT @@global.innodb_sync_spin_loops;
 @@global.innodb_sync_spin_loops
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
+0
+'#----------------------FN_DYNVARS_046_06------------------------#'
 SELECT @@global.innodb_sync_spin_loops =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_sync_spin_loops';
@@ -63,23 +93,23 @@ VARIABLE_VALUE
 1
 SELECT @@global.innodb_sync_spin_loops;
 @@global.innodb_sync_spin_loops
-1001
+0
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_sync_spin_loops';
 VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
+0
+'#---------------------FN_DYNVARS_046_07-------------------------#'
 SET @@global.innodb_sync_spin_loops = OFF;
 ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
 SELECT @@global.innodb_sync_spin_loops;
 @@global.innodb_sync_spin_loops
-1001
+0
 SET @@global.innodb_sync_spin_loops = ON;
 ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
 SELECT @@global.innodb_sync_spin_loops;
 @@global.innodb_sync_spin_loops
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
+0
+'#---------------------FN_DYNVARS_046_08----------------------#'
 SET @@global.innodb_sync_spin_loops = TRUE;
 SELECT @@global.innodb_sync_spin_loops;
 @@global.innodb_sync_spin_loops
diff --git a/mysql-test/suite/sys_vars/r/innodb_table_locks_func.result b/mysql-test/suite/sys_vars/r/innodb_table_locks_func.result
index 8e7806a..0f9e1e8 100644
--- a/mysql-test/suite/sys_vars/r/innodb_table_locks_func.result
+++ b/mysql-test/suite/sys_vars/r/innodb_table_locks_func.result
@@ -4,7 +4,9 @@ SELECT @start_value;
 @start_value
 1
 SET @@global.innodb_table_locks = OFF;
+'connect (con1,localhost,root,,,,)'
 connect  con1,localhost,root,,,,;
+'connection con1'
 connection con1;
 SELECT @@global.innodb_table_locks;
 @@global.innodb_table_locks
@@ -15,7 +17,9 @@ SELECT @@session.innodb_table_locks;
 disconnect con1;
 '#--------------------FN_DYNVARS_048_02-------------------------#'
 '----check when innodb_table_locks = ON and autocommit = OFF---'
+'connect (con2,localhost,root,,,,)'
 connect  con2,localhost,root,,,,;
+'connection default'
 connection default;
 DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 (a INT) ENGINE=INNODB;
@@ -26,12 +30,15 @@ INSERT INTO t1 VALUES(1);
 SELECT * FROM t1 FOR UPDATE;
 a
 1
+'CONNECTION con2'
 connection con2;
 SET @@innodb_table_locks = ON;
 SET @@autocommit = OFF;
 LOCK TABLES t1 WRITE;
+'CONNECTION default'
 connection default;
 COMMIT;
+'CONNECTION con2'
 connection con2;
 UNLOCK tables;
 DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/innodb_temp_data_file_path_basic.result b/mysql-test/suite/sys_vars/r/innodb_temp_data_file_path_basic.result
new file mode 100644
index 0000000..2357a07
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_temp_data_file_path_basic.result
@@ -0,0 +1,53 @@
+'#---------------------BS_STVARS_024_01----------------------#'
+SELECT COUNT(@@GLOBAL.innodb_temp_data_file_path);
+COUNT(@@GLOBAL.innodb_temp_data_file_path)
+1
+1 Expected
+'#---------------------BS_STVARS_024_02----------------------#'
+SET @@GLOBAL.innodb_temp_data_file_path=1;
+ERROR HY000: Variable 'innodb_temp_data_file_path' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_temp_data_file_path);
+COUNT(@@GLOBAL.innodb_temp_data_file_path)
+1
+1 Expected
+'#---------------------BS_STVARS_024_03----------------------#'
+SELECT @@GLOBAL.innodb_temp_data_file_path = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_temp_data_file_path';
+@@GLOBAL.innodb_temp_data_file_path = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_temp_data_file_path);
+COUNT(@@GLOBAL.innodb_temp_data_file_path)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_temp_data_file_path';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_024_04----------------------#'
+SELECT @@innodb_temp_data_file_path = @@GLOBAL.innodb_temp_data_file_path;
+@@innodb_temp_data_file_path = @@GLOBAL.innodb_temp_data_file_path
+1
+1 Expected
+'#---------------------BS_STVARS_024_05----------------------#'
+SELECT COUNT(@@innodb_temp_data_file_path);
+COUNT(@@innodb_temp_data_file_path)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_temp_data_file_path);
+ERROR HY000: Variable 'innodb_temp_data_file_path' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_temp_data_file_path);
+ERROR HY000: Variable 'innodb_temp_data_file_path' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_temp_data_file_path);
+COUNT(@@GLOBAL.innodb_temp_data_file_path)
+1
+1 Expected
+SELECT innodb_temp_data_file_path = @@SESSION.innodb_temp_data_file_path;
+ERROR 42S22: Unknown column 'innodb_temp_data_file_path' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result b/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
index c7af96b..ca3c253 100644
--- a/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result
@@ -50,12 +50,27 @@ ERROR 42000: Incorrect argument type to variable 'innodb_thread_concurrency'
 SELECT @@global.innodb_thread_concurrency;
 @@global.innodb_thread_concurrency
 0
+SET @@global.innodb_thread_concurrency = ' ';
+ERROR 42000: Incorrect argument type to variable 'innodb_thread_concurrency'
+SELECT @@global.innodb_thread_concurrency;
+@@global.innodb_thread_concurrency
+0
+SET @@global.innodb_thread_concurrency = " ";
+ERROR 42000: Incorrect argument type to variable 'innodb_thread_concurrency'
+SELECT @@global.innodb_thread_concurrency;
+@@global.innodb_thread_concurrency
+0
 SET @@global.innodb_thread_concurrency = 1001;
 Warnings:
 Warning	1292	Truncated incorrect innodb_thread_concurrency value: '1001'
 SELECT @@global.innodb_thread_concurrency;
 @@global.innodb_thread_concurrency
 1000
+SET @@global.innodb_thread_concurrency = 255.01;
+ERROR 42000: Incorrect argument type to variable 'innodb_thread_concurrency'
+SELECT @@global.innodb_thread_concurrency;
+@@global.innodb_thread_concurrency
+1000
 '#----------------------FN_DYNVARS_046_05------------------------#'
 SELECT @@global.innodb_thread_concurrency =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
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
index e7d7cef..fbafe65 100644
--- a/mysql-test/suite/sys_vars/r/innodb_undo_directory_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_undo_directory_basic.result
@@ -1,7 +1,7 @@
-SELECT @@GLOBAL.innodb_undo_directory;
-@@GLOBAL.innodb_undo_directory
-.
-. Expected
+SELECT COUNT(@@GLOBAL.innodb_undo_directory);
+COUNT(@@GLOBAL.innodb_undo_directory)
+1
+1 Expected
 SET @@GLOBAL.innodb_undo_directory="/tmp";
 ERROR HY000: Variable 'innodb_undo_directory' is a read only variable
 Expected error 'Read only variable'
@@ -9,12 +9,12 @@ SELECT COUNT(@@GLOBAL.innodb_undo_directory);
 COUNT(@@GLOBAL.innodb_undo_directory)
 1
 1 Expected
-SELECT VARIABLE_VALUE
+SELECT @@GLOBAL.innodb_undo_directory = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_undo_directory';
-VARIABLE_VALUE
-.
-. Expected
+@@GLOBAL.innodb_undo_directory = VARIABLE_VALUE
+1
+1 Expected
 SELECT COUNT(@@GLOBAL.innodb_undo_directory);
 COUNT(@@GLOBAL.innodb_undo_directory)
 1
diff --git a/mysql-test/suite/sys_vars/r/innodb_undo_log_truncate_basic.result b/mysql-test/suite/sys_vars/r/innodb_undo_log_truncate_basic.result
new file mode 100644
index 0000000..eb42f49
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_undo_log_truncate_basic.result
@@ -0,0 +1,69 @@
+SET @start_global_value = @@global.innodb_undo_log_truncate;
+SELECT @start_global_value;
+ at start_global_value
+0
+'#---------------------BS_STVARS_028_01----------------------#'
+SELECT COUNT(@@GLOBAL.innodb_undo_log_truncate);
+COUNT(@@GLOBAL.innodb_undo_log_truncate)
+1
+1 Expected
+'#---------------------BS_STVARS_028_02----------------------#'
+SET @@global.innodb_undo_log_truncate = 0;
+SELECT @@global.innodb_undo_log_truncate;
+@@global.innodb_undo_log_truncate
+0
+SET @@global.innodb_undo_log_truncate ='On' ;
+SELECT @@global.innodb_undo_log_truncate;
+@@global.innodb_undo_log_truncate
+1
+SET @@global.innodb_undo_log_truncate ='Off' ;
+SELECT @@global.innodb_undo_log_truncate;
+@@global.innodb_undo_log_truncate
+0
+SET @@global.innodb_undo_log_truncate = 1;
+SELECT @@global.innodb_undo_log_truncate;
+@@global.innodb_undo_log_truncate
+1
+'#---------------------BS_STVARS_028_03----------------------#'
+SELECT IF(@@GLOBAL.innodb_undo_log_truncate,'ON','OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_log_truncate';
+IF(@@GLOBAL.innodb_undo_log_truncate,'ON','OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_undo_log_truncate);
+COUNT(@@GLOBAL.innodb_undo_log_truncate)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_log_truncate';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+'#---------------------BS_STVARS_028_04----------------------#'
+SELECT @@innodb_undo_log_truncate = @@GLOBAL.innodb_undo_log_truncate;
+@@innodb_undo_log_truncate = @@GLOBAL.innodb_undo_log_truncate
+1
+1 Expected
+'#---------------------BS_STVARS_028_05----------------------#'
+SELECT COUNT(@@innodb_undo_log_truncate);
+COUNT(@@innodb_undo_log_truncate)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_undo_log_truncate);
+ERROR HY000: Variable 'innodb_undo_log_truncate' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_undo_log_truncate);
+ERROR HY000: Variable 'innodb_undo_log_truncate' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_undo_log_truncate);
+COUNT(@@GLOBAL.innodb_undo_log_truncate)
+1
+1 Expected
+SELECT innodb_undo_log_truncate = @@SESSION.innodb_undo_log_truncate;
+ERROR 42S22: Unknown column 'innodb_undo_log_truncate' in 'field list'
+SET @@global.innodb_undo_log_truncate = @start_global_value;
+SELECT @@global.innodb_undo_log_truncate;
+@@global.innodb_undo_log_truncate
+0
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
index 6130484..c7e0b21 100644
--- a/mysql-test/suite/sys_vars/r/innodb_undo_tablespaces_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_undo_tablespaces_basic.result
@@ -1,7 +1,6 @@
-SELECT @@GLOBAL.innodb_undo_tablespaces;
-@@GLOBAL.innodb_undo_tablespaces
-0
-0 Expected
+SELECT @@GLOBAL.innodb_undo_tablespaces >= 0;
+@@GLOBAL.innodb_undo_tablespaces >= 0
+1
 SET @@GLOBAL.innodb_undo_tablespaces=128;
 ERROR HY000: Variable 'innodb_undo_tablespaces' is a read only variable
 Expected error 'Read only variable'
@@ -9,10 +8,7 @@ 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
+DIFFERENCE
 0
 0 Expected
 SELECT @@innodb_undo_tablespaces = @@GLOBAL.innodb_undo_tablespaces;
diff --git a/mysql-test/suite/sys_vars/r/innodb_use_sys_malloc_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_sys_malloc_basic.result
deleted file mode 100644
index 70ecef7..0000000
--- a/mysql-test/suite/sys_vars/r/innodb_use_sys_malloc_basic.result
+++ /dev/null
@@ -1,22 +0,0 @@
-Valid values are 'ON' and 'OFF' 
-select @@global.innodb_use_sys_malloc;
-@@global.innodb_use_sys_malloc
-1
-select @@session.innodb_use_sys_malloc;
-ERROR HY000: Variable 'innodb_use_sys_malloc' is a GLOBAL variable
-show global variables like 'innodb_use_sys_malloc';
-Variable_name	Value
-innodb_use_sys_malloc	ON
-show session variables like 'innodb_use_sys_malloc';
-Variable_name	Value
-innodb_use_sys_malloc	ON
-select * from information_schema.global_variables where variable_name='innodb_use_sys_malloc';
-VARIABLE_NAME	VARIABLE_VALUE
-INNODB_USE_SYS_MALLOC	ON
-select * from information_schema.session_variables where variable_name='innodb_use_sys_malloc';
-VARIABLE_NAME	VARIABLE_VALUE
-INNODB_USE_SYS_MALLOC	ON
-set global innodb_use_sys_malloc=1;
-ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable
-set session innodb_use_sys_malloc=1;
-ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 9f92ea9..1a7a018 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -47,6 +47,20 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	OPTIONAL
+VARIABLE_NAME	INNODB_ADAPTIVE_HASH_INDEX_PARTS
+SESSION_VALUE	NULL
+GLOBAL_VALUE	8
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	8
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BIGINT UNSIGNED
+VARIABLE_COMMENT	Number of InnoDB Adapative Hash Index Partitions. (default = 8). 
+NUMERIC_MIN_VALUE	1
+NUMERIC_MAX_VALUE	512
+NUMERIC_BLOCK_SIZE	0
+ENUM_VALUE_LIST	NULL
+READ_ONLY	YES
+COMMAND_LINE_ARGUMENT	OPTIONAL
 VARIABLE_NAME	INNODB_ADAPTIVE_MAX_SLEEP_DELAY
 SESSION_VALUE	NULL
 GLOBAL_VALUE	150000
@@ -61,20 +75,6 @@ NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
-VARIABLE_NAME	INNODB_ADDITIONAL_MEM_POOL_SIZE
-SESSION_VALUE	NULL
-GLOBAL_VALUE	8388608
-GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	8388608
-VARIABLE_SCOPE	GLOBAL
-VARIABLE_TYPE	BIGINT
-VARIABLE_COMMENT	DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.
-NUMERIC_MIN_VALUE	524288
-NUMERIC_MAX_VALUE	9223372036854775807
-NUMERIC_BLOCK_SIZE	1024
-ENUM_VALUE_LIST	NULL
-READ_ONLY	YES
-COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_API_BK_COMMIT_INTERVAL
 SESSION_VALUE	NULL
 GLOBAL_VALUE	5
@@ -166,7 +166,7 @@ GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 DEFAULT_VALUE	1
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	BIGINT
-VARIABLE_COMMENT	The AUTOINC lock modes supported by InnoDB:               0 => Old style AUTOINC locking (for backward compatibility)                                           1 => New style AUTOINC locking                            2 => No AUTOINC locking (unsafe for SBR)
+VARIABLE_COMMENT	The AUTOINC lock modes supported by InnoDB: 0 => Old style AUTOINC locking (for backward compatibility); 1 => New style AUTOINC locking; 2 => No AUTOINC locking (unsafe for SBR)
 NUMERIC_MIN_VALUE	0
 NUMERIC_MAX_VALUE	2
 NUMERIC_BLOCK_SIZE	0
@@ -229,11 +229,25 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
+VARIABLE_NAME	INNODB_BUFFER_POOL_CHUNK_SIZE
+SESSION_VALUE	NULL
+GLOBAL_VALUE	8388608
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	134217728
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BIGINT UNSIGNED
+VARIABLE_COMMENT	Size of a single memory chunk within each buffer pool instance for resizing buffer pool. Online buffer pool resizing happens at this granularity. 0 means disable resizing buffer pool.
+NUMERIC_MIN_VALUE	1048576
+NUMERIC_MAX_VALUE	9223372036854775807
+NUMERIC_BLOCK_SIZE	1048576
+ENUM_VALUE_LIST	NULL
+READ_ONLY	YES
+COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_BUFFER_POOL_DUMP_AT_SHUTDOWN
 SESSION_VALUE	NULL
-GLOBAL_VALUE	OFF
+GLOBAL_VALUE	ON
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	OFF
+DEFAULT_VALUE	ON
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	BOOLEAN
 VARIABLE_COMMENT	Dump the buffer pool into a file named @@innodb_buffer_pool_filename
@@ -259,12 +273,12 @@ READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_BUFFER_POOL_DUMP_PCT
 SESSION_VALUE	NULL
-GLOBAL_VALUE	100
+GLOBAL_VALUE	25
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	100
+DEFAULT_VALUE	25
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	BIGINT UNSIGNED
-VARIABLE_COMMENT	Dump only the hottest N% of each buffer pool, defaults to 100
+VARIABLE_COMMENT	Dump only the hottest N% of each buffer pool, defaults to 25
 NUMERIC_MIN_VALUE	1
 NUMERIC_MAX_VALUE	100
 NUMERIC_BLOCK_SIZE	0
@@ -301,15 +315,15 @@ READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_BUFFER_POOL_INSTANCES
 SESSION_VALUE	NULL
-GLOBAL_VALUE	8
+GLOBAL_VALUE	1
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 DEFAULT_VALUE	0
 VARIABLE_SCOPE	GLOBAL
-VARIABLE_TYPE	BIGINT
+VARIABLE_TYPE	BIGINT UNSIGNED
 VARIABLE_COMMENT	Number of buffer pool instances, set to higher value on high-end machines to increase scalability
 NUMERIC_MIN_VALUE	0
 NUMERIC_MAX_VALUE	64
-NUMERIC_BLOCK_SIZE	1
+NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	YES
 COMMAND_LINE_ARGUMENT	REQUIRED
@@ -329,9 +343,9 @@ READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_BUFFER_POOL_LOAD_AT_STARTUP
 SESSION_VALUE	NULL
-GLOBAL_VALUE	OFF
+GLOBAL_VALUE	ON
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	OFF
+DEFAULT_VALUE	ON
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	BOOLEAN
 VARIABLE_COMMENT	Load the buffer pool from a file named @@innodb_buffer_pool_filename
@@ -367,7 +381,7 @@ NUMERIC_MIN_VALUE	5242880
 NUMERIC_MAX_VALUE	9223372036854775807
 NUMERIC_BLOCK_SIZE	1048576
 ENUM_VALUE_LIST	NULL
-READ_ONLY	YES
+READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_BUF_DUMP_STATUS_FREQUENCY
 SESSION_VALUE	NULL
@@ -455,16 +469,16 @@ READ_ONLY	YES
 COMMAND_LINE_ARGUMENT	NONE
 VARIABLE_NAME	INNODB_CHECKSUM_ALGORITHM
 SESSION_VALUE	NULL
-GLOBAL_VALUE	INNODB
+GLOBAL_VALUE	crc32
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	INNODB
+DEFAULT_VALUE	crc32
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	ENUM
 VARIABLE_COMMENT	The algorithm InnoDB uses for page checksumming. Possible values are CRC32 (hardware accelerated if the CPU supports it) write crc32, allow any of the other checksums to match when reading; STRICT_CRC32 write crc32, do not allow other algorithms to match when reading; INNODB write a software calculated checksum, allow any other checksums to match when reading; STRICT_INNODB write a software calculated checksum, do not allow other algorithms to match when reading; NONE write a constant magic number, do not do any checksum verification when reading (same as innodb_checksums=OFF); STRICT_NONE write a constant magic number, do not allow values other than that magic number when reading; Files updated when this option is set to crc32 or strict_crc32 will not be readable by MySQL versions older than 5.6.3
 NUMERIC_MIN_VALUE	NULL
 NUMERIC_MAX_VALUE	NULL
 NUMERIC_BLOCK_SIZE	NULL
-ENUM_VALUE_LIST	CRC32,STRICT_CRC32,INNODB,STRICT_INNODB,NONE,STRICT_NONE
+ENUM_VALUE_LIST	crc32,strict_crc32,innodb,strict_innodb,none,strict_none
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_CMP_PER_INDEX_ENABLED
@@ -551,6 +565,20 @@ NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	OPTIONAL
+VARIABLE_NAME	INNODB_COMPRESS_DEBUG
+SESSION_VALUE	NULL
+GLOBAL_VALUE	none
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	none
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	ENUM
+VARIABLE_COMMENT	Compress all tables, without specifying the COMRPESS table attribute
+NUMERIC_MIN_VALUE	NULL
+NUMERIC_MAX_VALUE	NULL
+NUMERIC_BLOCK_SIZE	NULL
+ENUM_VALUE_LIST	none,zlib,lz4,lz4hc
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_CONCURRENCY_TICKETS
 SESSION_VALUE	NULL
 GLOBAL_VALUE	5000
@@ -621,6 +649,20 @@ NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
+VARIABLE_NAME	INNODB_DEFAULT_ROW_FORMAT
+SESSION_VALUE	NULL
+GLOBAL_VALUE	dynamic
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	dynamic
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	ENUM
+VARIABLE_COMMENT	The default ROW FORMAT for all innodb tables created without explicit ROW_FORMAT. Possible values are REDUNDANT, COMPACT, and DYNAMIC. The ROW_FORMAT value COMPRESSED is not allowed
+NUMERIC_MIN_VALUE	NULL
+NUMERIC_MAX_VALUE	NULL
+NUMERIC_BLOCK_SIZE	NULL
+ENUM_VALUE_LIST	redundant,compact,dynamic
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_DEFRAGMENT
 SESSION_VALUE	NULL
 GLOBAL_VALUE	OFF
@@ -719,6 +761,20 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	NONE
+VARIABLE_NAME	INNODB_DISABLE_RESIZE_BUFFER_POOL_DEBUG
+SESSION_VALUE	NULL
+GLOBAL_VALUE	ON
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	ON
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BOOLEAN
+VARIABLE_COMMENT	Disable resizing buffer pool to make assertion code not expensive.
+NUMERIC_MIN_VALUE	NULL
+NUMERIC_MAX_VALUE	NULL
+NUMERIC_BLOCK_SIZE	NULL
+ENUM_VALUE_LIST	NULL
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	NONE
 VARIABLE_NAME	INNODB_DISABLE_SORT_FILE_CACHE
 SESSION_VALUE	NULL
 GLOBAL_VALUE	OFF
@@ -861,9 +917,9 @@ READ_ONLY	YES
 COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_FILE_FORMAT
 SESSION_VALUE	NULL
-GLOBAL_VALUE	Antelope
+GLOBAL_VALUE	Barracuda
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	Antelope
+DEFAULT_VALUE	Barracuda
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	VARCHAR
 VARIABLE_COMMENT	File format to use for new tables in .ibd files.
@@ -889,7 +945,7 @@ READ_ONLY	YES
 COMMAND_LINE_ARGUMENT	NONE
 VARIABLE_NAME	INNODB_FILE_FORMAT_MAX
 SESSION_VALUE	NULL
-GLOBAL_VALUE	Antelope
+GLOBAL_VALUE	Barracuda
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 DEFAULT_VALUE	Antelope
 VARIABLE_SCOPE	GLOBAL
@@ -915,6 +971,20 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	NONE
+VARIABLE_NAME	INNODB_FILL_FACTOR
+SESSION_VALUE	NULL
+GLOBAL_VALUE	100
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	100
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BIGINT
+VARIABLE_COMMENT	Percentage of B-tree page filled during bulk insert
+NUMERIC_MIN_VALUE	10
+NUMERIC_MAX_VALUE	100
+NUMERIC_BLOCK_SIZE	0
+ENUM_VALUE_LIST	NULL
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_FIL_MAKE_PAGE_DIRTY_DEBUG
 SESSION_VALUE	NULL
 GLOBAL_VALUE	0
@@ -999,6 +1069,20 @@ NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	OPTIONAL
+VARIABLE_NAME	INNODB_FLUSH_SYNC
+SESSION_VALUE	NULL
+GLOBAL_VALUE	ON
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	ON
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BOOLEAN
+VARIABLE_COMMENT	Allow IO bursts at the checkpoints ignoring io_capacity setting.
+NUMERIC_MIN_VALUE	NULL
+NUMERIC_MAX_VALUE	NULL
+NUMERIC_BLOCK_SIZE	NULL
+ENUM_VALUE_LIST	NULL
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	NONE
 VARIABLE_NAME	INNODB_FORCE_LOAD_CORRUPTED
 SESSION_VALUE	NULL
 GLOBAL_VALUE	OFF
@@ -1050,7 +1134,7 @@ VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	BIGINT UNSIGNED
 VARIABLE_COMMENT	Kills the server during crash recovery.
 NUMERIC_MIN_VALUE	0
-NUMERIC_MAX_VALUE	10
+NUMERIC_MAX_VALUE	100
 NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	YES
@@ -1068,7 +1152,7 @@ NUMERIC_MAX_VALUE	NULL
 NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
-COMMAND_LINE_ARGUMENT	NONE
+COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_FT_CACHE_SIZE
 SESSION_VALUE	NULL
 GLOBAL_VALUE	8000000
@@ -1295,9 +1379,9 @@ READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_LARGE_PREFIX
 SESSION_VALUE	NULL
-GLOBAL_VALUE	OFF
+GLOBAL_VALUE	ON
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	OFF
+DEFAULT_VALUE	ON
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	BOOLEAN
 VARIABLE_COMMENT	Support large index prefix length of REC_VERSION_56_MAX_INDEX_COL_LEN (3072) bytes.
@@ -1377,6 +1461,20 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	OPTIONAL
+VARIABLE_NAME	INNODB_LOG_CHECKSUMS
+SESSION_VALUE	NULL
+GLOBAL_VALUE	ON
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	ON
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BOOLEAN
+VARIABLE_COMMENT	Whether to compute and require checksums for InnoDB redo log blocks
+NUMERIC_MIN_VALUE	NULL
+NUMERIC_MAX_VALUE	NULL
+NUMERIC_BLOCK_SIZE	NULL
+ENUM_VALUE_LIST	NULL
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_LOG_COMPRESSED_PAGES
 SESSION_VALUE	NULL
 GLOBAL_VALUE	OFF
@@ -1433,6 +1531,20 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
 READ_ONLY	YES
 COMMAND_LINE_ARGUMENT	REQUIRED
+VARIABLE_NAME	INNODB_LOG_WRITE_AHEAD_SIZE
+SESSION_VALUE	NULL
+GLOBAL_VALUE	8192
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	8192
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BIGINT UNSIGNED
+VARIABLE_COMMENT	Redo log write ahead unit size to avoid read-on-write, it should match the OS cache block IO size
+NUMERIC_MIN_VALUE	512
+NUMERIC_MAX_VALUE	16384
+NUMERIC_BLOCK_SIZE	512
+ENUM_VALUE_LIST	NULL
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_LRU_SCAN_DEPTH
 SESSION_VALUE	NULL
 GLOBAL_VALUE	100
@@ -1455,7 +1567,7 @@ DEFAULT_VALUE	75.000000
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	DOUBLE
 VARIABLE_COMMENT	Percentage of dirty pages allowed in bufferpool.
-NUMERIC_MIN_VALUE	0.001
+NUMERIC_MIN_VALUE	0
 NUMERIC_MAX_VALUE	99.999
 NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
@@ -1463,9 +1575,9 @@ READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_MAX_DIRTY_PAGES_PCT_LWM
 SESSION_VALUE	NULL
-GLOBAL_VALUE	0.001000
+GLOBAL_VALUE	0.000000
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	0.001000
+DEFAULT_VALUE	0.000000
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	DOUBLE
 VARIABLE_COMMENT	Percentage of dirty pages at which flushing kicks in.
@@ -1503,19 +1615,33 @@ NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
-VARIABLE_NAME	INNODB_MIRRORED_LOG_GROUPS
+VARIABLE_NAME	INNODB_MAX_UNDO_LOG_SIZE
 SESSION_VALUE	NULL
-GLOBAL_VALUE	1
+GLOBAL_VALUE	1073741824
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	0
+DEFAULT_VALUE	1073741824
 VARIABLE_SCOPE	GLOBAL
-VARIABLE_TYPE	BIGINT
-VARIABLE_COMMENT	Number of identical copies of log groups we keep for the database. Currently this should be set to 1.
-NUMERIC_MIN_VALUE	0
-NUMERIC_MAX_VALUE	10
+VARIABLE_TYPE	BIGINT UNSIGNED
+VARIABLE_COMMENT	Maximum size of UNDO tablespace in MB (If UNDO tablespace grows beyond this size it will be truncated in due course). 
+NUMERIC_MIN_VALUE	10485760
+NUMERIC_MAX_VALUE	18446744073709551615
 NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
-READ_ONLY	YES
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	OPTIONAL
+VARIABLE_NAME	INNODB_MERGE_THRESHOLD_SET_ALL_DEBUG
+SESSION_VALUE	NULL
+GLOBAL_VALUE	50
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	50
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	INT UNSIGNED
+VARIABLE_COMMENT	Override current MERGE_THRESHOLD setting for all indexes at dictionary cache by the specified value dynamically, at the time.
+NUMERIC_MIN_VALUE	1
+NUMERIC_MAX_VALUE	50
+NUMERIC_BLOCK_SIZE	0
+ENUM_VALUE_LIST	NULL
+READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_MONITOR_DISABLE
 SESSION_VALUE	NULL
@@ -1657,6 +1783,20 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	NONE
+VARIABLE_NAME	INNODB_PAGE_CLEANERS
+SESSION_VALUE	NULL
+GLOBAL_VALUE	1
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	4
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BIGINT UNSIGNED
+VARIABLE_COMMENT	Page cleaner threads can be from 1 to 64. Default is 4.
+NUMERIC_MIN_VALUE	1
+NUMERIC_MAX_VALUE	64
+NUMERIC_BLOCK_SIZE	0
+ENUM_VALUE_LIST	NULL
+READ_ONLY	YES
+COMMAND_LINE_ARGUMENT	OPTIONAL
 VARIABLE_NAME	INNODB_PAGE_HASH_LOCKS
 SESSION_VALUE	NULL
 GLOBAL_VALUE	16
@@ -1727,6 +1867,20 @@ NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	OPTIONAL
+VARIABLE_NAME	INNODB_PURGE_RSEG_TRUNCATE_FREQUENCY
+SESSION_VALUE	NULL
+GLOBAL_VALUE	128
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	128
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BIGINT UNSIGNED
+VARIABLE_COMMENT	Dictates rate at which UNDO records are purged. Value N means purge rollback segment(s) on every Nth iteration of purge invocation
+NUMERIC_MIN_VALUE	1
+NUMERIC_MAX_VALUE	128
+NUMERIC_BLOCK_SIZE	0
+ENUM_VALUE_LIST	NULL
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	OPTIONAL
 VARIABLE_NAME	INNODB_PURGE_RUN_NOW
 SESSION_VALUE	NULL
 GLOBAL_VALUE	OFF
@@ -1757,12 +1911,12 @@ READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	OPTIONAL
 VARIABLE_NAME	INNODB_PURGE_THREADS
 SESSION_VALUE	NULL
-GLOBAL_VALUE	1
+GLOBAL_VALUE	4
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	1
+DEFAULT_VALUE	4
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	BIGINT UNSIGNED
-VARIABLE_COMMENT	Purge threads can be from 1 to 32. Default is 1.
+VARIABLE_COMMENT	Purge threads can be from 1 to 32. Default is 4.
 NUMERIC_MIN_VALUE	1
 NUMERIC_MAX_VALUE	32
 NUMERIC_BLOCK_SIZE	0
@@ -2147,6 +2301,20 @@ NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	YES
 COMMAND_LINE_ARGUMENT	OPTIONAL
+VARIABLE_NAME	INNODB_SYNC_DEBUG
+SESSION_VALUE	NULL
+GLOBAL_VALUE	OFF
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	OFF
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BOOLEAN
+VARIABLE_COMMENT	Enable the sync debug checks
+NUMERIC_MIN_VALUE	NULL
+NUMERIC_MAX_VALUE	NULL
+NUMERIC_BLOCK_SIZE	NULL
+ENUM_VALUE_LIST	NULL
+READ_ONLY	YES
+COMMAND_LINE_ARGUMENT	OPTIONAL
 VARIABLE_NAME	INNODB_SYNC_SPIN_LOOPS
 SESSION_VALUE	NULL
 GLOBAL_VALUE	30
@@ -2175,6 +2343,20 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	OPTIONAL
+VARIABLE_NAME	INNODB_TEMP_DATA_FILE_PATH
+SESSION_VALUE	NULL
+GLOBAL_VALUE	ibtmp1:12M:autoextend
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	VARCHAR
+VARIABLE_COMMENT	Path to files and their sizes making temp-tablespace.
+NUMERIC_MIN_VALUE	NULL
+NUMERIC_MAX_VALUE	NULL
+NUMERIC_BLOCK_SIZE	NULL
+ENUM_VALUE_LIST	NULL
+READ_ONLY	YES
+COMMAND_LINE_ARGUMENT	REQUIRED
 VARIABLE_NAME	INNODB_THREAD_CONCURRENCY
 SESSION_VALUE	NULL
 GLOBAL_VALUE	0
@@ -2247,9 +2429,9 @@ READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	NULL
 VARIABLE_NAME	INNODB_UNDO_DIRECTORY
 SESSION_VALUE	NULL
-GLOBAL_VALUE	.
+GLOBAL_VALUE	PATH
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	.
+DEFAULT_VALUE	
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	VARCHAR
 VARIABLE_COMMENT	Directory where undo tablespace files live, this path can be absolute.
@@ -2273,6 +2455,20 @@ NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	OPTIONAL
+VARIABLE_NAME	INNODB_UNDO_LOG_TRUNCATE
+SESSION_VALUE	NULL
+GLOBAL_VALUE	OFF
+GLOBAL_VALUE_ORIGIN	COMPILE-TIME
+DEFAULT_VALUE	OFF
+VARIABLE_SCOPE	GLOBAL
+VARIABLE_TYPE	BOOLEAN
+VARIABLE_COMMENT	Enable or Disable Truncate of UNDO tablespace.
+NUMERIC_MIN_VALUE	NULL
+NUMERIC_MAX_VALUE	NULL
+NUMERIC_BLOCK_SIZE	NULL
+ENUM_VALUE_LIST	NULL
+READ_ONLY	NO
+COMMAND_LINE_ARGUMENT	OPTIONAL
 VARIABLE_NAME	INNODB_UNDO_TABLESPACES
 SESSION_VALUE	NULL
 GLOBAL_VALUE	0
@@ -2282,7 +2478,7 @@ VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	BIGINT UNSIGNED
 VARIABLE_COMMENT	Number of undo tablespaces to use. 
 NUMERIC_MIN_VALUE	0
-NUMERIC_MAX_VALUE	126
+NUMERIC_MAX_VALUE	95
 NUMERIC_BLOCK_SIZE	0
 ENUM_VALUE_LIST	NULL
 READ_ONLY	YES
@@ -2329,20 +2525,6 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	NULL
 READ_ONLY	YES
 COMMAND_LINE_ARGUMENT	NONE
-VARIABLE_NAME	INNODB_USE_SYS_MALLOC
-SESSION_VALUE	NULL
-GLOBAL_VALUE	ON
-GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	ON
-VARIABLE_SCOPE	GLOBAL
-VARIABLE_TYPE	BOOLEAN
-VARIABLE_COMMENT	DEPRECATED. This option may be removed in future releases, together with the InnoDB's internal memory allocator. Use OS memory allocator instead of InnoDB's internal memory allocator
-NUMERIC_MIN_VALUE	NULL
-NUMERIC_MAX_VALUE	NULL
-NUMERIC_BLOCK_SIZE	NULL
-ENUM_VALUE_LIST	NULL
-READ_ONLY	YES
-COMMAND_LINE_ARGUMENT	NONE
 VARIABLE_NAME	INNODB_USE_TRIM
 SESSION_VALUE	NULL
 GLOBAL_VALUE	OFF
@@ -2359,7 +2541,7 @@ READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	OPTIONAL
 VARIABLE_NAME	INNODB_VERSION
 SESSION_VALUE	NULL
-GLOBAL_VALUE	5.6.31
+GLOBAL_VALUE	5.7.9
 GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 DEFAULT_VALUE	NULL
 VARIABLE_SCOPE	GLOBAL
diff --git a/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_parts_basic.test b/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_parts_basic.test
new file mode 100644
index 0000000..3f4a928
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_parts_basic.test
@@ -0,0 +1,75 @@
+--source include/have_innodb.inc
+
+####################################################################
+#   Displaying default value                                       #
+####################################################################
+SELECT COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts);
+--echo 1 Expected
+
+
+####################################################################
+#   Check if Value can set                                         #
+####################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_adaptive_hash_index_parts=1;
+--echo Expected error 'Read only variable'
+
+SELECT COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts);
+--echo 1 Expected
+
+
+
+
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable  #
+#################################################################
+
+--disable_warnings
+SELECT @@GLOBAL.innodb_adaptive_hash_index_parts = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_adaptive_hash_index_parts';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_adaptive_hash_index_parts';
+--echo 1 Expected
+--enable_warnings
+
+
+
+################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable  #
+################################################################################
+SELECT @@innodb_adaptive_hash_index_parts = @@GLOBAL.innodb_adaptive_hash_index_parts;
+--echo 1 Expected
+
+
+
+################################################################################
+#   Check if innodb_adaptive_hash_index_parts can be accessed with and without @@ sign  #
+################################################################################
+
+SELECT COUNT(@@innodb_adaptive_hash_index_parts);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_adaptive_hash_index_parts);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_adaptive_hash_index_parts);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_adaptive_hash_index_parts);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_adaptive_hash_index_parts = @@SESSION.innodb_adaptive_hash_index_parts;
+--echo Expected error 'Readonly variable'
+
+
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
index a2508b0..49349d8 100644
--- 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
@@ -32,22 +32,40 @@ SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
 # Check if value can be set
 SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100;
 
+# Check for valid values
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=0;
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100000;
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000000;
+SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
+
 # 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=4294967295;
+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
 
+SET @@GLOBAL.innodb_adaptive_max_sleep_delay=-1024;
+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
+--disable_warnings
 SELECT VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_adaptive_max_sleep_delay';
+--enable_warnings
 --echo 100 Expected
 
 # Check if accessing variable with and without GLOBAL point to same
diff --git a/mysql-test/suite/sys_vars/t/innodb_additional_mem_pool_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_additional_mem_pool_size_basic.test
deleted file mode 100644
index ffb1046..0000000
--- a/mysql-test/suite/sys_vars/t/innodb_additional_mem_pool_size_basic.test
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-################## mysql-test\t\innodb_additional_mem_pool_size_basic.test ####
-#                                                                             #
-# Variable Name: innodb_additional_mem_pool_size                              #
-# Scope: Global                                                               #
-# Access Type: Static                                                         #
-# Data Type: numeric                                                          #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author : Sharique Abdullah                                                  #
-#                                                                             #
-#                                                                             #
-# Description:Test Cases of Dynamic System Variable innodb_additional_mem_pool_size#
-#             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                                               #
-#                                                                             #
-###############################################################################
-
---source include/have_innodb.inc
-
---echo '#---------------------BS_STVARS_020_01----------------------#'
-####################################################################
-#   Displaying default value                                       #
-####################################################################
-SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size);
---echo 1 Expected
-
-
---echo '#---------------------BS_STVARS_020_02----------------------#'
-####################################################################
-#   Check if Value can set                                         #
-####################################################################
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.innodb_additional_mem_pool_size=1;
---echo Expected error 'Read only variable'
-
-SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size);
---echo 1 Expected
-
-
-
-
---echo '#---------------------BS_STVARS_020_03----------------------#'
-#################################################################
-# Check if the value in GLOBAL Table matches value in variable  #
-#################################################################
-
-SELECT @@GLOBAL.innodb_additional_mem_pool_size = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_additional_mem_pool_size';
---echo 1 Expected
-
-SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size);
---echo 1 Expected
-
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='innodb_additional_mem_pool_size';
---echo 1 Expected
-
-
-
---echo '#---------------------BS_STVARS_020_04----------------------#'
-################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable  #
-################################################################################
-SELECT @@innodb_additional_mem_pool_size = @@GLOBAL.innodb_additional_mem_pool_size;
---echo 1 Expected
-
-
-
---echo '#---------------------BS_STVARS_020_05----------------------#'
-################################################################################
-#   Check if innodb_additional_mem_pool_size can be accessed with and without @@ sign #
-################################################################################
-
-SELECT COUNT(@@innodb_additional_mem_pool_size);
---echo 1 Expected
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.innodb_additional_mem_pool_size);
---echo Expected error 'Variable is a GLOBAL variable'
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.innodb_additional_mem_pool_size);
---echo Expected error 'Variable is a GLOBAL variable'
-
-SELECT COUNT(@@GLOBAL.innodb_additional_mem_pool_size);
---echo 1 Expected
-
---Error ER_BAD_FIELD_ERROR
-SELECT innodb_additional_mem_pool_size = @@SESSION.innodb_additional_mem_pool_size;
---echo Expected error 'Readonly variable'
-
-
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
index b3a7aeb..7c9ae63 100644
--- 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
@@ -19,22 +19,47 @@ SELECT @@global.innodb_api_bk_commit_interval;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's writable
 #
 SET global innodb_api_bk_commit_interval=100;
 SELECT @@global.innodb_api_bk_commit_interval;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 SET session innodb_api_bk_commit_interval=1;
+#
+# Valid values
+#
+SET global innodb_api_bk_commit_interval=1;
+SELECT @@global.innodb_api_bk_commit_interval;
+SET global innodb_api_bk_commit_interval=100000;
+SELECT @@global.innodb_api_bk_commit_interval;
+SET global innodb_api_bk_commit_interval=1073741824;
+SELECT @@global.innodb_api_bk_commit_interval;
+
+#
+# Invalid values
+#
+SET global innodb_api_bk_commit_interval=0;
+SELECT @@global.innodb_api_bk_commit_interval;
+SET global innodb_api_bk_commit_interval=-1024;
+SELECT @@global.innodb_api_bk_commit_interval;
+SET global innodb_api_bk_commit_interval=1073741825;
+SELECT @@global.innodb_api_bk_commit_interval;
+SET global innodb_api_bk_commit_interval=4294967295;
+SELECT @@global.innodb_api_bk_commit_interval;
 
 #
 # incorrect types
@@ -47,8 +72,10 @@ SET global innodb_api_bk_commit_interval=1e1;
 SET global innodb_api_bk_commit_interval="foo";
 SET global innodb_api_bk_commit_interval=-7;
 SELECT @@global.innodb_api_bk_commit_interval;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_api_bk_commit_interval';
+--enable_warnings
 
 #
 # cleanup
diff --git a/mysql-test/suite/sys_vars/t/innodb_api_disable_rowlock_basic.test b/mysql-test/suite/sys_vars/t/innodb_api_disable_rowlock_basic.test
index c9c04a2..42e9903 100644
--- a/mysql-test/suite/sys_vars/t/innodb_api_disable_rowlock_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_api_disable_rowlock_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_api_disable_rowlock);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_api_disable_rowlock, 'ON', 'OFF') = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_api_disable_rowlock';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_api_disable_rowlock);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_api_disable_rowlock';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_api_enable_binlog_basic.test b/mysql-test/suite/sys_vars/t/innodb_api_enable_binlog_basic.test
index 637541e..e88d8ec 100644
--- a/mysql-test/suite/sys_vars/t/innodb_api_enable_binlog_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_api_enable_binlog_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_api_enable_binlog);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_api_enable_binlog, 'ON', 'OFF') = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_api_enable_binlog';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_api_enable_binlog);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_api_enable_binlog';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_api_enable_mdl_basic.test b/mysql-test/suite/sys_vars/t/innodb_api_enable_mdl_basic.test
index 0e440a7..d308687 100644
--- a/mysql-test/suite/sys_vars/t/innodb_api_enable_mdl_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_api_enable_mdl_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_api_enable_mdl);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_api_enable_mdl, 'ON', 'OFF') = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_api_enable_mdl';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_api_enable_mdl);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_api_enable_mdl';
+--enable_warnings
 --echo 1 Expected
 
 
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
index 49c34b6..c77f847 100644
--- 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
@@ -19,20 +19,24 @@ SELECT @@global.innodb_api_trx_level;
 SELECT @@session.innodb_api_trx_level;
 SHOW global variables LIKE 'innodb_api_trx_level';
 SHOW session variables LIKE 'innodb_api_trx_level';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's writable
 #
 SET global innodb_api_trx_level=100;
 SELECT @@global.innodb_api_trx_level;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 SET session innodb_api_trx_level=1;
 
@@ -47,8 +51,10 @@ SET global innodb_api_trx_level=1e1;
 SET global innodb_api_trx_level="foo";
 SET global innodb_api_trx_level=-7;
 SELECT @@global.innodb_api_trx_level;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_api_trx_level';
+--enable_warnings
 
 #
 # cleanup
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 cbe62a1..864dd73 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
@@ -94,18 +94,25 @@ SET @@global.innodb_autoextend_increment  = 1001;
 SELECT @@global.innodb_autoextend_increment;
 
 
+SET @@global.innodb_autoextend_increment  = 2000 ;
+SELECT @@global.innodb_autoextend_increment;
+
 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
 #########################################################################
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_autoextend_increment  = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_autoextend_increment ';
+--enable_warnings
 SELECT @@global.innodb_autoextend_increment ;
+--disable_warnings
 SELECT VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_autoextend_increment ';
+--enable_warnings
 
 
 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
index e07234a..81e63dd 100644
--- a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_basic.test
@@ -75,13 +75,17 @@ SELECT @@global.innodb_autoinc_lock_mode;
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_autoinc_lock_mode = VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_autoinc_lock_mode';
+--enable_warnings
 SELECT @@global.innodb_autoinc_lock_mode;
+--disable_warnings
 SELECT VARIABLE_VALUE 
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_autoinc_lock_mode';
+--enable_warnings
 
 
 ###############################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt
index f0b6727..ab9fcb7 100644
--- a/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/innodb_autoinc_lock_mode_func-master.opt
@@ -1,2 +1,2 @@
---loose-innodb-autoinc-lock-mode=1
+--innodb-autoinc-lock-mode=1
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_chunk_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_chunk_size_basic.test
new file mode 100644
index 0000000..561786e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_chunk_size_basic.test
@@ -0,0 +1,75 @@
+--source include/have_innodb.inc
+
+####################################################################
+#   Displaying default value                                       #
+####################################################################
+SELECT COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size);
+--echo 1 Expected
+
+
+####################################################################
+#   Check if Value can set                                         #
+####################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_buffer_pool_chunk_size=1;
+--echo Expected error 'Read only variable'
+
+SELECT COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size);
+--echo 1 Expected
+
+
+
+
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable  #
+#################################################################
+
+--disable_warnings
+SELECT @@GLOBAL.innodb_buffer_pool_chunk_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_buffer_pool_chunk_size';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_buffer_pool_chunk_size';
+--echo 1 Expected
+--enable_warnings
+
+
+
+################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable  #
+################################################################################
+SELECT @@innodb_buffer_pool_chunk_size = @@GLOBAL.innodb_buffer_pool_chunk_size;
+--echo 1 Expected
+
+
+
+################################################################################
+#   Check if innodb_buffer_pool_chunk_size can be accessed with and without @@ sign  #
+################################################################################
+
+SELECT COUNT(@@innodb_buffer_pool_chunk_size);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_buffer_pool_chunk_size);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_buffer_pool_chunk_size);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_buffer_pool_chunk_size);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_buffer_pool_chunk_size = @@SESSION.innodb_buffer_pool_chunk_size;
+--echo Expected error 'Readonly variable'
+
+
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
index b69e856be..feb7bf0 100644
--- 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
@@ -40,3 +40,5 @@ SET GLOBAL innodb_buffer_pool_dump_at_shutdown = 5;
 -- source include/restart_mysqld.inc
 
 -- file_exists $file
+
+SET GLOBAL innodb_buffer_pool_dump_at_shutdown = default;
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
index d2f5cb4..ae45be7 100644
--- 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
@@ -1,34 +1,57 @@
-#
-# Basic test for innodb_buffer_pool_dump_pct
-#
+############################################
+# Variable Name: innodb_buffer_pool_dump_pct
+# Scope: GLOBAL
+# Access Type: Dynamic
+# Data Type: Integer
+# Default Value: 100
+# Range: 1-100
+############################################
 
 -- source include/have_innodb.inc
 
 # Check the default value
-SET @orig = @@global.innodb_buffer_pool_dump_pct;
-SELECT @orig;
+SELECT @@global.innodb_buffer_pool_dump_pct;
+
+# Set the valid value
+SET GLOBAL innodb_buffer_pool_dump_pct=20;
+
+# Check the value is 20
+SELECT @@global.innodb_buffer_pool_dump_pct;
 
-# Do the dump
-SET GLOBAL innodb_buffer_pool_dump_pct=3, GLOBAL innodb_buffer_pool_dump_now = ON;
+# Set the lower Boundary value
+SET GLOBAL innodb_buffer_pool_dump_pct=1;
 
-# 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
+# Check the value is 1
+SELECT @@global.innodb_buffer_pool_dump_pct;
 
-# Confirm that the dump file has been created
--- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
--- file_exists $file
+# Set the upper boundary value
+SET GLOBAL innodb_buffer_pool_dump_pct=100;
 
---disable_warnings
-SET GLOBAL innodb_buffer_pool_dump_pct=0;
+# Check the value is 100
 SELECT @@global.innodb_buffer_pool_dump_pct;
-SHOW WARNINGS;
+
+# Set the beyond upper boundary value
 SET GLOBAL innodb_buffer_pool_dump_pct=101;
+
+# Check the value is 100
 SELECT @@global.innodb_buffer_pool_dump_pct;
-SHOW WARNINGS;
---enable_warnings
 
-SET GLOBAL innodb_buffer_pool_dump_pct=@orig;
+# Set the beyond lower boundary value
+SET GLOBAL innodb_buffer_pool_dump_pct=-1;
+
+# Check the value is 1
+SELECT @@global.innodb_buffer_pool_dump_pct;
+
+# Set the Default value
+SET GLOBAL innodb_buffer_pool_dump_pct=Default;
+
+# Check the default value
+SELECT @@global.innodb_buffer_pool_dump_pct;
+
+# Set with some invalid value
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_buffer_pool_dump_pct='foo';
+
+# Set without using Global
+--error ER_GLOBAL_VARIABLE
+SET innodb_buffer_pool_dump_pct=50;
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
deleted file mode 100644
index c50d2d6..0000000
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_filename_basic.test
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# 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_instances_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_instances_basic.test
index 0960f1f..8785272 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_instances_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_instances_basic.test
@@ -53,17 +53,21 @@ SELECT COUNT(@@GLOBAL.innodb_buffer_pool_instances);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_buffer_pool_instances = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_buffer_pool_instances';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_buffer_pool_instances);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_buffer_pool_instances';
+--enable_warnings
 --echo 1 Expected
 
 
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
index a040990..701d6a8 100644
--- 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
@@ -20,13 +20,11 @@ let $old_status= `SELECT variable_value FROM information_schema.global_status
 # 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;
 
@@ -36,7 +34,9 @@ let $wait_condition =
      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';
+--disable_warnings
 -- source include/wait_condition.inc
+--enable_warnings
 
 # Confirm the file is really created
 -- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
@@ -50,10 +50,15 @@ 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';
+--disable_warnings
 -- source include/wait_condition.inc
+--enable_warnings
 
 # Show the status, interesting if the above timed out
+--disable_warnings
 -- 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';
+--enable_warnings
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic-master.opt b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic-master.opt
new file mode 100644
index 0000000..aa536bf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic-master.opt
@@ -0,0 +1 @@
+--innodb-buffer-pool-chunk-size=2M
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
index 190b2d1..c5b4c11 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_size_basic.test
@@ -24,6 +24,21 @@
 
 --source include/have_innodb.inc
 
+--disable_query_log
+if (`select (version() like '%debug%') > 0`)
+{
+    set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
+    set global innodb_disable_resize_buffer_pool_debug = OFF;
+}
+--enable_query_log
+
+let $wait_condition =
+  SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
+  FROM information_schema.global_status
+  WHERE LOWER(variable_name) = 'innodb_buffer_pool_resize_status';
+
+SET @start_buffer_pool_size = @@GLOBAL.innodb_buffer_pool_size;
+
 --echo '#---------------------BS_STVARS_022_01----------------------#'
 ####################################################################
 #   Displaying default value                                       #
@@ -37,9 +52,9 @@ SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size);
 #   Check if Value can set                                         #
 ####################################################################
 
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.innodb_buffer_pool_size=1;
---echo Expected error 'Read only variable'
+SET @@GLOBAL.innodb_buffer_pool_size=10485760;
+--echo Expected succeeded
+--source include/wait_condition.inc
 
 SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size);
 --echo 1 Expected
@@ -52,17 +67,21 @@ SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_buffer_pool_size = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_buffer_pool_size';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_buffer_pool_size);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_buffer_pool_size';
+--enable_warnings
 --echo 1 Expected
 
 
@@ -100,3 +119,12 @@ SELECT innodb_buffer_pool_size = @@SESSION.innodb_buffer_pool_size;
 --echo Expected error 'Readonly variable'
 
 
+SET @@GLOBAL.innodb_buffer_pool_size = @start_buffer_pool_size;
+--source include/wait_condition.inc
+
+--disable_query_log
+if (`select (version() like '%debug%') > 0`)
+{
+    set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
+}
+--enable_query_log
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
index 5e081b1..2094ef3 100644
--- 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
@@ -18,16 +18,20 @@ select @@global.innodb_change_buffer_max_size;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_change_buffer_max_size=10;
 select @@global.innodb_change_buffer_max_size;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_change_buffer_max_size=1;
 
@@ -43,10 +47,14 @@ set global innodb_change_buffer_max_size="foo";
 
 set global innodb_change_buffer_max_size=-7;
 select @@global.innodb_change_buffer_max_size;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
+--enable_warnings
 set global innodb_change_buffer_max_size=56;
 select @@global.innodb_change_buffer_max_size;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
+--enable_warnings
 
 #
 # min/max/DEFAULT values
diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test
index abdfddb..aba3b1e 100644
--- a/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test
@@ -18,20 +18,26 @@ select @@global.innodb_change_buffering;
 select @@session.innodb_change_buffering;
 show global variables like 'innodb_change_buffering';
 show session variables like 'innodb_change_buffering';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_change_buffering';
 select * from information_schema.session_variables where variable_name='innodb_change_buffering';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_change_buffering='none';
 select @@global.innodb_change_buffering;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_change_buffering';
 select * from information_schema.session_variables where variable_name='innodb_change_buffering';
+--enable_warnings
 set @@global.innodb_change_buffering='inserts';
 select @@global.innodb_change_buffering;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_change_buffering';
 select * from information_schema.session_variables where variable_name='innodb_change_buffering';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_change_buffering='some';
 --error ER_GLOBAL_VARIABLE
diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test
index 893d1cb..a6fc09f 100644
--- a/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test
@@ -13,20 +13,26 @@ select @@global.innodb_change_buffering_debug;
 select @@session.innodb_change_buffering_debug;
 show global variables like 'innodb_change_buffering_debug';
 show session variables like 'innodb_change_buffering_debug';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug';
 select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_change_buffering_debug=1;
 select @@global.innodb_change_buffering_debug;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug';
 select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug';
+--enable_warnings
 set @@global.innodb_change_buffering_debug=0;
 select @@global.innodb_change_buffering_debug;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug';
 select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_change_buffering_debug='some';
 --error ER_GLOBAL_VARIABLE
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
index e7098b7..bb0f341 100644
--- a/mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_checksum_algorithm_basic.test
@@ -1,5 +1,4 @@
 --source include/have_innodb.inc
---source include/not_encrypted.inc
 
 # Check the default value
 SET @orig = @@global.innodb_checksum_algorithm;
diff --git a/mysql-test/suite/sys_vars/t/innodb_checksums_basic.test b/mysql-test/suite/sys_vars/t/innodb_checksums_basic.test
index c4c39d7..5db0a18 100644
--- a/mysql-test/suite/sys_vars/t/innodb_checksums_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_checksums_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_checksums);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_checksums, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_checksums';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_checksums);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_checksums';
+--enable_warnings
 --echo 1 Expected
 
 
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
index d729ace..432c048 100644
--- 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
@@ -26,8 +26,6 @@ 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
@@ -65,5 +63,4 @@ 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_commit_concurrency_basic.test b/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
index 42d1729..4ed706b 100644
--- a/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_commit_concurrency_basic.test
@@ -85,26 +85,38 @@ SELECT @@global.innodb_commit_concurrency;
 #
 --Error ER_WRONG_VALUE_FOR_VAR
 SET @@global.innodb_commit_concurrency = 1;
+SELECT @@global.innodb_commit_concurrency;
 --Error ER_WRONG_VALUE_FOR_VAR
 SET @@global.innodb_commit_concurrency = -1;
+SELECT @@global.innodb_commit_concurrency;
 --Error ER_WRONG_TYPE_FOR_VAR
 SET @@global.innodb_commit_concurrency = "T";
+SELECT @@global.innodb_commit_concurrency;
 --Error ER_WRONG_TYPE_FOR_VAR
 SET @@global.innodb_commit_concurrency = "Y";
+SELECT @@global.innodb_commit_concurrency;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_commit_concurrency = 1.1;
+SELECT @@global.innodb_commit_concurrency;
 --Error ER_WRONG_VALUE_FOR_VAR
 SET @@global.innodb_commit_concurrency = 1001;
+SELECT @@global.innodb_commit_concurrency;
+
+
 
 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
 ######################################################################### 
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_commit_concurrency =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_commit_concurrency';
 SELECT @@global.innodb_commit_concurrency;
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_commit_concurrency';
+--enable_warnings
 
 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
 ################################################################### 
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
index 1cdfaa6..315fe2d 100644
--- 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
@@ -87,6 +87,9 @@ 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 = 1.1;
+SELECT @@global.innodb_compression_failure_threshold_pct;
 
 --Error ER_WRONG_TYPE_FOR_VAR
 SET @@global.innodb_compression_failure_threshold_pct = "Y";
@@ -94,19 +97,28 @@ SELECT @@global.innodb_compression_failure_threshold_pct;
 
 SET @@global.innodb_compression_failure_threshold_pct = 101;
 SELECT @@global.innodb_compression_failure_threshold_pct;
-
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_failure_threshold_pct = " ";
+SELECT @@global.innodb_compression_failure_threshold_pct;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_failure_threshold_pct = ' ';
+SELECT @@global.innodb_compression_failure_threshold_pct;
 
 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
 #########################################################################
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_compression_failure_threshold_pct =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_compression_failure_threshold_pct';
+--enable_warnings
 SELECT @@global.innodb_compression_failure_threshold_pct;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_compression_failure_threshold_pct';
+--enable_warnings
 
 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
 ###################################################################
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
index a90abdd..d19d297 100644
--- a/mysql-test/suite/sys_vars/t/innodb_compression_level_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_compression_level_basic.test
@@ -18,16 +18,20 @@ select @@global.innodb_compression_level;
 select @@session.innodb_compression_level;
 show global variables like 'innodb_compression_level';
 show session variables like 'innodb_compression_level';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_compression_level';
 select * from information_schema.session_variables where variable_name='innodb_compression_level';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_compression_level=2;
 select @@global.innodb_compression_level;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_compression_level';
 select * from information_schema.session_variables where variable_name='innodb_compression_level';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_compression_level=4;
 
@@ -43,10 +47,14 @@ set global innodb_compression_level="foo";
 
 set global innodb_compression_level=10;
 select @@global.innodb_compression_level;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_compression_level';
+--enable_warnings
 set global innodb_compression_level=-7;
 select @@global.innodb_compression_level;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_compression_level';
+--enable_warnings
 
 #
 # min/max values
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
index 3ca5669..1491f70 100644
--- 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
@@ -84,22 +84,34 @@ 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;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_pad_pct_max = 1.1;
+SELECT @@global.innodb_compression_pad_pct_max;
 
 SET @@global.innodb_compression_pad_pct_max = 76;
 SELECT @@global.innodb_compression_pad_pct_max;
-
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_pad_pct_max = " ";
+SELECT @@global.innodb_compression_pad_pct_max;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_compression_pad_pct_max = ' ';
+SELECT @@global.innodb_compression_pad_pct_max;
 
 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
 #########################################################################
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_compression_pad_pct_max =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_compression_pad_pct_max';
+--enable_warnings
 SELECT @@global.innodb_compression_pad_pct_max;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_compression_pad_pct_max';
+--enable_warnings
 
 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
 ###################################################################
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 f73e251..d753b8b 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
@@ -59,7 +59,6 @@ SELECT @@innodb_concurrency_tickets;
 --Error ER_UNKNOWN_TABLE
 SELECT local.innodb_concurrency_tickets;
 
-
 SET global innodb_concurrency_tickets = 0;
 SELECT @@global.innodb_concurrency_tickets;
 
@@ -69,7 +68,6 @@ SELECT @@global.innodb_concurrency_tickets;
 #      change the value of innodb_concurrency_tickets to a valid value   #
 ########################################################################## 
 
-
 SET @@global.innodb_concurrency_tickets = 1;
 SELECT @@global.innodb_concurrency_tickets;
 
@@ -79,15 +77,38 @@ SELECT @@global.innodb_concurrency_tickets;
 SET @@global.innodb_concurrency_tickets = 4294967295;
 SELECT @@global.innodb_concurrency_tickets;
 
-
 --echo '#--------------------FN_DYNVARS_046_04-------------------------#'
 ########################################################################### 
+#  Check the value of innodb_concurrency_tickets for out of bounds        #
+###########################################################################
+
+# With a 64 bit mysqld:18446744073709551615,with a 32 bit mysqld: 4294967295
+--disable_warnings
+SET @@global.innodb_concurrency_tickets = 4294967296;
+--enable_warnings
+SELECT @@global.innodb_concurrency_tickets IN (4294967296,4294967295);
+
+--disable_warnings
+SET @@global.innodb_concurrency_tickets = 12345678901;
+--enable_warnings
+SELECT @@global.innodb_concurrency_tickets IN (12345678901,4294967295);
+
+--disable_warnings
+SET @@global.innodb_concurrency_tickets = 18446744073709551615;
+--enable_warnings
+SELECT @@global.innodb_concurrency_tickets IN (18446744073709551615,4294967295);
+
+--echo '#--------------------FN_DYNVARS_046_05-------------------------#'
+########################################################################### 
 #  Change the value of innodb_concurrency_tickets to invalid value        #
 ###########################################################################
 
 SET @@global.innodb_concurrency_tickets = -1;
 SELECT @@global.innodb_concurrency_tickets;
 
+SET @@global.innodb_concurrency_tickets = -1024;
+SELECT @@global.innodb_concurrency_tickets;
+
 --Error ER_WRONG_TYPE_FOR_VAR  
 SET @@global.innodb_concurrency_tickets = "T";
 SELECT @@global.innodb_concurrency_tickets;
@@ -96,22 +117,35 @@ SELECT @@global.innodb_concurrency_tickets;
 SET @@global.innodb_concurrency_tickets = "Y";
 SELECT @@global.innodb_concurrency_tickets;
 
-SET @@global.innodb_concurrency_tickets = 1001;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_concurrency_tickets = 1.1;
+SELECT @@global.innodb_concurrency_tickets;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_concurrency_tickets = " ";
+SELECT @@global.innodb_concurrency_tickets;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_concurrency_tickets = ' ';
 SELECT @@global.innodb_concurrency_tickets;
 
---echo '#----------------------FN_DYNVARS_046_05------------------------#'
+--echo '#----------------------FN_DYNVARS_046_06------------------------#'
 ######################################################################### 
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_concurrency_tickets =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_concurrency_tickets';
+--enable_warnings
 SELECT @@global.innodb_concurrency_tickets;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_concurrency_tickets';
+--enable_warnings
 
---echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+--echo '#---------------------FN_DYNVARS_046_07-------------------------#'
 ###################################################################
 #        Check if ON and OFF values can be used on variable       #
 ###################################################################
@@ -124,7 +158,7 @@ SELECT @@global.innodb_concurrency_tickets;
 SET @@global.innodb_concurrency_tickets = ON;
 SELECT @@global.innodb_concurrency_tickets;
 
---echo '#---------------------FN_DYNVARS_046_07----------------------#'
+--echo '#---------------------FN_DYNVARS_046_08----------------------#'
 ###################################################################
 #      Check if TRUE and FALSE values can be used on variable     #
 ###################################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_data_file_path_basic.test b/mysql-test/suite/sys_vars/t/innodb_data_file_path_basic.test
index 1d88c47..c936744 100644
--- a/mysql-test/suite/sys_vars/t/innodb_data_file_path_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_data_file_path_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_data_file_path);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_data_file_path = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_data_file_path';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_data_file_path);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_data_file_path';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_data_home_dir_basic.test b/mysql-test/suite/sys_vars/t/innodb_data_home_dir_basic.test
index acf3741..b6b7999 100644
--- a/mysql-test/suite/sys_vars/t/innodb_data_home_dir_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_data_home_dir_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_data_home_dir);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_data_home_dir = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_data_home_dir';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_data_home_dir);
 --echo 0 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_data_home_dir';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_default_row_format_basic.test b/mysql-test/suite/sys_vars/t/innodb_default_row_format_basic.test
new file mode 100644
index 0000000..f9aabf4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_default_row_format_basic.test
@@ -0,0 +1,41 @@
+--source include/have_innodb.inc
+
+# Check the default value
+SELECT  @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 'redundant';
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 'dynamic';
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 'compact';
+SELECT @@global.innodb_default_row_format;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_default_row_format = 'compressed';
+SELECT @@global.innodb_default_row_format;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_default_row_format = 'foobar';
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 0;
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 1;
+SELECT @@global.innodb_default_row_format;
+
+SET GLOBAL innodb_default_row_format = 2;
+SELECT @@global.innodb_default_row_format;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_default_row_format = 3;
+SELECT @@global.innodb_default_row_format;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_default_row_format = 123;
+SELECT @@global.innodb_default_row_format;
+
+
+SET GLOBAL innodb_default_row_format = default;
diff --git a/mysql-test/suite/sys_vars/t/innodb_disable_resize_buffer_pool_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_disable_resize_buffer_pool_debug_basic.test
new file mode 100644
index 0000000..e381e74
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_disable_resize_buffer_pool_debug_basic.test
@@ -0,0 +1,72 @@
+--echo #
+--echo # Basic test for innodb_disable_resize_buffer_pool_debug
+--echo #
+
+--source include/have_innodb.inc
+
+# The config variable is a debug variable
+-- source include/have_debug.inc
+
+SET @start_global_value = @@global.innodb_disable_resize_buffer_pool_debug;
+
+# Check if Value can set
+
+SET @@global.innodb_disable_resize_buffer_pool_debug = 0;
+SELECT @@global.innodb_disable_resize_buffer_pool_debug;
+
+SET @@global.innodb_disable_resize_buffer_pool_debug ='On' ;
+SELECT @@global.innodb_disable_resize_buffer_pool_debug;
+
+SET @@global.innodb_disable_resize_buffer_pool_debug ='Off' ;
+SELECT @@global.innodb_disable_resize_buffer_pool_debug;
+
+SET @@global.innodb_disable_resize_buffer_pool_debug = 1;
+SELECT @@global.innodb_disable_resize_buffer_pool_debug;
+
+# Check if the value in GLOBAL Table matches value in variable
+
+--disable_warnings
+SELECT IF(@@GLOBAL.innodb_disable_resize_buffer_pool_debug,'ON','OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_disable_resize_buffer_pool_debug';
+--enable_warnings
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug);
+--echo 1 Expected
+
+--disable_warnings
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_disable_resize_buffer_pool_debug';
+--enable_warnings
+--echo 1 Expected
+
+# Check if accessing variable with and without GLOBAL point to same variable
+
+SELECT @@innodb_disable_resize_buffer_pool_debug = @@GLOBAL.innodb_disable_resize_buffer_pool_debug;
+--echo 1 Expected
+
+# Check if innodb_disable_resize_buffer_pool_debug can be accessed with and without @@ sign
+
+SELECT COUNT(@@innodb_disable_resize_buffer_pool_debug);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_disable_resize_buffer_pool_debug);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_disable_resize_buffer_pool_debug);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_disable_resize_buffer_pool_debug = @@SESSION.innodb_disable_resize_buffer_pool_debug;
+
+# Cleanup
+
+SET @@global.innodb_disable_resize_buffer_pool_debug = @start_global_value;
+SELECT @@global.innodb_disable_resize_buffer_pool_debug;
diff --git a/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test b/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
index 72dd22c..1ae10d0 100644
--- a/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_doublewrite);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_doublewrite, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_doublewrite';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_doublewrite);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_doublewrite';
+--enable_warnings
 --echo 1 Expected
 
 
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
index ccdab53..5e9104b 100644
--- 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
@@ -10,8 +10,10 @@ select @@global.innodb_doublewrite_batch_size;
 select @@session.innodb_doublewrite_batch_size;
 show global variables like 'innodb_doublewrite_batch_size';
 show session variables like 'innodb_doublewrite_batch_size';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's read-only
diff --git a/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test b/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
index e1b6204..9fe9f49 100644
--- a/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_fast_shutdown_basic.test
@@ -116,7 +116,15 @@ SELECT @@global.innodb_fast_shutdown;
 --Error ER_WRONG_TYPE_FOR_VAR
 SET @@global.innodb_fast_shutdown = "0";
 SELECT @@global.innodb_fast_shutdown;
-
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_fast_shutdown = 1.1;
+SELECT @@global.innodb_fast_shutdown;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_fast_shutdown = ' ';
+SELECT @@global.innodb_fast_shutdown;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_fast_shutdown = " ";
+SELECT @@global.innodb_fast_shutdown;
 
 --echo '#-------------------FN_DYNVARS_042_05----------------------------#'
 ###########################################################################
@@ -137,9 +145,11 @@ SET @@local.innodb_fast_shutdown = 0;
 #     Check if the value in SESSION Table contains variable value       #
 #########################################################################
 
+--disable_warnings
 SELECT count(VARIABLE_VALUE) AS res_is_0
 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 WHERE VARIABLE_NAME='innodb_fast_shutdown';
+--enable_warnings
 
 
 --echo '#----------------------FN_DYNVARS_042_07------------------------#'
@@ -147,9 +157,11 @@ WHERE VARIABLE_NAME='innodb_fast_shutdown';
 #      Check if the value in GLOBAL Table matches value in variable     #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_fast_shutdown =
 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_fast_shutdown';
+--enable_warnings
 
 
 --echo '#---------------------FN_DYNVARS_042_08-------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_basic.test
index bfc092f..739260c 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_format_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_format_basic.test
@@ -18,20 +18,26 @@ select @@global.innodb_file_format;
 select @@session.innodb_file_format;
 show global variables like 'innodb_file_format';
 show session variables like 'innodb_file_format';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_file_format';
 select * from information_schema.session_variables where variable_name='innodb_file_format';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_file_format='Antelope';
 select @@global.innodb_file_format;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_file_format';
 select * from information_schema.session_variables where variable_name='innodb_file_format';
+--enable_warnings
 set @@global.innodb_file_format='Barracuda';
 select @@global.innodb_file_format;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_file_format';
 select * from information_schema.session_variables where variable_name='innodb_file_format';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_file_format='Salmon';
 --error ER_GLOBAL_VARIABLE
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
index f9f61b9..56afba4 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_format_check_basic.test
@@ -19,10 +19,12 @@ SELECT @@global.innodb_file_format_check;
 SELECT @@session.innodb_file_format_check;
 SHOW global variables LIKE 'innodb_file_format_check';
 SHOW session variables LIKE 'innodb_file_format_check';
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_file_format_check';
 SELECT * FROM information_schema.session_variables 
 WHERE variable_name='innodb_file_format_check';
+--enable_warnings
 
 #
 # show that it's read only
@@ -53,17 +55,21 @@ SET @@session.innodb_stats_on_metadata='ON';
 # Check if the value in GLOBAL Table matches value in variable 
 #
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_file_format_check, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_file_format_check';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_file_format_check);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_file_format_check';
+--enable_warnings
 --echo 1 Expected
 
 #
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
index 18076cf..494f381 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_format_max_basic.test
@@ -3,7 +3,6 @@
 #
 --source include/not_embedded.inc
 --source include/have_innodb.inc
---source suite/innodb/include/restart_and_reinit.inc
 
 SET @start_global_value = @@global.innodb_file_format_max;
 SELECT @start_global_value;
@@ -18,26 +17,32 @@ SELECT @@global.innodb_file_format_max;
 SELECT @@session.innodb_file_format_max;
 SHOW global variables LIKE 'innodb_file_format_max';
 SHOW session variables LIKE 'innodb_file_format_max';
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_file_format_max';
 SELECT * FROM information_schema.session_variables
 WHERE variable_name='innodb_file_format_max';
+--enable_warnings
 
 #
 # show that it's writable
 #
 SET global innodb_file_format_max='Antelope';
 SELECT @@global.innodb_file_format_max;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_file_format_max';
 SELECT * FROM information_schema.session_variables 
 WHERE variable_name='innodb_file_format_max';
+--enable_warnings
 SET @@global.innodb_file_format_max='Barracuda';
 SELECT @@global.innodb_file_format_max;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_file_format_max';
 SELECT * FROM information_schema.session_variables 
 WHERE variable_name='innodb_file_format_max';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 SET session innodb_file_format_max='Salmon';
 --error ER_GLOBAL_VARIABLE
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_io_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_io_threads_basic.test
index 32cdd0b..c701c2e 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_io_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_io_threads_basic.test
@@ -61,30 +61,38 @@ SELECT COUNT(@@GLOBAL.innodb_write_io_threads);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_read_io_threads = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_read_io_threads';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_read_io_threads);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_read_io_threads';
+--enable_warnings
 --echo 1 Expected
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_write_io_threads = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_write_io_threads';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_write_io_threads);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_write_io_threads';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic-master.opt b/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic-master.opt
new file mode 100644
index 0000000..9d2c4f8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic-master.opt
@@ -0,0 +1 @@
+--innodb_file_per_table=On
diff --git a/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test b/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
index 1478d6d..2fd9783 100644
--- a/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
@@ -58,17 +58,21 @@ SELECT @@global.innodb_file_per_table;
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_file_per_table,'ON','OFF') = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_file_per_table';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_file_per_table);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_file_per_table';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_fill_factor_basic.test b/mysql-test/suite/sys_vars/t/innodb_fill_factor_basic.test
new file mode 100644
index 0000000..8e4caae
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_fill_factor_basic.test
@@ -0,0 +1,41 @@
+
+#
+#  2014-03-26 - Added
+#
+
+--source include/have_innodb.inc
+
+#
+# show the global and session values;
+#
+select @@global.innodb_fill_factor;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_fill_factor;
+show global variables like 'innodb_fill_factor';
+show session variables like 'innodb_fill_factor';
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_fill_factor';
+select * from information_schema.session_variables where variable_name='innodb_fill_factor';
+--enable_warnings
+
+#
+# test default, min, max value
+#
+let $innodb_fill_factor_orig=`select @@innodb_fill_factor`;
+
+set global innodb_fill_factor=9;
+select @@innodb_fill_factor;
+
+set global innodb_fill_factor=10;
+select @@innodb_fill_factor;
+
+set global innodb_fill_factor=75;
+select @@innodb_fill_factor;
+
+set global innodb_fill_factor=100;
+select @@innodb_fill_factor;
+
+set global innodb_fill_factor=101;
+select @@innodb_fill_factor;
+
+eval set global innodb_fill_factor=$innodb_fill_factor_orig;
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
index 0ab079a..09a790f 100644
--- 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
@@ -101,18 +101,31 @@ SELECT @@global.innodb_flush_log_at_timeout;
 
 SET @@global.innodb_flush_log_at_timeout = 2701;
 SELECT @@global.innodb_flush_log_at_timeout;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flush_log_at_timeout = ' ';
+SELECT @@global.innodb_flush_log_at_timeout;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flush_log_at_timeout = " ";
+SELECT @@global.innodb_flush_log_at_timeout;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flush_log_at_timeout = 1.1;
+SELECT @@global.innodb_flush_log_at_timeout;
 
 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
 #########################################################################
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_flush_log_at_timeout =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_flush_log_at_timeout';
+--enable_warnings
 SELECT @@global.innodb_flush_log_at_timeout;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_flush_log_at_timeout';
+--enable_warnings
 
 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
 ###################################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_flush_log_at_trx_commit_basic.test b/mysql-test/suite/sys_vars/t/innodb_flush_log_at_trx_commit_basic.test
index 56cfc2f..34510cd 100644
--- a/mysql-test/suite/sys_vars/t/innodb_flush_log_at_trx_commit_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_log_at_trx_commit_basic.test
@@ -56,6 +56,11 @@ SELECT @@global.innodb_flush_log_at_trx_commit;
 # Check if variable can be accessed with and without @@ sign                  #
 ###############################################################################
 
+--Error ER_GLOBAL_VARIABLE
+SET innodb_flush_log_at_trx_commit = 1;
+SELECT @@innodb_flush_log_at_trx_commit;
+
+
 --Error ER_UNKNOWN_TABLE
 SELECT local.innodb_flush_log_at_trx_commit;
 
@@ -96,18 +101,35 @@ SELECT @@global.innodb_flush_log_at_trx_commit;
 
 SET @@global.innodb_flush_log_at_trx_commit = 1001;
 SELECT @@global.innodb_flush_log_at_trx_commit;
+ 
+SET @@global.innodb_flush_log_at_trx_commit = 100156787;
+SELECT @@global.innodb_flush_log_at_trx_commit;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flush_log_at_trx_commit = " ";
+SELECT @@global.innodb_flush_log_at_trx_commit;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flush_log_at_trx_commit = 1.1;
+SELECT @@global.innodb_flush_log_at_trx_commit;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flush_log_at_trx_commit = ' ';
+SELECT @@global.innodb_flush_log_at_trx_commit;
 
 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
 ######################################################################### 
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_flush_log_at_trx_commit =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_flush_log_at_trx_commit';
+--enable_warnings
 SELECT @@global.innodb_flush_log_at_trx_commit;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_flush_log_at_trx_commit';
+--enable_warnings
 
 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
 ################################################################### 
diff --git a/mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test b/mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test
index 75af00e..9f99c13 100644
--- a/mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_flush_method);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_flush_method = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_flush_method';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_flush_method);
 --echo 0 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_flush_method';
+--enable_warnings
 --echo 1 Expected
 
 
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
index 698e30b..671e6f5 100644
--- a/mysql-test/suite/sys_vars/t/innodb_flush_neighbors_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_neighbors_basic.test
@@ -16,32 +16,44 @@ select @@global.innodb_flush_neighbors;
 select @@session.innodb_flush_neighbors;
 show global variables like 'innodb_flush_neighbors';
 show session variables like 'innodb_flush_neighbors';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
 select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_flush_neighbors=0;
 select @@global.innodb_flush_neighbors;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
 select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+--enable_warnings
 set @@global.innodb_flush_neighbors=TRUE;
 select @@global.innodb_flush_neighbors;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
 select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+--enable_warnings
 set global innodb_flush_neighbors=0;
 select @@global.innodb_flush_neighbors;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
 select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+--enable_warnings
 set @@global.innodb_flush_neighbors=2;
 select @@global.innodb_flush_neighbors;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
 select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+--enable_warnings
 set @@global.innodb_flush_neighbors=DEFAULT;
 select @@global.innodb_flush_neighbors;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
 select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_flush_neighbors=0;
 --error ER_GLOBAL_VARIABLE
diff --git a/mysql-test/suite/sys_vars/t/innodb_flush_sync_basic.test b/mysql-test/suite/sys_vars/t/innodb_flush_sync_basic.test
new file mode 100644
index 0000000..a735758
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_flush_sync_basic.test
@@ -0,0 +1,77 @@
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_flush_sync;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+--echo Valid values are 'ON' and 'OFF'
+select @@global.innodb_flush_sync in (0, 1);
+select @@global.innodb_flush_sync;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_flush_sync;
+show global variables like 'innodb_flush_sync';
+show session variables like 'innodb_flush_sync';
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+--enable_warnings
+
+#
+# show that it's writable
+#
+set global innodb_flush_sync='OFF';
+select @@global.innodb_flush_sync;
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+--enable_warnings
+set @@global.innodb_flush_sync=1;
+select @@global.innodb_flush_sync;
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+--enable_warnings
+set global innodb_flush_sync=0;
+select @@global.innodb_flush_sync;
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+--enable_warnings
+set @@global.innodb_flush_sync='ON';
+select @@global.innodb_flush_sync;
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+--enable_warnings
+--error ER_GLOBAL_VARIABLE
+set session innodb_flush_sync='OFF';
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_flush_sync='ON';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_flush_sync=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_flush_sync=1e1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_flush_sync=2;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_flush_sync=-3;
+select @@global.innodb_flush_sync;
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_flush_sync';
+select * from information_schema.session_variables where variable_name='innodb_flush_sync';
+--enable_warnings
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_flush_sync='AUTO';
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_flush_sync = @start_global_value;
+SELECT @@global.innodb_flush_sync;
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
index a84e623..f23f969 100644
--- 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
@@ -94,18 +94,28 @@ SELECT @@global.innodb_flushing_avg_loops;
 
 SET @@global.innodb_flushing_avg_loops = 1001;
 SELECT @@global.innodb_flushing_avg_loops;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flushing_avg_loops = ' ';
+SELECT @@global.innodb_flushing_avg_loops;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_flushing_avg_loops = " ";
+SELECT @@global.innodb_flushing_avg_loops;
 
 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
 #########################################################################
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_flushing_avg_loops =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_flushing_avg_loops';
+--enable_warnings
 SELECT @@global.innodb_flushing_avg_loops;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_flushing_avg_loops';
+--enable_warnings
 
 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
 ###################################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test b/mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test
index 1726b32..f12f2f6 100644
--- a/mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_force_load_corrupted_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_force_load_corrupted, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_force_load_corrupted';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_force_load_corrupted';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_force_recovery_basic.test b/mysql-test/suite/sys_vars/t/innodb_force_recovery_basic.test
index f5aa769..a62c895 100644
--- a/mysql-test/suite/sys_vars/t/innodb_force_recovery_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_force_recovery_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_force_recovery);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_force_recovery = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_force_recovery';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_force_recovery);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_force_recovery';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_force_recovery_crash_basic.test b/mysql-test/suite/sys_vars/t/innodb_force_recovery_crash_basic.test
index 5eefe1b..cfbd10c 100644
--- a/mysql-test/suite/sys_vars/t/innodb_force_recovery_crash_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_force_recovery_crash_basic.test
@@ -10,8 +10,10 @@ select @@global.innodb_force_recovery_crash;
 select @@session.innodb_force_recovery_crash;
 show global variables like 'innodb_force_recovery_crash';
 show session variables like 'innodb_force_recovery_crash';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_force_recovery_crash';
 select * from information_schema.session_variables where variable_name='innodb_force_recovery_crash';
+--enable_warnings
 
 # show that it's read-only
 #
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
index 2ea99cf..04ca34c 100644
--- 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
@@ -15,8 +15,10 @@ SELECT @start_global_value;
 select @@session.innodb_ft_aux_table;
 show global variables like 'innodb_ft_aux_table';
 show session variables like 'innodb_ft_aux_table';
+--disable_warnings
 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';
+--enable_warnings
 
 --error ER_GLOBAL_VARIABLE
 set session innodb_ft_aux_table='Salmon';
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
index f6d6283..30bcd08 100644
--- 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
@@ -13,8 +13,10 @@ select @@global.innodb_ft_cache_size;
 select @@session.innodb_ft_cache_size;
 show global variables like 'innodb_ft_cache_size';
 show session variables like 'innodb_ft_cache_size';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's read-only
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
index ebe9cc5..630ada0 100644
--- 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
@@ -18,28 +18,38 @@ select @@global.innodb_ft_enable_diag_print;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_ft_enable_diag_print='OFF';
 select @@global.innodb_ft_enable_diag_print;
+--disable_warnings
 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';
+--enable_warnings
 set @@global.innodb_ft_enable_diag_print=1;
 select @@global.innodb_ft_enable_diag_print;
+--disable_warnings
 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';
+--enable_warnings
 set global innodb_ft_enable_diag_print=0;
 select @@global.innodb_ft_enable_diag_print;
+--disable_warnings
 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';
+--enable_warnings
 set @@global.innodb_ft_enable_diag_print='ON';
 select @@global.innodb_ft_enable_diag_print;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_ft_enable_diag_print='OFF';
 --error ER_GLOBAL_VARIABLE
@@ -57,8 +67,10 @@ 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;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_ft_enable_diag_print='AUTO';
 
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
index 1a983a3..5eb5af4 100644
--- 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
@@ -18,8 +18,10 @@ 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's writable
@@ -28,26 +30,34 @@ 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;
+--disable_warnings
 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';
+--enable_warnings
 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;
+--disable_warnings
 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';
+--enable_warnings
 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;
+--disable_warnings
 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';
+--enable_warnings
 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;
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # incorrect types
@@ -74,8 +84,10 @@ set global innodb_ft_enable_stopword=-3;
 set session innodb_ft_enable_stopword=-7;
 select @@global.innodb_ft_enable_stopword;
 select @@session.innodb_ft_enable_stopword;
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # Cleanup
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
index e755174..8f6f93f 100644
--- 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
@@ -13,8 +13,10 @@ select @@global.innodb_ft_max_token_size;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's read-only
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
index edf63c7..753985e 100644
--- 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
@@ -13,8 +13,10 @@ select @@global.innodb_ft_min_token_size;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's read-only
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
index 255caf8..f288398 100644
--- 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
@@ -18,16 +18,20 @@ select @@global.innodb_ft_num_word_optimize;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_ft_num_word_optimize=1000;
 select @@global.innodb_ft_num_word_optimize;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_ft_num_word_optimize=1000;
 
@@ -43,7 +47,9 @@ set global innodb_ft_num_word_optimize="foo";
 
 set global innodb_ft_num_word_optimize=-7;
 select @@global.innodb_ft_num_word_optimize;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_ft_num_word_optimize';
+--enable_warnings
 
 #
 # cleanup
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
index 245ed4a..0a797a5 100644
--- 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
@@ -5,11 +5,6 @@
 
 --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;
 #
@@ -18,8 +13,10 @@ select @@global.innodb_ft_result_cache_limit;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # test default, min, max value
@@ -32,7 +29,10 @@ 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;
+set global innodb_ft_result_cache_limit=4294967295;
+select @@innodb_ft_result_cache_limit;
+
+set global innodb_ft_result_cache_limit=4*1024*1024*1024;
 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
index e227e79..5de822a 100644
--- 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
@@ -15,8 +15,12 @@ SELECT @start_global_value;
 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';
+--disable_warnings
 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';
+--enable_warnings
+
+call mtr.add_suppression("\\[ERROR\\] InnoDB: user stopword table Salmon does not exist.");
 
 --error ER_GLOBAL_VARIABLE
 set session innodb_ft_server_stopword_table='Salmon';
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
index 3cf55f6..cacd6a6 100644
--- 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
@@ -13,8 +13,10 @@ select @@global.innodb_ft_sort_pll_degree;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's read-only
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
index 772ec5a..207ec64 100644
--- 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
@@ -1,9 +1,9 @@
---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
-}
+#
+#  2011-11-17 - Added 
+#
+
+--source include/have_innodb.inc
 
 #
 # show the global and session values;
@@ -13,8 +13,10 @@ select @@global.innodb_ft_total_cache_size;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's read-only
@@ -24,4 +26,3 @@ 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
index 159e570..475bf8d 100644
--- 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
@@ -16,8 +16,12 @@ 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';
 
+--disable_warnings
 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';
+--enable_warnings
+
+call mtr.add_suppression("\\[ERROR\\] InnoDB: user stopword table Salmon does not exist.");
 
 --error ER_WRONG_VALUE_FOR_VAR
 set session innodb_ft_user_stopword_table='Salmon';
@@ -35,4 +39,3 @@ 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_large_prefix_basic.test b/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
index 8d3f3af..877fe17 100644
--- a/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test
@@ -18,28 +18,38 @@ select @@global.innodb_large_prefix;
 select @@session.innodb_large_prefix;
 show global variables like 'innodb_large_prefix';
 show session variables like 'innodb_large_prefix';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_large_prefix';
 select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_large_prefix='OFF';
 select @@global.innodb_large_prefix;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_large_prefix';
 select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--enable_warnings
 set @@global.innodb_large_prefix=1;
 select @@global.innodb_large_prefix;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_large_prefix';
 select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--enable_warnings
 set global innodb_large_prefix=0;
 select @@global.innodb_large_prefix;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_large_prefix';
 select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--enable_warnings
 set @@global.innodb_large_prefix='ON';
 select @@global.innodb_large_prefix;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_large_prefix';
 select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_large_prefix='OFF';
 --error ER_GLOBAL_VARIABLE
@@ -57,8 +67,10 @@ set global innodb_large_prefix=2;
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_large_prefix=-3;
 select @@global.innodb_large_prefix;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_large_prefix';
 select * from information_schema.session_variables where variable_name='innodb_large_prefix';
+--enable_warnings
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_large_prefix='AUTO';
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_limit_optimistic_insert_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_limit_optimistic_insert_debug_basic.test
index 7998297..8f2271c 100644
--- a/mysql-test/suite/sys_vars/t/innodb_limit_optimistic_insert_debug_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_limit_optimistic_insert_debug_basic.test
@@ -12,20 +12,26 @@ select @@global.innodb_limit_optimistic_insert_debug;
 select @@session.innodb_limit_optimistic_insert_debug;
 show global variables like 'innodb_limit_optimistic_insert_debug';
 show session variables like 'innodb_limit_optimistic_insert_debug';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_limit_optimistic_insert_debug';
 select * from information_schema.session_variables where variable_name='innodb_limit_optimistic_insert_debug';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_limit_optimistic_insert_debug=1;
 select @@global.innodb_limit_optimistic_insert_debug;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_limit_optimistic_insert_debug';
 select * from information_schema.session_variables where variable_name='innodb_limit_optimistic_insert_debug';
+--enable_warnings
 set @@global.innodb_limit_optimistic_insert_debug=0;
 select @@global.innodb_limit_optimistic_insert_debug;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_limit_optimistic_insert_debug';
 select * from information_schema.session_variables where variable_name='innodb_limit_optimistic_insert_debug';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_limit_optimistic_insert_debug='some';
 --error ER_GLOBAL_VARIABLE
diff --git a/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test b/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
index f80b8e4..a2aecf4 100644
--- a/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test
@@ -50,17 +50,21 @@ SELECT @@session.innodb_lock_wait_timeout;
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_lock_wait_timeout = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_lock_wait_timeout';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_lock_wait_timeout';
+--enable_warnings
 --echo 1 Expected
 
 
@@ -93,6 +97,73 @@ SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
 SELECT innodb_lock_wait_timeout = @@SESSION.innodb_lock_wait_timeout;
 
 #
+# check the default value
+# 
+set @@global.innodb_lock_wait_timeout=100;
+set @@global.innodb_lock_wait_timeout=DEFAULT;
+select @@global.innodb_lock_wait_timeout;
+set @@session.innodb_lock_wait_timeout=100;
+set @@session.innodb_lock_wait_timeout=DEFAULT;
+select @@session.innodb_lock_wait_timeout;
+
+#
+# check for valid values
+#
+
+SET @@global.innodb_lock_wait_timeout=1;
+SELECT @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout=1024;
+SELECT @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout=1073741824;
+SELECT @@global.innodb_lock_wait_timeout;
+
+SET @@session.innodb_lock_wait_timeout=1;
+SELECT @@session.innodb_lock_wait_timeout;
+SET @@session.innodb_lock_wait_timeout=1024;
+SELECT @@session.innodb_lock_wait_timeout;
+SET @@session.innodb_lock_wait_timeout=1073741824;
+SELECT @@session.innodb_lock_wait_timeout;
+
+# 
+# check for invalid values
+#
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_lock_wait_timeout="t";
+SELECT @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout=-1024;
+SELECT @@global.innodb_lock_wait_timeout;
+SET @@global.innodb_lock_wait_timeout=1073741825;
+SELECT @@global.innodb_lock_wait_timeout;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_lock_wait_timeout=" ";
+SELECT @@global.innodb_lock_wait_timeout;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_lock_wait_timeout=' ';
+SELECT @@global.innodb_lock_wait_timeout;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_lock_wait_timeout=1.1;
+SELECT @@global.innodb_lock_wait_timeout;
+
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.innodb_lock_wait_timeout="T";
+SELECT @@session.innodb_lock_wait_timeout;
+SET @@session.innodb_lock_wait_timeout=-1024;
+SELECT @@session.innodb_lock_wait_timeout;
+SET @@session.innodb_lock_wait_timeout=1073999999;
+SELECT @@session.innodb_lock_wait_timeout;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.innodb_lock_wait_timeout=' ';
+SELECT @@session.innodb_lock_wait_timeout;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.innodb_lock_wait_timeout=" ";
+SELECT @@session.innodb_lock_wait_timeout;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.innodb_lock_wait_timeout=1.1;
+SELECT @@session.innodb_lock_wait_timeout;
+
+
+
 # Cleanup
 #
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test b/mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test
index 08792d2..755c5c6 100644
--- a/mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_locks_unsafe_for_binlog_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_locks_unsafe_for_binlog);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_locks_unsafe_for_binlog, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_locks_unsafe_for_binlog';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_locks_unsafe_for_binlog);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_locks_unsafe_for_binlog';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_buffer_size_basic.test
index 74c1aea..550bba0 100644
--- a/mysql-test/suite/sys_vars/t/innodb_log_buffer_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_log_buffer_size_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_log_buffer_size);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_log_buffer_size = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_log_buffer_size';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_log_buffer_size);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_log_buffer_size';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_checkpoint_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_checkpoint_now_basic.test
index 00aa476..331803f 100644
--- a/mysql-test/suite/sys_vars/t/innodb_log_checkpoint_now_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_log_checkpoint_now_basic.test
@@ -1 +1,79 @@
---echo XtraDB extension
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+SET @start_global_value = @@global.innodb_log_checkpoint_now;
+SELECT @start_global_value;
+
+#
+# exists as global only
+#
+select @@global.innodb_log_checkpoint_now in (0, 1);
+select @@global.innodb_log_checkpoint_now;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.innodb_log_checkpoint_now;
+show global variables like 'innodb_log_checkpoint_now';
+show session variables like 'innodb_log_checkpoint_now';
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
+select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
+--enable_warnings
+
+#
+# show that it's writable
+#
+set global innodb_log_checkpoint_now=1;
+# Should always be OFF
+select @@global.innodb_log_checkpoint_now;
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
+select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
+--enable_warnings
+
+set @@global.innodb_log_checkpoint_now=0;
+# Should always be OFF
+select @@global.innodb_log_checkpoint_now;
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
+select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
+--enable_warnings
+
+set global innodb_log_checkpoint_now=ON;
+# Should always be OFF
+select @@global.innodb_log_checkpoint_now;
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
+select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
+--enable_warnings
+
+set global innodb_log_checkpoint_now=OFF;
+# Should always be OFF
+select @@global.innodb_log_checkpoint_now;
+--disable_warnings
+select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
+select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
+--enable_warnings
+
+--error ER_GLOBAL_VARIABLE
+set session innodb_log_checkpoint_now='some';
+
+--error ER_GLOBAL_VARIABLE
+set @@session.innodb_log_checkpoint_now='some';
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_log_checkpoint_now=1.1;
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_log_checkpoint_now='foo';
+--error ER_WRONG_VALUE_FOR_VAR
+set global innodb_log_checkpoint_now=-2;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_log_checkpoint_now=1e1;
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_log_checkpoint_now = @start_global_value;
+SELECT @@global.innodb_log_checkpoint_now;
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_checksums_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_checksums_basic.test
new file mode 100644
index 0000000..8ebc9f1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_log_checksums_basic.test
@@ -0,0 +1,36 @@
+--source include/have_innodb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_log_checksums;
+SELECT @orig;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_log_checksums = 'crc32';
+SELECT @@global.innodb_log_checksums;
+
+-- error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_log_checksums = 2;
+SELECT @@global.innodb_log_checksums;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_log_checksums = 1e2;
+SELECT @@global.innodb_log_checksums;
+
+-- error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL innodb_log_checksums = 1.0;
+SELECT @@global.innodb_log_checksums;
+
+-- error ER_GLOBAL_VARIABLE
+SET innodb_log_checksums = OFF;
+SELECT @@global.innodb_log_checksums;
+
+SET GLOBAL innodb_log_checksums = OFF;
+SELECT @@global.innodb_log_checksums;
+
+SET GLOBAL innodb_log_checksums = default;
+
+SET GLOBAL innodb_log_checksums = ON;
+SELECT @@global.innodb_log_checksums;
+
+SET GLOBAL innodb_log_checksums = @orig;
+SELECT @@global.innodb_log_checksums;
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
index 8d10309..2c83a36 100644
--- 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
@@ -1,10 +1,5 @@
 --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;
 
@@ -39,17 +34,21 @@ SELECT @@global.innodb_log_compressed_pages;
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_log_compressed_pages,'ON','OFF') = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_log_compressed_pages';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_log_compressed_pages';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_file_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_file_size_basic.test
index 08925b7..21fd2a8 100644
--- a/mysql-test/suite/sys_vars/t/innodb_log_file_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_log_file_size_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_log_file_size);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_log_file_size = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_log_file_size';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_log_file_size);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_log_file_size';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_files_in_group_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_files_in_group_basic.test
index 67978ef..60046bd 100644
--- a/mysql-test/suite/sys_vars/t/innodb_log_files_in_group_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_log_files_in_group_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_log_files_in_group);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_log_files_in_group = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_log_files_in_group';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_log_files_in_group);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_log_files_in_group';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_group_home_dir_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_group_home_dir_basic.test
index 7e3969c..d6d5446 100644
--- a/mysql-test/suite/sys_vars/t/innodb_log_group_home_dir_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_log_group_home_dir_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_log_group_home_dir);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_log_group_home_dir = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_log_group_home_dir';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_log_group_home_dir);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_log_group_home_dir';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_log_write_ahead_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_log_write_ahead_size_basic.test
new file mode 100644
index 0000000..8693c6a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_log_write_ahead_size_basic.test
@@ -0,0 +1,93 @@
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_log_write_ahead_size;
+
+# default value is limited by innodb_page_size and varying along with the page size.
+#SELECT @start_global_value;
+
+#set common valid value
+SET global innodb_log_write_ahead_size=4096;
+
+#
+# exists as global only
+#
+--echo Valid values are positive number
+SELECT @@global.innodb_log_write_ahead_size >= 512;
+SELECT @@global.innodb_log_write_ahead_size <= 16*1024;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.innodb_log_write_ahead_size;
+SHOW global variables LIKE 'innodb_log_write_ahead_size';
+SHOW session variables LIKE 'innodb_log_write_ahead_size';
+--disable_warnings
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_log_write_ahead_size';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_log_write_ahead_size';
+--enable_warnings
+
+#
+# show that it's writable
+#
+SET global innodb_log_write_ahead_size=1024;
+SELECT @@global.innodb_log_write_ahead_size;
+--disable_warnings
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_log_write_ahead_size';
+SELECT * FROM information_schema.session_variables
+WHERE variable_name='innodb_log_write_ahead_size';
+--enable_warnings
+--error ER_GLOBAL_VARIABLE
+SET session innodb_log_write_ahead_size=2048;
+
+#
+# Valid values
+#
+SET global innodb_log_write_ahead_size=512;
+SELECT @@global.innodb_log_write_ahead_size;
+SET global innodb_log_write_ahead_size=2048;
+SELECT @@global.innodb_log_write_ahead_size;
+SET global innodb_log_write_ahead_size=4096;
+SELECT @@global.innodb_log_write_ahead_size;
+
+# limited by innodb_page_size, and the followings are occationally invalid
+#SET global innodb_log_write_ahead_size=8192;
+#SELECT @@global.innodb_log_write_ahead_size;
+#SET global innodb_log_write_ahead_size=16384;
+#SELECT @@global.innodb_log_write_ahead_size;
+
+#
+# Invalid values
+#
+SET global innodb_log_write_ahead_size=0;
+SELECT @@global.innodb_log_write_ahead_size;
+SET global innodb_log_write_ahead_size=-1024;
+SELECT @@global.innodb_log_write_ahead_size;
+SET global innodb_log_write_ahead_size=3000;
+SELECT @@global.innodb_log_write_ahead_size;
+
+# limited by innodb_page_size, and the followings result occationally different
+#SET global innodb_log_write_ahead_size=32768;
+#SELECT @@global.innodb_log_write_ahead_size;
+
+#
+# incorrect types
+#
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_log_write_ahead_size=1.1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_log_write_ahead_size=1e1;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_log_write_ahead_size="foo";
+SET global innodb_log_write_ahead_size=-7;
+SELECT @@global.innodb_log_write_ahead_size;
+--disable_warnings
+SELECT * FROM information_schema.global_variables
+WHERE variable_name='innodb_log_write_ahead_size';
+--enable_warnings
+
+#
+# cleanup
+#
+
+SET @@global.innodb_log_write_ahead_size = @start_global_value;
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
index 1221130..8f08a1b 100644
--- 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
@@ -18,16 +18,20 @@ select @@global.innodb_lru_scan_depth;
 select @@session.innodb_lru_scan_depth;
 show global variables like 'innodb_lru_scan_depth';
 show session variables like 'innodb_lru_scan_depth';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_lru_scan_depth=325;
 select @@global.innodb_lru_scan_depth;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_lru_scan_depth=444;
 
@@ -43,10 +47,14 @@ set global innodb_lru_scan_depth="foo";
 
 set global innodb_lru_scan_depth=7;
 select @@global.innodb_lru_scan_depth;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
+--enable_warnings
 set global innodb_lru_scan_depth=-7;
 select @@global.innodb_lru_scan_depth;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
+--enable_warnings
 
 #
 # min/max values
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 5b4eaa4..e8cc460 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
@@ -31,20 +31,29 @@
 ######################################################################
 
 
-################################################################################ 
+################################################################################
 #   Saving initial value of innodb_max_dirty_pages_pct in a temporary variable #
-################################################################################ 
+################################################################################
 
 SET @global_start_value = @@global.innodb_max_dirty_pages_pct;
 SELECT @global_start_value;
 
+# need this because setting innodb_max_dirty_pages_pct to lower than this
+# should cause a warning
+SET @global_start_max_dirty_lwm_value = @@global.innodb_max_dirty_pages_pct_lwm;
+SELECT @global_start_max_dirty_lwm_value;
+
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = 0;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
 --echo '#--------------------FN_DYNVARS_046_01------------------------#'
-######################################################################## 
+########################################################################
 #           Display the DEFAULT value of innodb_max_dirty_pages_pct    #
-######################################################################## 
+########################################################################
 
 SET @@global.innodb_max_dirty_pages_pct = 0;
-SET @@global.innodb_max_dirty_pages_pct = @global_start_value;
+SET @@global.innodb_max_dirty_pages_pct = DEFAULT;
 SELECT @@global.innodb_max_dirty_pages_pct;
 
 --echo '#---------------------FN_DYNVARS_046_02-------------------------#'
@@ -63,11 +72,11 @@ SET global innodb_max_dirty_pages_pct = 0;
 SELECT @@global.innodb_max_dirty_pages_pct;
 
 --echo '#--------------------FN_DYNVARS_046_03------------------------#'
-########################################################################## 
+##########################################################################
 #      change the value of innodb_max_dirty_pages_pct to a valid value   #
-########################################################################## 
+##########################################################################
 
-SET @@global.innodb_max_dirty_pages_pct = 0;
+SET @@global.innodb_max_dirty_pages_pct = 0.0;
 SELECT @@global.innodb_max_dirty_pages_pct;
 
 SET @@global.innodb_max_dirty_pages_pct = 1;
@@ -75,14 +84,26 @@ SELECT @@global.innodb_max_dirty_pages_pct;
 SET @@global.innodb_max_dirty_pages_pct = 99;
 SELECT @@global.innodb_max_dirty_pages_pct;
 
---echo '#--------------------FN_DYNVARS_046_04-------------------------#'
-########################################################################### 
+--echo '#--------------------FN_DYNVARS_046_04------------------------#'
+##########################################################################
+#      change value of based on innodb_max_dirty_pages_pct_lwm           #
+##########################################################################
+SET @@global.innodb_max_dirty_pages_pct_lwm = @global_start_value - 1;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+# this should cause warning
+SET @@global.innodb_max_dirty_pages_pct = @global_start_value - 2;
+SELECT @@global.innodb_max_dirty_pages_pct;
+
+--echo '#--------------------FN_DYNVARS_046_05-------------------------#'
+###########################################################################
 #      Change the value of innodb_max_dirty_pages_pct to invalid value    #
-########################################################################### 
+###########################################################################
 
 SET @@global.innodb_max_dirty_pages_pct = -1;
 SELECT @@global.innodb_max_dirty_pages_pct;
-
+SET @@global.innodb_max_dirty_pages_pct = -1024;
+SELECT @@global.innodb_max_dirty_pages_pct;
 --Error ER_WRONG_TYPE_FOR_VAR
 SET @@global.innodb_max_dirty_pages_pct = "T";
 SELECT @@global.innodb_max_dirty_pages_pct;
@@ -91,26 +112,49 @@ SELECT @@global.innodb_max_dirty_pages_pct;
 SET @@global.innodb_max_dirty_pages_pct = "Y";
 SELECT @@global.innodb_max_dirty_pages_pct;
 
+SET @@global.innodb_max_dirty_pages_pct = 100;
+SELECT @@global.innodb_max_dirty_pages_pct;
 SET @@global.innodb_max_dirty_pages_pct = 1001;
 SELECT @@global.innodb_max_dirty_pages_pct;
+SET @@global.innodb_max_dirty_pages_pct = 100000;
+SELECT @@global.innodb_max_dirty_pages_pct;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_dirty_pages_pct = ' ';
+SELECT @@global.innodb_max_dirty_pages_pct;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_dirty_pages_pct = " ";
+SELECT @@global.innodb_max_dirty_pages_pct;
+SET @@global.innodb_max_dirty_pages_pct = 1.1;
+SELECT @@global.innodb_max_dirty_pages_pct;
+set global innodb_max_dirty_pages_pct = 0.1;
+SELECT @@global.innodb_max_dirty_pages_pct;
+set global innodb_max_dirty_pages_pct = 31.34;
+SELECT @@global.innodb_max_dirty_pages_pct;
+set global innodb_max_dirty_pages_pct = 100;
+SELECT @@global.innodb_max_dirty_pages_pct;
+set global innodb_max_dirty_pages_pct = 99.999;
+SELECT @@global.innodb_max_dirty_pages_pct;
 
-
---echo '#----------------------FN_DYNVARS_046_05------------------------#'
-######################################################################### 
+--echo '#----------------------FN_DYNVARS_046_06------------------------#'
+#########################################################################
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_max_dirty_pages_pct =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct';
+--enable_warnings
 SELECT @@global.innodb_max_dirty_pages_pct;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct';
+--enable_warnings
 
---echo '#---------------------FN_DYNVARS_046_06-------------------------#'
-################################################################### 
+--echo '#---------------------FN_DYNVARS_046_07-------------------------#'
+###################################################################
 #        Check if ON and OFF values can be used on variable       #
-################################################################### 
+###################################################################
 
 --ERROR ER_WRONG_TYPE_FOR_VAR
 SET @@global.innodb_max_dirty_pages_pct = OFF;
@@ -120,23 +164,26 @@ SELECT @@global.innodb_max_dirty_pages_pct;
 SET @@global.innodb_max_dirty_pages_pct = ON;
 SELECT @@global.innodb_max_dirty_pages_pct;
 
---echo '#---------------------FN_DYNVARS_046_07----------------------#'
-################################################################### 
+--echo '#---------------------FN_DYNVARS_046_08----------------------#'
+###################################################################
 #      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
+###################################################################
 
 SET @@global.innodb_max_dirty_pages_pct = TRUE;
 SELECT @@global.innodb_max_dirty_pages_pct;
 SET @@global.innodb_max_dirty_pages_pct = FALSE;
 SELECT @@global.innodb_max_dirty_pages_pct;
 
-##############################  
+##############################
 #   Restore initial value    #
 ##############################
 
 SET @@global.innodb_max_dirty_pages_pct = @global_start_value;
 SELECT @@global.innodb_max_dirty_pages_pct;
 
+SET @@global.innodb_max_dirty_pages_pct_lwm = @global_start_max_dirty_lwm_value;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
 ###############################################################
 #                    END OF innodb_max_dirty_pages_pct TESTS  #
-############################################################### 
+###############################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
index 62c88f4..c7a9e56 100644
--- a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
@@ -33,15 +33,22 @@ SET @innodb_max_dirty_pages_pct = @@global.innodb_max_dirty_pages_pct;
 ############################################################################
 
 SET @@global.innodb_max_dirty_pages_pct = 80;
+--echo 'connect (con1,localhost,root,,,,)'
 connect (con1,localhost,root,,,,);
+--echo 'connection con1'
 connection con1;
 SELECT @@global.innodb_max_dirty_pages_pct;
 SET @@global.innodb_max_dirty_pages_pct = 70;
+--echo 'connect (con2,localhost,root,,,,)'
 connect (con2,localhost,root,,,,);
+--echo 'connection con2'
 connection con2;
 SELECT @@global.innodb_max_dirty_pages_pct;
+--echo 'connection default'
 connection default;
+--echo 'disconnect con2'
 disconnect con2;
+--echo 'disconnect con1'
 disconnect con1;
 # restore initial value
 SET @@global.innodb_max_dirty_pages_pct = @innodb_max_dirty_pages_pct;
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
index d81b6cc..b06f209 100644
--- 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
@@ -47,7 +47,7 @@ SELECT @pct_start_value;
 ########################################################################
 
 SET @@global.innodb_max_dirty_pages_pct_lwm = 0;
-SET @@global.innodb_max_dirty_pages_pct_lwm = @pct_lwm_start_value;
+SET @@global.innodb_max_dirty_pages_pct_lwm = DEFAULT;
 SELECT @@global.innodb_max_dirty_pages_pct_lwm;
 
 --echo '#---------------------FN_DYNVARS_046_02-------------------------#'
@@ -96,22 +96,40 @@ 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;
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = 0.0;
 SELECT @@global.innodb_max_dirty_pages_pct_lwm;
 
+SET @@global.innodb_max_dirty_pages_pct_lwm = 1.1;
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+
+SET @@global.innodb_max_dirty_pages_pct_lwm = 51.12;
+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;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_dirty_pages_pct_lwm = " ";
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_dirty_pages_pct_lwm = ' ';
+SELECT @@global.innodb_max_dirty_pages_pct_lwm;
 
 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
 #########################################################################
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_max_dirty_pages_pct_lwm =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct_lwm';
+--enable_warnings
 SELECT @@global.innodb_max_dirty_pages_pct_lwm;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_max_dirty_pages_pct_lwm';
+--enable_warnings
 
 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
 ###################################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic.test
index 9e6b820..6c7676f 100644
--- a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic.test
@@ -66,16 +66,37 @@ SELECT @@global.innodb_max_purge_lag;
 #      change the value of innodb_max_purge_lag to a valid value         #
 ########################################################################## 
 
-
 SET @@global.innodb_max_purge_lag = 0;
 SELECT @@global.innodb_max_purge_lag;
 
 SET @@global.innodb_max_purge_lag = 1;
 SELECT @@global.innodb_max_purge_lag;
+
 SET @@global.innodb_max_purge_lag = 4294967295;
 SELECT @@global.innodb_max_purge_lag;
 
---echo '#--------------------FN_DYNVARS_046_04-------------------------#'
+--echo '#--------------------FN_DYNVARS_046_04------------------------#'
+########################################################################## 
+#     check the value of innodb_concurrency_tickets for out of bounds    #
+##########################################################################
+
+# With a 64 bit mysqld:18446744073709551615,with a 32 bit mysqld: 4294967295
+--disable_warnings
+SET @@global.innodb_max_purge_lag = 4294967296;
+--enable_warnings
+SELECT @@global.innodb_max_purge_lag IN (4294967296,4294967295);
+
+--disable_warnings
+SET @@global.innodb_max_purge_lag = 12345678901;
+--enable_warnings
+SELECT @@global.innodb_max_purge_lag IN (12345678901,4294967295);
+
+--disable_warnings
+SET @@global.innodb_max_purge_lag = 18446744073709551615;
+--enable_warnings
+SELECT @@global.innodb_max_purge_lag IN (18446744073709551615,4294967295);
+
+--echo '#--------------------FN_DYNVARS_046_05-------------------------#'
 ########################################################################### 
 #       Change the value of innodb_max_purge_lag to invalid value         #
 ########################################################################### 
@@ -83,6 +104,9 @@ SELECT @@global.innodb_max_purge_lag;
 SET @@global.innodb_max_purge_lag = -1;
 SELECT @@global.innodb_max_purge_lag;
 
+SET @@global.innodb_max_purge_lag = -1024;
+SELECT @@global.innodb_max_purge_lag;
+
 --Error ER_WRONG_TYPE_FOR_VAR
 SET @@global.innodb_max_purge_lag = "T";
 SELECT @@global.innodb_max_purge_lag;
@@ -91,26 +115,35 @@ SELECT @@global.innodb_max_purge_lag;
 SET @@global.innodb_max_purge_lag = "Y";
 SELECT @@global.innodb_max_purge_lag;
 
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_purge_lag = 1.1;
+SELECT @@global.innodb_max_purge_lag;
 
-SET @@global.innodb_max_purge_lag = 1001;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_purge_lag = ' ';
 SELECT @@global.innodb_max_purge_lag;
 
---echo '#----------------------FN_DYNVARS_046_05------------------------#'
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_purge_lag = " ";
+SELECT @@global.innodb_max_purge_lag;
+
+--echo '#----------------------FN_DYNVARS_046_06------------------------#'
 ######################################################################### 
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_max_purge_lag =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_max_purge_lag';
+--enable_warnings
 SELECT @@global.innodb_max_purge_lag;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_max_purge_lag';
+--enable_warnings
 
-
-
-
---echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+--echo '#---------------------FN_DYNVARS_046_07-------------------------#'
 ################################################################### 
 #        Check if ON and OFF values can be used on variable       #
 ################################################################### 
@@ -123,12 +156,11 @@ SELECT @@global.innodb_max_purge_lag;
 SET @@global.innodb_max_purge_lag = ON;
 SELECT @@global.innodb_max_purge_lag;
 
---echo '#---------------------FN_DYNVARS_046_07----------------------#'
+--echo '#---------------------FN_DYNVARS_046_08----------------------#'
 ################################################################### 
 #      Check if TRUE and FALSE values can be used on variable     #
 ################################################################### 
 
-
 SET @@global.innodb_max_purge_lag = TRUE;
 SELECT @@global.innodb_max_purge_lag;
 SET @@global.innodb_max_purge_lag = FALSE;
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
index 6374e37..f7580c9 100644
--- 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
@@ -13,9 +13,11 @@ SET @@GLOBAL.innodb_max_purge_lag_delay=1;
 SELECT COUNT(@@GLOBAL.innodb_max_purge_lag_delay);
 --echo 1 Expected
 
+--disable_warnings
 SELECT VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_max_purge_lag_delay';
+--enable_warnings
 --echo 1 Expected
 
 SELECT @@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay;
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_undo_log_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_undo_log_size_basic.test
new file mode 100644
index 0000000..9882578
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_max_undo_log_size_basic.test
@@ -0,0 +1,99 @@
+
+
+############### mysql-test\t\innodb_max_undo_log_size_basic.test ###############
+#                                                                             #
+# Variable Name: innodb_max_undo_log_size                                     #
+# Scope: Global                                                               #
+# Access Type: Static                                                         #
+# Data Type: numeric                                                          #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2014-27-05                                                   #
+# Author : Krunal Bauskar                                                     #
+#                                                                             #
+#                                                                             #
+# Description:Test Cases of Dynamic System Variable innodb_max_undo_log_size  #
+#             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                                               #
+#                                                                             #
+###############################################################################
+
+--source include/have_innodb.inc
+
+--echo '#---------------------BS_STVARS_035_01----------------------#'
+####################################################################
+#   Displaying default value                                       #
+####################################################################
+SELECT COUNT(@@GLOBAL.innodb_max_undo_log_size);
+--echo 1 Expected
+
+
+--echo '#---------------------BS_STVARS_035_02----------------------#'
+####################################################################
+#   Check if Value can set                                         #
+####################################################################
+
+SET @@GLOBAL.innodb_max_undo_log_size=1073741824;
+
+SELECT COUNT(@@GLOBAL.innodb_max_undo_log_size);
+--echo 1 Expected
+
+SET @@GLOBAL.innodb_max_undo_log_size=18446744073709551615;
+SELECT @@GLOBAL.innodb_max_undo_log_size;
+--echo 18446744073709551615 Expected
+
+SET @@GLOBAL.innodb_max_undo_log_size=1073741824;
+
+--echo '#---------------------BS_STVARS_035_03----------------------#'
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable  #
+#################################################################
+
+--disable_warnings
+SELECT @@GLOBAL.innodb_max_undo_log_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_undo_log_size';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_max_undo_log_size);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_undo_log_size';
+--echo 1 Expected
+--enable_warnings
+
+
+--echo '#---------------------BS_STVARS_035_04----------------------#'
+################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable  #
+################################################################################
+SELECT @@innodb_max_undo_log_size = @@GLOBAL.innodb_max_undo_log_size;
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_035_05----------------------#'
+################################################################################
+# Check if innodb_max_undo_log_size can be accessed with and without @@ sign   #
+################################################################################
+
+SELECT COUNT(@@innodb_max_undo_log_size);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_max_undo_log_size);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_max_undo_log_size);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_max_undo_log_size);
+--echo 1 Expected
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_merge_threshold_set_all_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_merge_threshold_set_all_debug_basic.test
new file mode 100644
index 0000000..0ea3027
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_merge_threshold_set_all_debug_basic.test
@@ -0,0 +1,30 @@
+--echo #
+--echo # Basic test for innodb_merge_threshold_set_all_debug
+--echo #
+
+--source include/have_innodb.inc
+
+# The config variable is a debug variable
+-- source include/have_debug.inc
+
+SELECT @@global.innodb_merge_threshold_set_all_debug;
+
+set global innodb_merge_threshold_set_all_debug = 1;
+
+SELECT @@global.innodb_merge_threshold_set_all_debug;
+
+set global innodb_merge_threshold_set_all_debug = 51;
+
+SELECT @@global.innodb_merge_threshold_set_all_debug;
+
+set global innodb_merge_threshold_set_all_debug = 0;
+
+SELECT @@global.innodb_merge_threshold_set_all_debug;
+
+--error ER_GLOBAL_VARIABLE
+set innodb_merge_threshold_set_all_debug = 50;
+
+set global innodb_merge_threshold_set_all_debug = 50;
+
+SELECT @@global.innodb_merge_threshold_set_all_debug;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_mirrored_log_groups_basic.test b/mysql-test/suite/sys_vars/t/innodb_mirrored_log_groups_basic.test
deleted file mode 100644
index 6edb07a..0000000
--- a/mysql-test/suite/sys_vars/t/innodb_mirrored_log_groups_basic.test
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-################## mysql-test\t\innodb_mirrored_log_groups_basic.test #########
-#                                                                             #
-# Variable Name: innodb_mirrored_log_groups                                   #
-# Scope: Global                                                               #
-# Access Type: Static                                                         #
-# Data Type: numeric                                                          #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author : Sharique Abdullah                                                      #
-#                                                                             #
-#                                                                             #
-# Description:Test Cases of Dynamic System Variable innodb_mirrored_log_groups#
-#             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                                               #
-#                                                                             #
-###############################################################################
-
---source include/have_innodb.inc
-
---echo '#---------------------BS_STVARS_037_01----------------------#'
-####################################################################
-#   Displaying default value                                       #
-####################################################################
-SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups);
---echo 1 Expected
-
-
---echo '#---------------------BS_STVARS_037_02----------------------#'
-####################################################################
-#   Check if Value can set                                         #
-####################################################################
-
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.innodb_mirrored_log_groups=1;
---echo Expected error 'Read only variable'
-
-SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups);
---echo 1 Expected
-
-
-
-
---echo '#---------------------BS_STVARS_037_03----------------------#'
-#################################################################
-# Check if the value in GLOBAL Table matches value in variable  #
-#################################################################
-
-SELECT @@GLOBAL.innodb_mirrored_log_groups = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_mirrored_log_groups';
---echo 1 Expected
-
-SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups);
---echo 1 Expected
-
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='innodb_mirrored_log_groups';
---echo 1 Expected
-
-
-
---echo '#---------------------BS_STVARS_037_04----------------------#'
-################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable  #
-################################################################################
-SELECT @@innodb_mirrored_log_groups = @@GLOBAL.innodb_mirrored_log_groups;
---echo 1 Expected
-
-
-
---echo '#---------------------BS_STVARS_037_05----------------------#'
-################################################################################
-#   Check if innodb_mirrored_log_groups can be accessed with and without @@ sign #
-################################################################################
-
-SELECT COUNT(@@innodb_mirrored_log_groups);
---echo 1 Expected
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@local.innodb_mirrored_log_groups);
---echo Expected error 'Variable is a GLOBAL variable'
-
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT COUNT(@@SESSION.innodb_mirrored_log_groups);
---echo Expected error 'Variable is a GLOBAL variable'
-
-SELECT COUNT(@@GLOBAL.innodb_mirrored_log_groups);
---echo 1 Expected
-
---Error ER_BAD_FIELD_ERROR
-SELECT innodb_mirrored_log_groups = @@SESSION.innodb_mirrored_log_groups;
---echo Expected error 'Readonly variable'
-
-
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
index 0615d62..1b23ae1 100644
--- a/mysql-test/suite/sys_vars/t/innodb_monitor_disable_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_monitor_disable_basic.test
@@ -2,11 +2,6 @@
 # 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
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
index 0615d62..1b23ae1 100644
--- a/mysql-test/suite/sys_vars/t/innodb_monitor_enable_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_monitor_enable_basic.test
@@ -2,11 +2,6 @@
 # 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
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
index 868f693..1b23ae1 100644
--- 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
@@ -2,11 +2,6 @@
 # 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
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
index 868f693..1b23ae1 100644
--- a/mysql-test/suite/sys_vars/t/innodb_monitor_reset_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_monitor_reset_basic.test
@@ -2,11 +2,6 @@
 # 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
diff --git a/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test b/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test
new file mode 100644
index 0000000..9f41cb7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_numa_interleave_basic.test
@@ -0,0 +1,13 @@
+--source include/have_innodb.inc
+--source include/have_numa.inc
+
+SELECT @@GLOBAL.innodb_numa_interleave;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_numa_interleave=off;
+
+SELECT @@GLOBAL.innodb_use_native_aio;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@SESSION.innodb_use_native_aio;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_old_blocks_pct_basic.test b/mysql-test/suite/sys_vars/t/innodb_old_blocks_pct_basic.test
index 0dcef3b..1f72fc2 100644
--- a/mysql-test/suite/sys_vars/t/innodb_old_blocks_pct_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_old_blocks_pct_basic.test
@@ -18,20 +18,30 @@ select @@global.innodb_old_blocks_pct;
 select @@session.innodb_old_blocks_pct;
 show global variables like 'innodb_old_blocks_pct';
 show session variables like 'innodb_old_blocks_pct';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct';
 select * from information_schema.session_variables where variable_name='innodb_old_blocks_pct';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_old_blocks_pct=10;
 select @@global.innodb_old_blocks_pct;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct';
 select * from information_schema.session_variables where variable_name='innodb_old_blocks_pct';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_old_blocks_pct=1;
 
 #
+# check the default value 
+#
+set @@global.innodb_old_blocks_pct=DEFAULT;
+select @@global.innodb_old_blocks_pct;
+
+#
 # incorrect types
 #
 --error ER_WRONG_TYPE_FOR_VAR
@@ -40,16 +50,26 @@ set global innodb_old_blocks_pct=1.1;
 set global innodb_old_blocks_pct=1e1;
 --error ER_WRONG_TYPE_FOR_VAR
 set global innodb_old_blocks_pct="foo";
-
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_old_blocks_pct=" ";
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_old_blocks_pct='';
+ 
 set global innodb_old_blocks_pct=4;
 select @@global.innodb_old_blocks_pct;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct';
+--enable_warnings
 set global innodb_old_blocks_pct=-7;
 select @@global.innodb_old_blocks_pct;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct';
+--enable_warnings
 set global innodb_old_blocks_pct=96;
 select @@global.innodb_old_blocks_pct;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_old_blocks_pct';
+--enable_warnings
 
 #
 # min/max values
diff --git a/mysql-test/suite/sys_vars/t/innodb_old_blocks_time_basic.test b/mysql-test/suite/sys_vars/t/innodb_old_blocks_time_basic.test
index 3efec2b..d05e724 100644
--- a/mysql-test/suite/sys_vars/t/innodb_old_blocks_time_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_old_blocks_time_basic.test
@@ -18,16 +18,20 @@ select @@global.innodb_old_blocks_time;
 select @@session.innodb_old_blocks_time;
 show global variables like 'innodb_old_blocks_time';
 show session variables like 'innodb_old_blocks_time';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_old_blocks_time';
 select * from information_schema.session_variables where variable_name='innodb_old_blocks_time';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_old_blocks_time=10;
 select @@global.innodb_old_blocks_time;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_old_blocks_time';
 select * from information_schema.session_variables where variable_name='innodb_old_blocks_time';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_old_blocks_time=1;
 
@@ -43,7 +47,9 @@ set global innodb_old_blocks_time="foo";
 
 set global innodb_old_blocks_time=-7;
 select @@global.innodb_old_blocks_time;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_old_blocks_time';
+--enable_warnings
 
 #
 # cleanup
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
index aa1cc83..b86f04c 100644
--- 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
@@ -12,20 +12,26 @@ select @@global.innodb_online_alter_log_max_size;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_online_alter_log_max_size=1048576;
 select @@global.innodb_online_alter_log_max_size;
+--disable_warnings
 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';
+--enable_warnings
 set @@global.innodb_online_alter_log_max_size=524288;
 select @@global.innodb_online_alter_log_max_size;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_online_alter_log_max_size='some';
 --error ER_GLOBAL_VARIABLE
diff --git a/mysql-test/suite/sys_vars/t/innodb_open_files_basic.test b/mysql-test/suite/sys_vars/t/innodb_open_files_basic.test
index c55b7e5..d6b7c85 100644
--- a/mysql-test/suite/sys_vars/t/innodb_open_files_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_open_files_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_open_files);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT @@GLOBAL.innodb_open_files = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_open_files';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_open_files);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_open_files';
+--enable_warnings
 --echo 1 Expected
 
 
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
index e9ff8a6..08b8c13 100644
--- 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
@@ -18,28 +18,38 @@ select @@global.innodb_optimize_fulltext_only;
 select @@session.innodb_optimize_fulltext_only;
 show global variables like 'innodb_optimize_fulltext_only';
 show session variables like 'innodb_optimize_fulltext_only';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_optimize_fulltext_only='ON';
 select @@global.innodb_optimize_fulltext_only;
+--disable_warnings
 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';
+--enable_warnings
 set @@global.innodb_optimize_fulltext_only=0;
 select @@global.innodb_optimize_fulltext_only;
+--disable_warnings
 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';
+--enable_warnings
 set global innodb_optimize_fulltext_only=1;
 select @@global.innodb_optimize_fulltext_only;
+--disable_warnings
 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';
+--enable_warnings
 set @@global.innodb_optimize_fulltext_only='OFF';
 select @@global.innodb_optimize_fulltext_only;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_optimize_fulltext_only='OFF';
 --error ER_GLOBAL_VARIABLE
@@ -57,8 +67,10 @@ 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;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_optimize_fulltext_only='AUTO';
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_page_cleaners_basic.test b/mysql-test/suite/sys_vars/t/innodb_page_cleaners_basic.test
new file mode 100644
index 0000000..716492b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_page_cleaners_basic.test
@@ -0,0 +1,53 @@
+# Variable name: innodb_page_cleaners
+# Scope: Global
+# Access type: Static
+# Data type: numeric
+
+--source include/have_innodb.inc
+
+SELECT COUNT(@@GLOBAL.innodb_page_cleaners);
+--echo 1 Expected
+
+SELECT COUNT(@@innodb_page_cleaners);
+--echo 1 Expected
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_page_cleaners=1;
+--echo Expected error 'Read-only variable'
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_page_cleaners = @@SESSION.innodb_page_cleaners;
+--echo Expected error 'Read-only variable'
+
+--disable_warnings
+SELECT @@GLOBAL.innodb_page_cleaners = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_page_cleaners';
+--enable_warnings
+--echo 1 Expected
+
+--disable_warnings
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_page_cleaners';
+--enable_warnings
+--echo 1 Expected
+
+SELECT @@innodb_page_cleaners = @@GLOBAL.innodb_page_cleaners;
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_page_cleaners);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_page_cleaners);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+# Check the default value
+--disable_warnings
+SELECT VARIABLE_NAME, VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME = 'innodb_page_cleaners';
+--enable_warnings
+
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
index 1479cba..ee4798c 100644
--- 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
@@ -10,8 +10,10 @@ select @@global.innodb_page_hash_locks;
 select @@session.innodb_page_hash_locks;
 show global variables like 'innodb_page_hash_locks';
 show session variables like 'innodb_page_hash_locks';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's read-only
diff --git a/mysql-test/suite/sys_vars/t/innodb_page_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_page_size_basic.test
index 00aa476..1d4f935 100644
--- a/mysql-test/suite/sys_vars/t/innodb_page_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_page_size_basic.test
@@ -1 +1,16 @@
---echo XtraDB extension
+#
+# Basic test for innodb_page_size
+#
+
+-- source include/have_innodb.inc
+
+# Check the default value
+SET @orig = @@global.innodb_page_size;
+--replace_result 65536 {valid_page_size} 32768 {valid_page_size} 16384 {valid_page_size} 8192 {valid_page_size} 4096 {valid_page_size}
+SELECT @orig;
+
+# Confirm that we can not change the value
+-- error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL innodb_page_size = 4k;
+-- error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL innodb_page_size = 8k;
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 4cbd706..5693a82 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
@@ -17,38 +17,48 @@ SELECT @@global.innodb_print_all_deadlocks;
 SELECT @@session.innodb_print_all_deadlocks;
 SHOW global variables LIKE 'innodb_print_all_deadlocks';
 SHOW session variables LIKE 'innodb_print_all_deadlocks';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # SHOW that it's writable
 #
 SET global innodb_print_all_deadlocks='OFF';
 SELECT @@global.innodb_print_all_deadlocks;
+--disable_warnings
 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';
+--enable_warnings
 SET @@global.innodb_print_all_deadlocks=1;
 SELECT @@global.innodb_print_all_deadlocks;
+--disable_warnings
 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';
+--enable_warnings
 SET global innodb_print_all_deadlocks=0;
 SELECT @@global.innodb_print_all_deadlocks;
+--disable_warnings
 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';
+--enable_warnings
 SET @@global.innodb_print_all_deadlocks='ON';
 SELECT @@global.innodb_print_all_deadlocks;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 SET session innodb_print_all_deadlocks='OFF';
 --error ER_GLOBAL_VARIABLE
@@ -66,10 +76,12 @@ 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;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_WRONG_VALUE_FOR_VAR
 SET global innodb_print_all_deadlocks='AUTO';
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_purge_batch_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_purge_batch_size_basic.test
index 88271d2..4f3dc9f 100644
--- a/mysql-test/suite/sys_vars/t/innodb_purge_batch_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_purge_batch_size_basic.test
@@ -72,7 +72,7 @@ SELECT @@global.innodb_purge_batch_size;
 
 SET @@global.innodb_purge_batch_size = 5000;
 SELECT @@global.innodb_purge_batch_size;
-SET @@global.innodb_purge_batch_size = 1000;
+SET @@global.innodb_purge_batch_size = 4294967295;
 SELECT @@global.innodb_purge_batch_size;
 
 --echo '#--------------------FN_DYNVARS_046_04-------------------------#'
@@ -90,8 +90,17 @@ SELECT @@global.innodb_purge_batch_size;
 --Error ER_WRONG_TYPE_FOR_VAR
 SET @@global.innodb_purge_batch_size = "Y";
 SELECT @@global.innodb_purge_batch_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_purge_batch_size = ' ';
+SELECT @@global.innodb_purge_batch_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_purge_batch_size = " ";
+SELECT @@global.innodb_purge_batch_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_purge_batch_size = 1.1;
+SELECT @@global.innodb_purge_batch_size;
 
-SET @@global.innodb_purge_batch_size = 5001;
+SET @@global.innodb_purge_batch_size = 4294967297;
 SELECT @@global.innodb_purge_batch_size;
 
 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
@@ -99,12 +108,16 @@ SELECT @@global.innodb_purge_batch_size;
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_purge_batch_size =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_purge_batch_size';
+--enable_warnings
 SELECT @@global.innodb_purge_batch_size;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_purge_batch_size';
+--enable_warnings
 
 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
 ################################################################### 
diff --git a/mysql-test/suite/sys_vars/t/innodb_purge_rseg_truncate_frequency_basic.test b/mysql-test/suite/sys_vars/t/innodb_purge_rseg_truncate_frequency_basic.test
new file mode 100644
index 0000000..e0871ba
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_purge_rseg_truncate_frequency_basic.test
@@ -0,0 +1,161 @@
+###### mysql-test\t\innodb_purge_rseg_truncate_frequency_basic.test ###########
+#                                                                             #
+# Variable Name: innodb_purge_rseg_truncate_frequency                         #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: Numeric                                                          #
+# Default Value: 128                                                          #
+# Range: 1 - 128                                                              #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2014-27-05                                                   #
+# Author:  Krunal Bauskar                                                     #
+#                                                                             #
+#Description:Test Cases of Dynamic System Variable                            #
+#             innodb_purge_rseg_truncate_frequency                            #
+#             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_purge_rseg_truncate_frequency TESTS               #
+########################################################################
+
+###############################################################################
+#   Saving initial value of innodb_purge_rseg_truncate_frequency in a         #
+#   temporary variable                                                        #
+###############################################################################
+
+SET @global_start_value = @@global.innodb_purge_rseg_truncate_frequency;
+SELECT @global_start_value;
+
+--echo '#--------------------FN_DYNVARS_046_01------------------------#'
+########################################################################
+#    Display the DEFAULT value of innodb_purge_rseg_truncate_frequency #
+########################################################################
+
+SET @@global.innodb_purge_rseg_truncate_frequency = 1;
+SET @@global.innodb_purge_rseg_truncate_frequency = DEFAULT;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
+############################################################################
+#   Check if innodb_purge_rseg_truncate_frequency can be accessed with and #
+#   without @@ sign                                                        #
+############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET innodb_purge_rseg_truncate_frequency = 1;
+SELECT @@innodb_purge_rseg_truncate_frequency;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.innodb_purge_rseg_truncate_frequency;
+
+SET global innodb_purge_rseg_truncate_frequency = 1;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--echo '#--------------------FN_DYNVARS_046_03------------------------#'
+##########################################################################
+# change the value of innodb_purge_rseg_truncate_frequency to a valid    #
+# value                                                                  #
+##########################################################################
+
+SET @@global.innodb_purge_rseg_truncate_frequency = 1;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+SET @@global.innodb_purge_rseg_truncate_frequency = 1;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+SET @@global.innodb_purge_rseg_truncate_frequency = 128;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--echo '#--------------------FN_DYNVARS_046_05-------------------------#'
+###########################################################################
+#       Change the value of innodb_purge_rseg_truncate_frequency to       #
+#       invalid value                                                     #
+###########################################################################
+
+SET @@global.innodb_purge_rseg_truncate_frequency = -1;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+SET @@global.innodb_purge_rseg_truncate_frequency = -1024;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_purge_rseg_truncate_frequency = "T";
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_purge_rseg_truncate_frequency = "Y";
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_purge_rseg_truncate_frequency = 1.1;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_purge_rseg_truncate_frequency = ' ';
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_purge_rseg_truncate_frequency = " ";
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--echo '#----------------------FN_DYNVARS_046_06------------------------#'
+#########################################################################
+#     Check if the value in GLOBAL Table matches value in variable      #
+#########################################################################
+
+--disable_warnings
+SELECT @@global.innodb_purge_rseg_truncate_frequency =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+  WHERE VARIABLE_NAME='innodb_purge_rseg_truncate_frequency';
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_purge_rseg_truncate_frequency';
+--enable_warnings
+
+--echo '#---------------------FN_DYNVARS_046_07-------------------------#'
+###################################################################
+#        Check if ON and OFF values can be used on variable       #
+###################################################################
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_purge_rseg_truncate_frequency = OFF;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_purge_rseg_truncate_frequency = ON;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+--echo '#---------------------FN_DYNVARS_046_08----------------------#'
+###################################################################
+#      Check if TRUE and FALSE values can be used on variable     #
+###################################################################
+
+SET @@global.innodb_purge_rseg_truncate_frequency = TRUE;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+SET @@global.innodb_purge_rseg_truncate_frequency = FALSE;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+##############################
+#   Restore initial value    #
+##############################
+
+
+SET @@global.innodb_purge_rseg_truncate_frequency = @global_start_value;
+SELECT @@global.innodb_purge_rseg_truncate_frequency;
+
+###############################################################
+#    END OF innodb_purge_rseg_truncate_frequency TESTS       #
+###############################################################
diff --git a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
index 64d834c..4d03960 100644
--- a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
@@ -1,89 +1,41 @@
-
-
-################## mysql-test\t\innodb_log_purge_threads_basic.test ###########
-#                                                                             #
-# Variable Name: innodb_purge_threads                                         #
-# Scope: Global                                                               #
-# Access Type: Static                                                         #
-# Data Type: numeric                                                          #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author : Sharique Abdullah                                                      #
-#                                                                             #
-#                                                                             #
-# Description:Test Cases of Dynamic System Variable innodb_purge_threads      #
-#             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                                               #
-#                                                                             #
-###############################################################################
+# Variable name: innodb_purge_threads
+# Scope: Global
+# Access type: Static
+# Data type: numeric
 
 --source include/have_innodb.inc
 
---echo '#---------------------BS_STVARS_035_01----------------------#'
-####################################################################
-#   Displaying default value                                       #
-####################################################################
 SELECT COUNT(@@GLOBAL.innodb_purge_threads);
 --echo 1 Expected
 
-
---echo '#---------------------BS_STVARS_035_02----------------------#'
-####################################################################
-#   Check if Value can set                                         #
-####################################################################
+SELECT COUNT(@@innodb_purge_threads);
+--echo 1 Expected
 
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
 SET @@GLOBAL.innodb_purge_threads=1;
---echo Expected error 'Read only variable'
-
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
---echo 1 Expected
+--echo Expected error 'Read-only variable'
 
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
+--echo Expected error 'Read-only variable'
 
-
-
---echo '#---------------------BS_STVARS_035_03----------------------#'
-#################################################################
-# Check if the value in GLOBAL Table matches value in variable  #
-#################################################################
-
+--disable_warnings
 SELECT @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_purge_threads';
+--enable_warnings
 --echo 1 Expected
 
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
---echo 1 Expected
-
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_purge_threads';
+--enable_warnings
 --echo 1 Expected
 
-
-
---echo '#---------------------BS_STVARS_035_04----------------------#'
-################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable  #
-################################################################################
 SELECT @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads;
 --echo 1 Expected
 
-
-
---echo '#---------------------BS_STVARS_035_05----------------------#'
-################################################################################
-#   Check if innodb_purge_threads can be accessed with and without @@ sign     #
-################################################################################
-
-SELECT COUNT(@@innodb_purge_threads);
---echo 1 Expected
-
 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
 SELECT COUNT(@@local.innodb_purge_threads);
 --echo Expected error 'Variable is a GLOBAL variable'
@@ -92,11 +44,10 @@ SELECT COUNT(@@local.innodb_purge_threads);
 SELECT COUNT(@@SESSION.innodb_purge_threads);
 --echo Expected error 'Variable is a GLOBAL variable'
 
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
---echo 1 Expected
-
---Error ER_BAD_FIELD_ERROR
-SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
---echo Expected error 'Readonly variable'
-
+# Check the default value
+--disable_warnings
+SELECT VARIABLE_NAME, VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME = 'innodb_purge_threads';
+--enable_warnings
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test b/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test
index b7ba6f3..a805fc8 100644
--- a/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test
@@ -18,28 +18,38 @@ select @@global.innodb_random_read_ahead;
 select @@session.innodb_random_read_ahead;
 show global variables like 'innodb_random_read_ahead';
 show session variables like 'innodb_random_read_ahead';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
 select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_random_read_ahead='ON';
 select @@global.innodb_random_read_ahead;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
 select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+--enable_warnings
 set @@global.innodb_random_read_ahead=0;
 select @@global.innodb_random_read_ahead;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
 select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+--enable_warnings
 set global innodb_random_read_ahead=1;
 select @@global.innodb_random_read_ahead;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
 select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+--enable_warnings
 set @@global.innodb_random_read_ahead='OFF';
 select @@global.innodb_random_read_ahead;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
 select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_random_read_ahead='OFF';
 --error ER_GLOBAL_VARIABLE
@@ -57,8 +67,10 @@ set global innodb_random_read_ahead=2;
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_random_read_ahead=-3;
 select @@global.innodb_random_read_ahead;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
 select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
+--enable_warnings
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_random_read_ahead='AUTO';
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_read_ahead_threshold_basic.test b/mysql-test/suite/sys_vars/t/innodb_read_ahead_threshold_basic.test
index 1298a28..65bb9c0 100644
--- a/mysql-test/suite/sys_vars/t/innodb_read_ahead_threshold_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_read_ahead_threshold_basic.test
@@ -18,18 +18,27 @@ select @@global.innodb_read_ahead_threshold;
 select @@session.innodb_read_ahead_threshold;
 show global variables like 'innodb_read_ahead_threshold';
 show session variables like 'innodb_read_ahead_threshold';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold';
 select * from information_schema.session_variables where variable_name='innodb_read_ahead_threshold';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_read_ahead_threshold=10;
 select @@global.innodb_read_ahead_threshold;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold';
 select * from information_schema.session_variables where variable_name='innodb_read_ahead_threshold';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_read_ahead_threshold=1;
+#
+# check the default value
+#
+set global innodb_read_ahead_threshold=DEFAULT;
+select @@global.innodb_read_ahead_threshold;
 
 #
 # incorrect types
@@ -40,13 +49,23 @@ set global innodb_read_ahead_threshold=1.1;
 set global innodb_read_ahead_threshold=1e1;
 --error ER_WRONG_TYPE_FOR_VAR
 set global innodb_read_ahead_threshold="foo";
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_read_ahead_threshold=' ';
+select @@global.innodb_read_ahead_threshold;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_read_ahead_threshold=" ";
+select @@global.innodb_read_ahead_threshold;
 
 set global innodb_read_ahead_threshold=-7;
 select @@global.innodb_read_ahead_threshold;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold';
+--enable_warnings
 set global innodb_read_ahead_threshold=96;
 select @@global.innodb_read_ahead_threshold;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_read_ahead_threshold';
+--enable_warnings
 
 #
 # min/max values
diff --git a/mysql-test/suite/sys_vars/t/innodb_read_io_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_read_io_threads_basic.test
index 1442639..c4c49d5 100644
--- a/mysql-test/suite/sys_vars/t/innodb_read_io_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_read_io_threads_basic.test
@@ -13,8 +13,10 @@ select @@global.innodb_read_io_threads;
 select @@session.innodb_read_io_threads;
 show global variables like 'innodb_read_io_threads';
 show session variables like 'innodb_read_io_threads';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_read_io_threads';
 select * from information_schema.session_variables where variable_name='innodb_read_io_threads';
+--enable_warnings
 
 #
 # show that it's read-only
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
index 581eb35..31cbe77 100644
--- a/mysql-test/suite/sys_vars/t/innodb_read_only_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_read_only_basic.test
@@ -9,8 +9,10 @@ select @@global.innodb_read_only;
 select @@session.innodb_read_only;
 show global variables like 'innodb_read_only';
 show session variables like 'innodb_read_only';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_read_only';
 select * from information_schema.session_variables where variable_name='innodb_read_only';
+--enable_warnings
 
 # Show that it's read-only
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
diff --git a/mysql-test/suite/sys_vars/t/innodb_replication_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_replication_delay_basic.test
index e495de4..c85cc85 100644
--- a/mysql-test/suite/sys_vars/t/innodb_replication_delay_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_replication_delay_basic.test
@@ -18,20 +18,41 @@ select @@global.innodb_replication_delay;
 select @@session.innodb_replication_delay;
 show global variables like 'innodb_replication_delay';
 show session variables like 'innodb_replication_delay';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_replication_delay';
 select * from information_schema.session_variables where variable_name='innodb_replication_delay';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_replication_delay=10;
 select @@global.innodb_replication_delay;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_replication_delay';
 select * from information_schema.session_variables where variable_name='innodb_replication_delay';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_replication_delay=1;
 
 #
+# check the default value 
+#
+set global innodb_replication_delay=DEFAULT;
+select @@global.innodb_replication_delay;
+
+#
+# valid values
+#
+
+set global innodb_replication_delay=0;
+select @@global.innodb_replication_delay;
+set global innodb_replication_delay=65535;
+select @@global.innodb_replication_delay;
+set global innodb_replication_delay=4294967295;
+select @@global.innodb_replication_delay;
+
+#
 # incorrect types
 #
 --error ER_WRONG_TYPE_FOR_VAR
@@ -40,10 +61,39 @@ set global innodb_replication_delay=1.1;
 set global innodb_replication_delay=1e1;
 --error ER_WRONG_TYPE_FOR_VAR
 set global innodb_replication_delay="foo";
-
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_replication_delay=' ';
+select @@global.innodb_replication_delay;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_replication_delay=" ";
+select @@global.innodb_replication_delay;
 set global innodb_replication_delay=-7;
 select @@global.innodb_replication_delay;
+set global innodb_replication_delay=-1024;
+select @@global.innodb_replication_delay;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_replication_delay';
+--enable_warnings
+
+#
+# Check for out of bounds
+#
+
+# With a 64 bit mysqld:18446744073709551615,with a 32 bit mysqld: 4294967295
+--disable_warnings
+SET @@global.innodb_replication_delay = 4294967296;
+--enable_warnings
+SELECT @@global.innodb_replication_delay IN (4294967296,4294967295);
+
+--disable_warnings
+SET @@global.innodb_replication_delay = 12345678901;
+--enable_warnings
+SELECT @@global.innodb_replication_delay IN (12345678901,4294967295);
+
+--disable_warnings
+SET @@global.innodb_replication_delay = 18446744073709551615;
+--enable_warnings
+SELECT @@global.innodb_replication_delay IN (18446744073709551615,4294967295);
 
 #
 # cleanup
diff --git a/mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test b/mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test
index 81025bb..2aee2e2 100644
--- a/mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_rollback_on_timeout_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_rollback_on_timeout);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_rollback_on_timeout, "ON", "OFF") = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_rollback_on_timeout';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_rollback_on_timeout);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_rollback_on_timeout';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test b/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test
index 9f0b70a..33223d4 100644
--- a/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_rollback_segments_basic.test
@@ -19,20 +19,24 @@ SELECT @@global.innodb_rollback_segments;
 SELECT @@session.innodb_rollback_segments;
 SHOW global variables LIKE 'innodb_rollback_segments';
 SHOW session variables LIKE 'innodb_rollback_segments';
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_rollback_segments';
 SELECT * FROM information_schema.session_variables 
 WHERE variable_name='innodb_rollback_segments';
+--enable_warnings
 
 #
 # show that it's writable
 #
 SET global innodb_rollback_segments=100;
 SELECT @@global.innodb_rollback_segments;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_rollback_segments';
 SELECT * FROM information_schema.session_variables 
 WHERE variable_name='innodb_rollback_segments';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 SET session innodb_rollback_segments=1;
 
@@ -47,8 +51,10 @@ SET global innodb_rollback_segments=1e1;
 SET global innodb_rollback_segments="foo";
 SET global innodb_rollback_segments=-7;
 SELECT @@global.innodb_rollback_segments;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_rollback_segments';
+--enable_warnings
 
 #
 # cleanup
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
index 920c992..49318c0 100644
--- 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
@@ -13,8 +13,10 @@ select @@global.innodb_sort_buffer_size;
 select @@session.innodb_sort_buffer_size;
 show global variables like 'innodb_sort_buffer_size';
 show session variables like 'innodb_sort_buffer_size';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's read-only
diff --git a/mysql-test/suite/sys_vars/t/innodb_spin_wait_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_spin_wait_delay_basic.test
index 8f2eee0..ab0b38b 100644
--- a/mysql-test/suite/sys_vars/t/innodb_spin_wait_delay_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_spin_wait_delay_basic.test
@@ -18,20 +18,40 @@ select @@global.innodb_spin_wait_delay;
 select @@session.innodb_spin_wait_delay;
 show global variables like 'innodb_spin_wait_delay';
 show session variables like 'innodb_spin_wait_delay';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay';
 select * from information_schema.session_variables where variable_name='innodb_spin_wait_delay';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_spin_wait_delay=10;
 select @@global.innodb_spin_wait_delay;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay';
 select * from information_schema.session_variables where variable_name='innodb_spin_wait_delay';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_spin_wait_delay=1;
 
 #
+# check the default value
+#
+set global innodb_spin_wait_delay=DEFAULT;
+select @@global.innodb_spin_wait_delay;
+
+#
+# valid values
+#
+set global innodb_spin_wait_delay=0;
+select @@global.innodb_spin_wait_delay;
+set global innodb_spin_wait_delay=65535;
+select @@global.innodb_spin_wait_delay;
+set global innodb_spin_wait_delay=4294967295;
+select @@global.innodb_spin_wait_delay;
+
+#
 # incorrect types
 #
 --error ER_WRONG_TYPE_FOR_VAR
@@ -40,10 +60,39 @@ set global innodb_spin_wait_delay=1.1;
 set global innodb_spin_wait_delay=1e1;
 --error ER_WRONG_TYPE_FOR_VAR
 set global innodb_spin_wait_delay="foo";
-
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_spin_wait_delay=' ';
+select @@global.innodb_spin_wait_delay;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_spin_wait_delay=" ";
+select @@global.innodb_spin_wait_delay;
 set global innodb_spin_wait_delay=-7;
 select @@global.innodb_spin_wait_delay;
+set global innodb_spin_wait_delay=-1024;
+select @@global.innodb_spin_wait_delay;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_spin_wait_delay';
+--enable_warnings
+
+#
+# Check for out of bounds
+#
+
+# With a 64 bit mysqld:18446744073709551615,with a 32 bit mysqld: 4294967295
+--disable_warnings
+SET @@global.innodb_spin_wait_delay = 4294967296;
+--enable_warnings
+SELECT @@global.innodb_spin_wait_delay IN (4294967296,4294967295);
+
+--disable_warnings
+SET @@global.innodb_spin_wait_delay = 12345678901;
+--enable_warnings
+SELECT @@global.innodb_spin_wait_delay IN (12345678901,4294967295);
+
+--disable_warnings
+SET @@global.innodb_spin_wait_delay = 18446744073709551615;
+--enable_warnings
+SELECT @@global.innodb_spin_wait_delay IN (18446744073709551615,4294967295);
 
 #
 # cleanup
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test
index f01574c..77288df 100644
--- a/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_method_basic.test
@@ -18,32 +18,40 @@ SELECT @@global.innodb_stats_method;
 SELECT @@session.innodb_stats_method;
 SHOW global variables LIKE 'innodb_stats_method';
 SHOW session variables LIKE 'innodb_stats_method';
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_stats_method';
 SELECT * FROM information_schema.session_variables 
 WHERE variable_name='innodb_stats_method';
+--enable_warnings
 
 #
 # show that it's writable
 #
 SET global innodb_stats_method='nulls_equal';
 SELECT @@global.innodb_stats_method;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_stats_method';
 SELECT * FROM information_schema.session_variables 
 WHERE variable_name='innodb_stats_method';
+--enable_warnings
 SET @@global.innodb_stats_method='nulls_unequal';
 SELECT @@global.innodb_stats_method;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_stats_method';
 SELECT * FROM information_schema.session_variables 
 WHERE variable_name='innodb_stats_method';
+--enable_warnings
 SET global innodb_stats_method=2;
 SELECT @@global.innodb_stats_method;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_stats_method';
 SELECT * FROM information_schema.session_variables 
 WHERE variable_name='innodb_stats_method';
+--enable_warnings
 
 --error ER_GLOBAL_VARIABLE
 SET session innodb_stats_method='nulls_equal';
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test
index 9028ee7..a0bccb5 100644
--- a/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test
@@ -18,28 +18,38 @@ select @@global.innodb_stats_on_metadata;
 select @@session.innodb_stats_on_metadata;
 show global variables like 'innodb_stats_on_metadata';
 show session variables like 'innodb_stats_on_metadata';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata';
 select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_stats_on_metadata='OFF';
 select @@global.innodb_stats_on_metadata;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata';
 select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata';
+--enable_warnings
 set @@global.innodb_stats_on_metadata=1;
 select @@global.innodb_stats_on_metadata;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata';
 select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata';
+--enable_warnings
 set global innodb_stats_on_metadata=0;
 select @@global.innodb_stats_on_metadata;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata';
 select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata';
+--enable_warnings
 set @@global.innodb_stats_on_metadata='ON';
 select @@global.innodb_stats_on_metadata;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata';
 select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_stats_on_metadata='OFF';
 --error ER_GLOBAL_VARIABLE
@@ -57,8 +67,10 @@ set global innodb_stats_on_metadata=2;
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_stats_on_metadata=-3;
 select @@global.innodb_stats_on_metadata;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata';
 select * from information_schema.session_variables where variable_name='innodb_stats_on_metadata';
+--enable_warnings
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_stats_on_metadata='AUTO';
 
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
index 4277b58..c5f9773 100644
--- a/mysql-test/suite/sys_vars/t/innodb_stats_persistent_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_persistent_basic.test
@@ -28,4 +28,4 @@ SET GLOBAL innodb_stats_persistent=123;
 SET GLOBAL innodb_stats_persistent='foo';
 
 # restore the environment
-SET GLOBAL innodb_stats_persistent=off;
+SET GLOBAL innodb_stats_persistent=OFF;
\ No newline at end of file
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
index cf223c0..5fc62f0 100644
--- 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
@@ -18,23 +18,45 @@ SELECT @@global.innodb_stats_persistent_sample_pages;
 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # 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 
+--disable_warnings
+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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 SET session innodb_stats_persistent_sample_pages=1;
 
+# 
+# show the default value
+#
+set global innodb_stats_persistent_sample_pages=DEFAULT;
+select @@global.innodb_stats_persistent_sample_pages;
+
+#
+# valid values
+#
+SET global innodb_stats_persistent_sample_pages=0;
+SELECT @@global.innodb_stats_persistent_sample_pages;
+
+SET global innodb_stats_persistent_sample_pages=10;
+SELECT @@global.innodb_stats_persistent_sample_pages;
+
+
+
+
 #
 # incorrect types
 #
@@ -44,11 +66,19 @@ SET global innodb_stats_persistent_sample_pages=1.1;
 SET global innodb_stats_persistent_sample_pages=1e1;
 --error ER_WRONG_TYPE_FOR_VAR
 SET global innodb_stats_persistent_sample_pages="foo";
-
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_persistent_sample_pages=' ';
+SELECT @@global.innodb_stats_persistent_sample_pages;
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_persistent_sample_pages=" ";
+SELECT @@global.innodb_stats_persistent_sample_pages;
 SET global innodb_stats_persistent_sample_pages=-7;
 SELECT @@global.innodb_stats_persistent_sample_pages;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_stats_persistent_sample_pages';
+--enable_warnings
+
 
 #
 # cleanup
diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_sample_pages_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_sample_pages_basic.test
index 2c91f11..0e4fcb5 100644
--- a/mysql-test/suite/sys_vars/t/innodb_stats_sample_pages_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_stats_sample_pages_basic.test
@@ -18,32 +18,52 @@ select @@global.innodb_stats_sample_pages;
 select @@session.innodb_stats_sample_pages;
 show global variables like 'innodb_stats_sample_pages';
 show session variables like 'innodb_stats_sample_pages';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages';
 select * from information_schema.session_variables where variable_name='innodb_stats_sample_pages';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_stats_sample_pages=10;
 select @@global.innodb_stats_sample_pages;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages';
 select * from information_schema.session_variables where variable_name='innodb_stats_sample_pages';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_stats_sample_pages=1;
 
+# 
+# show the default value
 #
-# incorrect types
+set global innodb_stats_sample_pages=DEFAULT;
+select @@global.innodb_stats_sample_pages;
+
+
 #
+# invalid values
+#
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_stats_sample_pages = 1.1;
 --error ER_WRONG_TYPE_FOR_VAR
-set global innodb_stats_sample_pages=1.1;
+set global innodb_stats_sample_pages = 1e1;
 --error ER_WRONG_TYPE_FOR_VAR
-set global innodb_stats_sample_pages=1e1;
+set global innodb_stats_sample_pages = "foo";
 --error ER_WRONG_TYPE_FOR_VAR
-set global innodb_stats_sample_pages="foo";
+set global innodb_stats_sample_pages=' ';
+select @@global.innodb_stats_sample_pages;
+--error ER_WRONG_TYPE_FOR_VAR
+set global innodb_stats_sample_pages=" ";
+select @@global.innodb_stats_sample_pages;
 
 set global innodb_stats_sample_pages=-7;
 select @@global.innodb_stats_sample_pages;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages';
+--enable_warnings
+
 
 #
 # cleanup
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
index ff3a50e..897d3de 100644
--- 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
@@ -18,20 +18,30 @@ SELECT @@global.innodb_stats_transient_sample_pages;
 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';
+--disable_warnings
 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';
+--enable_warnings
+
+#
+# show the default value
+#
+set global innodb_stats_transient_sample_pages=DEFAULT;
+select @@global.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;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 SET session innodb_stats_transient_sample_pages=1;
 
@@ -44,11 +54,15 @@ SET global innodb_stats_transient_sample_pages=1.1;
 SET global innodb_stats_transient_sample_pages=1e1;
 --error ER_WRONG_TYPE_FOR_VAR
 SET global innodb_stats_transient_sample_pages="foo";
+--error ER_WRONG_TYPE_FOR_VAR
+SET global innodb_stats_transient_sample_pages=' ';
 
 SET global innodb_stats_transient_sample_pages=-7;
 SELECT @@global.innodb_stats_transient_sample_pages;
+--disable_warnings
 SELECT * FROM information_schema.global_variables 
 WHERE variable_name='innodb_stats_transient_sample_pages';
+--enable_warnings
 
 #
 # cleanup
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
index 4459632..8e33b36 100644
--- a/mysql-test/suite/sys_vars/t/innodb_status_output_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_status_output_basic.test
@@ -13,28 +13,38 @@ select @@global.innodb_status_output;
 select @@session.innodb_status_output;
 show global variables like 'innodb_status_output';
 show session variables like 'innodb_status_output';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_status_output';
 select * from information_schema.session_variables where variable_name='innodb_status_output';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_status_output='OFF';
 select @@global.innodb_status_output;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_status_output';
 select * from information_schema.session_variables where variable_name='innodb_status_output';
+--enable_warnings
 set @@global.innodb_status_output=1;
 select @@global.innodb_status_output;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_status_output';
 select * from information_schema.session_variables where variable_name='innodb_status_output';
+--enable_warnings
 set global innodb_status_output=0;
 select @@global.innodb_status_output;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_status_output';
 select * from information_schema.session_variables where variable_name='innodb_status_output';
+--enable_warnings
 set @@global.innodb_status_output='ON';
 select @@global.innodb_status_output;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_status_output';
 select * from information_schema.session_variables where variable_name='innodb_status_output';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_status_output='OFF';
 --error ER_GLOBAL_VARIABLE
@@ -52,12 +62,16 @@ set global innodb_status_output=2;
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_status_output=-3;
 select @@global.innodb_status_output;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_status_output';
 select * from information_schema.session_variables where variable_name='innodb_status_output';
+--enable_warnings
 set global innodb_status_output=DEFAULT;
 select @@global.innodb_status_output;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_status_output';
 select * from information_schema.session_variables where variable_name='innodb_status_output';
+--enable_warnings
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_status_output='AUTO';
 
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
index 92c82b2..9f510c2 100644
--- 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
@@ -13,28 +13,38 @@ select @@global.innodb_status_output_locks;
 select @@session.innodb_status_output_locks;
 show global variables like 'innodb_status_output_locks';
 show session variables like 'innodb_status_output_locks';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_status_output_locks='OFF';
 select @@global.innodb_status_output_locks;
+--disable_warnings
 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';
+--enable_warnings
 set @@global.innodb_status_output_locks=1;
 select @@global.innodb_status_output_locks;
+--disable_warnings
 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';
+--enable_warnings
 set global innodb_status_output_locks=0;
 select @@global.innodb_status_output_locks;
+--disable_warnings
 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';
+--enable_warnings
 set @@global.innodb_status_output_locks='ON';
 select @@global.innodb_status_output_locks;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_status_output_locks='OFF';
 --error ER_GLOBAL_VARIABLE
@@ -52,12 +62,16 @@ 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;
+--disable_warnings
 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';
+--enable_warnings
 set global innodb_status_output_locks=DEFAULT;
 select @@global.innodb_status_output_locks;
+--disable_warnings
 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';
+--enable_warnings
 --error ER_WRONG_VALUE_FOR_VAR
 set global innodb_status_output_locks='AUTO';
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test b/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test
index 10f8d1c..243985f 100644
--- a/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test
@@ -18,8 +18,10 @@ select @@session.innodb_strict_mode in (0, 1);
 select @@session.innodb_strict_mode;
 show global variables like 'innodb_strict_mode';
 show session variables like 'innodb_strict_mode';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_strict_mode';
 select * from information_schema.session_variables where variable_name='innodb_strict_mode';
+--enable_warnings
 
 #
 # show that it's writable
@@ -28,26 +30,34 @@ set global innodb_strict_mode='OFF';
 set session innodb_strict_mode='OFF';
 select @@global.innodb_strict_mode;
 select @@session.innodb_strict_mode;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_strict_mode';
 select * from information_schema.session_variables where variable_name='innodb_strict_mode';
+--enable_warnings
 set @@global.innodb_strict_mode=1;
 set @@session.innodb_strict_mode=1;
 select @@global.innodb_strict_mode;
 select @@session.innodb_strict_mode;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_strict_mode';
 select * from information_schema.session_variables where variable_name='innodb_strict_mode';
+--enable_warnings
 set global innodb_strict_mode=0;
 set session innodb_strict_mode=0;
 select @@global.innodb_strict_mode;
 select @@session.innodb_strict_mode;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_strict_mode';
 select * from information_schema.session_variables where variable_name='innodb_strict_mode';
+--enable_warnings
 set @@global.innodb_strict_mode='ON';
 set @@session.innodb_strict_mode='ON';
 select @@global.innodb_strict_mode;
 select @@session.innodb_strict_mode;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_strict_mode';
 select * from information_schema.session_variables where variable_name='innodb_strict_mode';
+--enable_warnings
 
 #
 # incorrect types
@@ -74,8 +84,10 @@ set global innodb_strict_mode=-3;
 set session innodb_strict_mode=-7;
 select @@global.innodb_strict_mode;
 select @@session.innodb_strict_mode;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_strict_mode';
 select * from information_schema.session_variables where variable_name='innodb_strict_mode';
+--enable_warnings
 
 #
 # Cleanup
diff --git a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
index 988b8f0..6668d48 100644
--- a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test
@@ -127,7 +127,7 @@ SET @@session.innodb_support_xa = 
 # for global
 
 
---error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
 SET @@global.innodb_support_xa = -1;
 SELECT @@global.innodb_support_xa;
 
@@ -166,12 +166,16 @@ SELECT @@session.innodb_support_xa AS res_is_1;
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT IF(@@global.innodb_support_xa, "ON", "OFF") =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_support_xa';
+--enable_warnings
 SELECT @@global.innodb_support_xa;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_support_xa';
+--enable_warnings
 
 
 --echo '#----------------------FN_DYNVARS_046_07------------------------#'
@@ -179,12 +183,16 @@ SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 #     Check if the value in SESSION Table matches value in variable     #
 #########################################################################
 
+--disable_warnings
 SELECT IF(@@session.innodb_support_xa, "ON", "OFF") =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
   WHERE VARIABLE_NAME='innodb_support_xa';
+--enable_warnings
 SELECT @@session.innodb_support_xa;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
  WHERE VARIABLE_NAME='innodb_support_xa';
+--enable_warnings
 
 
 --echo '#---------------------FN_DYNVARS_046_08-------------------------#'
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
index 53011ac..39ff69a 100644
--- 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
@@ -2,11 +2,6 @@
 
 --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
@@ -14,12 +9,15 @@ 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';
+--disable_warnings
 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';
+--enable_warnings
 
 #
 # Show that it's read-only
diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_sync_debug_basic.test
new file mode 100644
index 0000000..665482e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_sync_debug_basic.test
@@ -0,0 +1,16 @@
+--echo #
+--echo # Basic test for innodb_sync_debug
+--echo #
+
+--source include/have_innodb.inc
+
+# The config variable is a debug read-only variable
+-- source include/have_debug.inc
+
+SELECT @@global.innodb_sync_debug;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global innodb_sync_debug = 1;
+
+SELECT @@global.innodb_sync_debug;
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic.test b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic.test
index 35460fe..138e877 100644
--- a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic.test
@@ -70,13 +70,35 @@ SELECT @@global.innodb_sync_spin_loops;
 SET @@global.innodb_sync_spin_loops = 0;
 SELECT @@global.innodb_sync_spin_loops;
 
-SET @@global.innodb_sync_spin_loops = 1;
+SET @@global.innodb_sync_spin_loops = 65535;
 SELECT @@global.innodb_sync_spin_loops;
-SET @@global.innodb_sync_spin_loops = 1000;
+
+SET @@global.innodb_sync_spin_loops = 4294967295;
 SELECT @@global.innodb_sync_spin_loops;
 
 --echo '#--------------------FN_DYNVARS_046_04-------------------------#'
 ###########################################################################
+#       Check the value of innodb_sync_spin_loops for out of bounds       #
+###########################################################################
+
+# With a 64 bit mysqld:18446744073709551615,with a 32 bit mysqld: 4294967295
+--disable_warnings
+SET @@global.innodb_sync_spin_loops = 4294967296;
+--enable_warnings
+SELECT @@global.innodb_sync_spin_loops IN (4294967296,4294967295);
+
+--disable_warnings
+SET @@global.innodb_sync_spin_loops = 12345678901;
+--enable_warnings
+SELECT @@global.innodb_sync_spin_loops IN (12345678901,4294967295);
+
+--disable_warnings
+SET @@global.innodb_sync_spin_loops = 18446744073709551615;
+--enable_warnings
+SELECT @@global.innodb_sync_spin_loops IN (18446744073709551615,4294967295);
+
+--echo '#--------------------FN_DYNVARS_046_05-------------------------#'
+###########################################################################
 #       Change the value of innodb_sync_spin_loops to invalid value       #
 ########################################################################### 
 
@@ -91,22 +113,38 @@ SELECT @@global.innodb_sync_spin_loops;
 SET @@global.innodb_sync_spin_loops = "Y";
 SELECT @@global.innodb_sync_spin_loops;
 
-SET @@global.innodb_sync_spin_loops = 1001;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_sync_spin_loops = 65535.01;
+SELECT @@global.innodb_sync_spin_loops;
+
+SET @@global.innodb_sync_spin_loops = -1024;
+SELECT @@global.innodb_sync_spin_loops;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_sync_spin_loops = " ";
+SELECT @@global.innodb_sync_spin_loops;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_sync_spin_loops = ' ';
 SELECT @@global.innodb_sync_spin_loops;
 
---echo '#----------------------FN_DYNVARS_046_05------------------------#'
+--echo '#----------------------FN_DYNVARS_046_06------------------------#'
 ######################################################################### 
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_sync_spin_loops =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_sync_spin_loops';
+--enable_warnings
 SELECT @@global.innodb_sync_spin_loops;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_sync_spin_loops';
+--enable_warnings
 
---echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+--echo '#---------------------FN_DYNVARS_046_07-------------------------#'
 ################################################################### 
 #        Check if ON and OFF values can be used on variable       #
 ###################################################################
@@ -119,7 +157,7 @@ SELECT @@global.innodb_sync_spin_loops;
 SET @@global.innodb_sync_spin_loops = ON;
 SELECT @@global.innodb_sync_spin_loops;
 
---echo '#---------------------FN_DYNVARS_046_07----------------------#'
+--echo '#---------------------FN_DYNVARS_046_08----------------------#'
 ###################################################################
 #      Check if TRUE and FALSE values can be used on variable     #
 ################################################################### 
diff --git a/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
index e7503bd..e3e4bda 100644
--- a/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test
@@ -106,7 +106,7 @@ SELECT @@global.innodb_table_locks;
 
 # for session
 
---error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
 SET @@session.innodb_table_locks = -6;
 --Error ER_WRONG_TYPE_FOR_VAR
 SET @@session.innodb_table_locks = 1.6;
@@ -128,7 +128,7 @@ SET @@session.innodb_table_locks = 
 # for global
 
 
---error ER_WRONG_VALUE_FOR_VAR
+--Error ER_WRONG_VALUE_FOR_VAR
 SET @@global.innodb_table_locks = -1;
 --Error ER_WRONG_VALUE_FOR_VAR
 SET @@global.innodb_table_locks = 2;
@@ -165,24 +165,32 @@ SELECT @@session.innodb_table_locks AS res_is_1;
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT IF(@@global.innodb_table_locks, "ON", "OFF") =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_table_locks';
+--enable_warnings
 SELECT @@global.innodb_table_locks;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_table_locks';
+--enable_warnings
 
 --echo '#----------------------FN_DYNVARS_046_07------------------------#'
 ######################################################################### 
 #     Check if the value in SESSION Table matches value in variable     #
 #########################################################################
 
+--disable_warnings
 SELECT IF(@@session.innodb_table_locks, "ON", "OFF") =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
   WHERE VARIABLE_NAME='innodb_table_locks';
+--enable_warnings
 SELECT @@session.innodb_table_locks;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
  WHERE VARIABLE_NAME='innodb_table_locks';
+--enable_warnings
 
 
 --echo '#---------------------FN_DYNVARS_046_08-------------------------#'
diff --git a/mysql-test/suite/sys_vars/t/innodb_table_locks_func.test b/mysql-test/suite/sys_vars/t/innodb_table_locks_func.test
index d69cacd..330addd 100644
--- a/mysql-test/suite/sys_vars/t/innodb_table_locks_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_table_locks_func.test
@@ -31,7 +31,9 @@ SET @start_value= @@global.innodb_table_locks;
 SELECT @start_value;
 
 SET @@global.innodb_table_locks = OFF;
+--echo 'connect (con1,localhost,root,,,,)'
 connect (con1,localhost,root,,,,);
+--echo 'connection con1'
 connection con1;
 SELECT @@global.innodb_table_locks;
 SELECT @@session.innodb_table_locks;
@@ -46,8 +48,10 @@ disconnect con1;
 #==============================================================================
 --echo '----check when innodb_table_locks = ON and autocommit = OFF---'
 #==============================================================================
+--echo 'connect (con2,localhost,root,,,,)'
 connect (con2,localhost,root,,,,);
 
+--echo 'connection default'
 connection default;
 
 --disable_warnings
@@ -62,14 +66,17 @@ BEGIN;
 INSERT INTO t1 VALUES(1);
 SELECT * FROM t1 FOR UPDATE;
 
+--echo 'CONNECTION con2'
 CONNECTION con2;
 SET @@innodb_table_locks = ON;
 SET @@autocommit = OFF;
 send LOCK TABLES t1 WRITE;
 
+--echo 'CONNECTION default'
 CONNECTION default;
 COMMIT;
 
+--echo 'CONNECTION con2'
 CONNECTION con2;
 reap;
 UNLOCK tables;
diff --git a/mysql-test/suite/sys_vars/t/innodb_temp_data_file_path_basic.test b/mysql-test/suite/sys_vars/t/innodb_temp_data_file_path_basic.test
new file mode 100644
index 0000000..607ee9b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_temp_data_file_path_basic.test
@@ -0,0 +1,106 @@
+
+
+################ mysql-test\t\innodb_temp_data_file_path_basic.test ############
+#                                                                             #
+# Variable Name: innodb_temp_data_file_path                                   #
+# Scope: Global                                                               #
+# Access Type: Static                                                         #
+# Data Type: filename                                                         #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2012-12-27                                                   #
+# Author : Krunal Bauskar                                                     #
+#                                                                             #
+#                                                                             #
+# Description:Test Cases of Dynamic System Variable innodb_temp_data_file_path#
+#             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                                               #
+#                                                                             #
+###############################################################################
+
+--source include/have_innodb.inc
+
+--echo '#---------------------BS_STVARS_024_01----------------------#'
+####################################################################
+#   Displaying default value                                       #
+####################################################################
+SELECT COUNT(@@GLOBAL.innodb_temp_data_file_path);
+--echo 1 Expected
+
+
+--echo '#---------------------BS_STVARS_024_02----------------------#'
+####################################################################
+#   Check if Value can set                                         #
+####################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_temp_data_file_path=1;
+--echo Expected error 'Read only variable'
+
+SELECT COUNT(@@GLOBAL.innodb_temp_data_file_path);
+--echo 1 Expected
+
+
+
+
+--echo '#---------------------BS_STVARS_024_03----------------------#'
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable  #
+#################################################################
+
+--disable_warnings
+SELECT @@GLOBAL.innodb_temp_data_file_path = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_temp_data_file_path';
+--enable_warnings
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_temp_data_file_path);
+--echo 1 Expected
+
+--disable_warnings
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_temp_data_file_path';
+--enable_warnings
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_024_04----------------------#'
+################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable  #
+################################################################################
+SELECT @@innodb_temp_data_file_path = @@GLOBAL.innodb_temp_data_file_path;
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_024_05----------------------#'
+################################################################################
+#Check if innodb_temp_data_file_path can be accessed with and without @@ sign  #
+################################################################################
+
+SELECT COUNT(@@innodb_temp_data_file_path);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_temp_data_file_path);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_temp_data_file_path);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_temp_data_file_path);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_temp_data_file_path = @@SESSION.innodb_temp_data_file_path;
+--echo Expected error 'Readonly variable'
+
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_thread_concurrency_basic.test b/mysql-test/suite/sys_vars/t/innodb_thread_concurrency_basic.test
index d30ec21..0be3254 100644
--- a/mysql-test/suite/sys_vars/t/innodb_thread_concurrency_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_thread_concurrency_basic.test
@@ -99,22 +99,35 @@ SELECT @@global.innodb_thread_concurrency;
 --Error ER_WRONG_TYPE_FOR_VAR
 SET @@global.innodb_thread_concurrency = "Y";
 SELECT @@global.innodb_thread_concurrency;
-
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_thread_concurrency = ' ';
+SELECT @@global.innodb_thread_concurrency;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_thread_concurrency = " ";
+SELECT @@global.innodb_thread_concurrency;
 
 SET @@global.innodb_thread_concurrency = 1001;
 SELECT @@global.innodb_thread_concurrency;
 
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_thread_concurrency = 255.01;
+SELECT @@global.innodb_thread_concurrency;
+
 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
 ######################################################################### 
 #     Check if the value in GLOBAL Table matches value in variable      #
 #########################################################################
 
+--disable_warnings
 SELECT @@global.innodb_thread_concurrency =
  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
   WHERE VARIABLE_NAME='innodb_thread_concurrency';
+--enable_warnings
 SELECT @@global.innodb_thread_concurrency;
+--disable_warnings
 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
  WHERE VARIABLE_NAME='innodb_thread_concurrency';
+--enable_warnings
 
 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
 ################################################################### 
diff --git a/mysql-test/suite/sys_vars/t/innodb_trx_purge_view_update_only_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_trx_purge_view_update_only_debug_basic.test
index d720751..04f406a 100644
--- a/mysql-test/suite/sys_vars/t/innodb_trx_purge_view_update_only_debug_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_trx_purge_view_update_only_debug_basic.test
@@ -13,20 +13,26 @@ select @@global.innodb_trx_purge_view_update_only_debug;
 select @@session.innodb_trx_purge_view_update_only_debug;
 show global variables like 'innodb_trx_purge_view_update_only_debug';
 show session variables like 'innodb_trx_purge_view_update_only_debug';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_trx_purge_view_update_only_debug';
 select * from information_schema.session_variables where variable_name='innodb_trx_purge_view_update_only_debug';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_trx_purge_view_update_only_debug=1;
 select @@global.innodb_trx_purge_view_update_only_debug;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_trx_purge_view_update_only_debug';
 select * from information_schema.session_variables where variable_name='innodb_trx_purge_view_update_only_debug';
+--enable_warnings
 set @@global.innodb_trx_purge_view_update_only_debug=0;
 select @@global.innodb_trx_purge_view_update_only_debug;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_trx_purge_view_update_only_debug';
 select * from information_schema.session_variables where variable_name='innodb_trx_purge_view_update_only_debug';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_trx_purge_view_update_only_debug='some';
 --error ER_GLOBAL_VARIABLE
diff --git a/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test
index d17917d..858e1b6 100644
--- a/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test
@@ -13,20 +13,26 @@ select @@global.innodb_trx_rseg_n_slots_debug;
 select @@session.innodb_trx_rseg_n_slots_debug;
 show global variables like 'innodb_trx_rseg_n_slots_debug';
 show session variables like 'innodb_trx_rseg_n_slots_debug';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug';
 select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug';
+--enable_warnings
 
 #
 # show that it's writable
 #
 set global innodb_trx_rseg_n_slots_debug=1;
 select @@global.innodb_trx_rseg_n_slots_debug;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug';
 select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug';
+--enable_warnings
 set @@global.innodb_trx_rseg_n_slots_debug=0;
 select @@global.innodb_trx_rseg_n_slots_debug;
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug';
 select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug';
+--enable_warnings
 --error ER_GLOBAL_VARIABLE
 set session innodb_trx_rseg_n_slots_debug='some';
 --error ER_GLOBAL_VARIABLE
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
index 583dbe6..0df071c 100644
--- a/mysql-test/suite/sys_vars/t/innodb_undo_directory_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_undo_directory_basic.test
@@ -21,8 +21,8 @@
 ####################################################################
 #   Display the default value                                      #
 ####################################################################
-SELECT @@GLOBAL.innodb_undo_directory;
---echo . Expected
+SELECT COUNT(@@GLOBAL.innodb_undo_directory);
+--echo 1 Expected
 
 
 ####################################################################
@@ -41,17 +41,21 @@ SELECT COUNT(@@GLOBAL.innodb_undo_directory);
 # Check if the value in GLOBAL table matches value in variable                 #
 ################################################################################
 
-SELECT VARIABLE_VALUE
+--disable_warnings
+SELECT @@GLOBAL.innodb_undo_directory = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_undo_directory';
---echo . Expected
+--enable_warnings
+--echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_undo_directory);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_undo_directory';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_undo_log_truncate_basic.test b/mysql-test/suite/sys_vars/t/innodb_undo_log_truncate_basic.test
new file mode 100644
index 0000000..b60f9be
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_undo_log_truncate_basic.test
@@ -0,0 +1,113 @@
+
+
+############### mysql-test\t\innodb_undo_log_truncate_basic.test ##############
+#                                                                             #
+# Variable Name: innodb_undo_log_truncate                                     #
+# Scope: Global                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: boolean                                                          #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author : Sharique Abdullah                                                  #
+#                                                                             #
+#                                                                             #
+# Description:Test Cases of Dynamic System Variable innodb_undo_log_truncate  #
+#             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                                               #
+#                                                                             #
+###############################################################################
+
+--source include/have_innodb.inc
+
+SET @start_global_value = @@global.innodb_undo_log_truncate;
+SELECT @start_global_value;
+
+
+--echo '#---------------------BS_STVARS_028_01----------------------#'
+####################################################################
+#   Displaying default value                                       #
+####################################################################
+SELECT COUNT(@@GLOBAL.innodb_undo_log_truncate);
+--echo 1 Expected
+
+
+--echo '#---------------------BS_STVARS_028_02----------------------#'
+####################################################################
+#   Check if Value can set                                         #
+####################################################################
+
+SET @@global.innodb_undo_log_truncate = 0;
+SELECT @@global.innodb_undo_log_truncate;
+
+SET @@global.innodb_undo_log_truncate ='On' ;
+SELECT @@global.innodb_undo_log_truncate;
+
+SET @@global.innodb_undo_log_truncate ='Off' ;
+SELECT @@global.innodb_undo_log_truncate;
+
+SET @@global.innodb_undo_log_truncate = 1;
+SELECT @@global.innodb_undo_log_truncate;
+
+--echo '#---------------------BS_STVARS_028_03----------------------#'
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable  #
+#################################################################
+
+--disable_warnings
+SELECT IF(@@GLOBAL.innodb_undo_log_truncate,'ON','OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_log_truncate';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_undo_log_truncate);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_undo_log_truncate';
+--echo 1 Expected
+--enable_warnings
+
+
+--echo '#---------------------BS_STVARS_028_04----------------------#'
+################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable  #
+################################################################################
+SELECT @@innodb_undo_log_truncate = @@GLOBAL.innodb_undo_log_truncate;
+--echo 1 Expected
+
+
+
+--echo '#---------------------BS_STVARS_028_05----------------------#'
+################################################################################
+#   Check if innodb_undo_log_truncate can be accessed with and without @@ sign     #
+################################################################################
+
+SELECT COUNT(@@innodb_undo_log_truncate);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_undo_log_truncate);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_undo_log_truncate);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_undo_log_truncate);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_undo_log_truncate = @@SESSION.innodb_undo_log_truncate;
+
+#
+# Cleanup
+#
+
+SET @@global.innodb_undo_log_truncate = @start_global_value;
+SELECT @@global.innodb_undo_log_truncate;
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
index 77b6af6..f83b5ed 100644
--- a/mysql-test/suite/sys_vars/t/innodb_undo_logs_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_undo_logs_basic.test
@@ -39,9 +39,11 @@ SELECT COUNT(@@GLOBAL.innodb_undo_logs);
 # Check if the value in GLOBAL table matches value in variable                 #
 ################################################################################
 
+--disable_warnings
 SELECT VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_undo_logs';
+--enable_warnings
 --echo 128 Expected
 
 
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
index 5339624..e1744b0 100644
--- a/mysql-test/suite/sys_vars/t/innodb_undo_tablespaces_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_undo_tablespaces_basic.test
@@ -18,11 +18,8 @@
 
 --source include/have_innodb.inc
 
-####################################################################
-#   Display default value                                          #
-####################################################################
-SELECT @@GLOBAL.innodb_undo_tablespaces;
---echo 0 Expected
+SELECT @@GLOBAL.innodb_undo_tablespaces >= 0;
+let $undo_tablespaces=`SELECT @@GLOBAL.innodb_undo_tablespaces`;
 
 
 ####################################################################
@@ -41,9 +38,13 @@ SELECT COUNT(@@GLOBAL.innodb_undo_tablespaces);
 # Check if the value in GLOBAL table matches value in variable                 #
 ################################################################################
 
-SELECT VARIABLE_VALUE
+--disable_warnings
+--disable_query_log
+eval SELECT VARIABLE_VALUE-$undo_tablespaces DIFFERENCE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_undo_tablespaces';
+--enable_query_log
+--enable_warnings
 --echo 0 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_use_native_aio_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_native_aio_basic.test
index 3787953..524b5a7 100644
--- a/mysql-test/suite/sys_vars/t/innodb_use_native_aio_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_use_native_aio_basic.test
@@ -52,17 +52,21 @@ SELECT COUNT(@@GLOBAL.innodb_use_native_aio);
 # Check if the value in GLOBAL Table matches value in variable  #
 #################################################################
 
+--disable_warnings
 SELECT IF(@@GLOBAL.innodb_use_native_aio, 'ON', 'OFF') = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_use_native_aio';
+--enable_warnings
 --echo 1 Expected
 
 SELECT COUNT(@@GLOBAL.innodb_use_native_aio);
 --echo 1 Expected
 
+--disable_warnings
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_use_native_aio';
+--enable_warnings
 --echo 1 Expected
 
 
diff --git a/mysql-test/suite/sys_vars/t/innodb_use_sys_malloc_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_sys_malloc_basic.test
deleted file mode 100644
index 699773f..0000000
--- a/mysql-test/suite/sys_vars/t/innodb_use_sys_malloc_basic.test
+++ /dev/null
@@ -1,31 +0,0 @@
-
-#
-#  2010-01-27 OBN - Added 
-#
-
---source include/have_innodb.inc
-
-# when running with valgring, mtr uses --innodb-use-sys-malloc=0,
-# while below we want to see the default value.
---source include/not_valgrind.inc
-
-#
-# show the global and session values;
-#
---echo Valid values are 'ON' and 'OFF' 
-select @@global.innodb_use_sys_malloc;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.innodb_use_sys_malloc;
-show global variables like 'innodb_use_sys_malloc';
-show session variables like 'innodb_use_sys_malloc';
-select * from information_schema.global_variables where variable_name='innodb_use_sys_malloc';
-select * from information_schema.session_variables where variable_name='innodb_use_sys_malloc';
-
-#
-# show that it's read-only
-#
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global innodb_use_sys_malloc=1;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set session innodb_use_sys_malloc=1;
-
diff --git a/mysql-test/suite/sys_vars/t/innodb_version_basic.test b/mysql-test/suite/sys_vars/t/innodb_version_basic.test
index 6ee2adf..1828410 100644
--- a/mysql-test/suite/sys_vars/t/innodb_version_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_version_basic.test
@@ -15,8 +15,10 @@ select @@global.innodb_version;
 select @@session.innodb_version;
 --echo show global variables like 'innodb_version' disabled so to not change with every version;
 --echo show session variables like 'innodb_version' disabled so to not change with every version;
+--disable_warnings
 select VARIABLE_VALUE=@@global.innodb_version from information_schema.global_variables where variable_name='innodb_version';
 select VARIABLE_VALUE=@@global.innodb_version from information_schema.session_variables where variable_name='innodb_version';
+--enable_warnings
 
 #
 # show that it's read-only
diff --git a/mysql-test/suite/sys_vars/t/innodb_write_io_threads_basic.test b/mysql-test/suite/sys_vars/t/innodb_write_io_threads_basic.test
index 8efa657..d9556af 100644
--- a/mysql-test/suite/sys_vars/t/innodb_write_io_threads_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_write_io_threads_basic.test
@@ -13,8 +13,10 @@ select @@global.innodb_write_io_threads;
 select @@session.innodb_write_io_threads;
 show global variables like 'innodb_write_io_threads';
 show session variables like 'innodb_write_io_threads';
+--disable_warnings
 select * from information_schema.global_variables where variable_name='innodb_write_io_threads';
 select * from information_schema.session_variables where variable_name='innodb_write_io_threads';
+--enable_warnings
 
 #
 # show that it's read-only
diff --git a/mysql-test/t/ctype_utf8mb4_innodb-master.opt b/mysql-test/t/ctype_utf8mb4_innodb-master.opt
index 96f0ce3..56d4032 100644
--- a/mysql-test/t/ctype_utf8mb4_innodb-master.opt
+++ b/mysql-test/t/ctype_utf8mb4_innodb-master.opt
@@ -1 +1,2 @@
 --default-storage-engine=MyISAM
+--loose-innodb-large-prefix=OFF
diff --git a/mysql-test/t/mysqlbinlog_row_minimal.test b/mysql-test/t/mysqlbinlog_row_minimal.test
index 9c31988..7909f75 100644
--- a/mysql-test/t/mysqlbinlog_row_minimal.test
+++ b/mysql-test/t/mysqlbinlog_row_minimal.test
@@ -27,7 +27,7 @@ DELETE FROM t2;
 
 FLUSH BINARY LOGS;
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---replace_regex /\d{6} *\d*:\d\d:\d\d/<date>/ /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
+--replace_regex /\d{6} *\d*:\d\d:\d\d/<date>/ /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /mapped to number \d*/mapped to number num/ /CRC32 0x[0-9a-f]+/CRC32 XXX/
 --exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog
 
 DROP TABLE t1,t2;
diff --git a/mysql-test/t/partition_exchange-master.opt b/mysql-test/t/partition_exchange-master.opt
new file mode 100644
index 0000000..5a0380b
--- /dev/null
+++ b/mysql-test/t/partition_exchange-master.opt
@@ -0,0 +1 @@
+--loose-innodb_default_row_format=COMPACT
diff --git a/mysql-test/t/partition_innodb-master.opt b/mysql-test/t/partition_innodb-master.opt
new file mode 100644
index 0000000..cf94b2d
--- /dev/null
+++ b/mysql-test/t/partition_innodb-master.opt
@@ -0,0 +1 @@
+--loose-innodb-large-prefix=OFF
diff --git a/mysql-test/thou_shalt_not_kill.pm b/mysql-test/thou_shalt_not_kill.pm
new file mode 100755
index 0000000..9a56276
--- /dev/null
+++ b/mysql-test/thou_shalt_not_kill.pm
@@ -0,0 +1,26 @@
+package thou_shalt_not_kill;
+require Exporter;
+ at ISA = 'Exporter';
+ at EXPORT_OK = 'kill';
+
+use subs 'kill';
+use Carp qw(cluck);
+
+sub import {
+  my $pkg = shift;
+  $pkg->export('CORE::GLOBAL', 'kill', @_);
+}
+
+sub kill {
+  return CORE::kill(@_) unless $_[0];
+  cluck "kill(@_)";
+  print "\e[1;31m" if -t STDOUT;
+  system "pstree -c $_" foreach @_[1..$#_];
+  print "\e[0;39m" if -t STDOUT;
+  print STDERR 'Kill [y/n] ? ';
+  my $answer=<STDIN>;
+  return CORE::kill(@_) if $answer =~ /y/i or $answer eq "\n";
+  1;
+}
+
+1;
diff --git a/sql/handler.h b/sql/handler.h
index cae95ea..75f8df9 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -573,7 +573,32 @@ struct xid_t {
   long bqual_length;
   char data[XIDDATASIZE];  // not \0-terminated !
 
-  xid_t() {}                                /* Remove gcc warning */  
+  xid_t() {}                                /* Remove gcc warning */
+  long get_format_id() const
+  { return formatID; }
+  void set_format_id(long v)
+  {
+    formatID= v;
+  }
+  long get_gtrid_length() const
+  { return gtrid_length; }
+  void set_gtrid_length(long v)
+  {
+    gtrid_length= v;
+  }
+  long get_bqual_length() const
+  { return bqual_length; }
+  void set_bqual_length(long v)
+  {
+    bqual_length= v;
+  }
+  const char* get_data() const
+  { return data; }
+  void set_data(const void* v, long l)
+  {
+    DBUG_ASSERT(l <= XIDDATASIZE);
+    memcpy(data, v, l);
+  }
   bool eq(struct xid_t *xid)
   { return !xid->is_null() && eq(xid->gtrid_length, xid->bqual_length, xid->data); }
   bool eq(long g, long b, const char *d)
@@ -586,6 +611,13 @@ struct xid_t {
     memcpy(data, g, gtrid_length= gl);
     memcpy(data+gl, b, bqual_length= bl);
   }
+  void reset()
+  {
+    formatID= -1;
+    gtrid_length= 0;
+    bqual_length= 0;
+    memset(data, 0, XIDDATASIZE);
+  }
   void set(ulonglong xid)
   {
     my_xid tmp;
@@ -3885,8 +3917,8 @@ class handler :public Sql_alloc
   TABLE_SHARE* get_table_share() { return table_share; }
 protected:
   /* deprecated, don't use in new engines */
-  inline void ha_statistic_increment(ulong SSV::*offset) const { }
-
+  // inline void ha_statistic_increment(ulong SSV::*offset) const { }
+  #define ha_statistic_increment(A)
   /* Service methods for use by storage engines. */
   void **ha_data(THD *) const;
   THD *ha_thd(void) const;
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 8c608e8..b835d6b 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -336,7 +336,16 @@ IF(MSVC)
   ADD_DEFINITIONS(-DHAVE_WINDOWS_MM_FENCE)
 ENDIF()
 
+SET(MUTEXTYPE "event" CACHE STRING "Mutex type: event, sys or futex")
 
+IF(MUTEXTYPE MATCHES "event")
+  ADD_DEFINITIONS(-DMUTEX_EVENT)
+ELSEIF(MUTEXTYPE MATCHES "futex" AND DEFINED HAVE_IB_LINUX_FUTEX)
+  ADD_DEFINITIONS(-DMUTEX_FUTEX)
+ELSE()
+   ADD_DEFINITIONS(-DMUTEX_SYS)
+ENDIF()
+ 
 # Include directories under innobase
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/innobase/include
 		    ${CMAKE_SOURCE_DIR}/storage/innobase/handler)
@@ -371,6 +380,7 @@ SET(INNOBASE_SOURCES
 	api/api0api.cc
 	api/api0misc.cc
 	btr/btr0btr.cc
+	btr/btr0bulk.cc
 	btr/btr0cur.cc
 	btr/btr0pcur.cc
 	btr/btr0scrub.cc
@@ -394,13 +404,16 @@ SET(INNOBASE_SOURCES
 	dict/dict0mem.cc
 	dict/dict0stats.cc
 	dict/dict0stats_bg.cc
-	dyn/dyn0dyn.cc
+#	dyn/dyn0dyn.cc
 	eval/eval0eval.cc
 	eval/eval0proc.cc
 	fil/fil0fil.cc
 	fil/fil0pagecompress.cc
 	fil/fil0crypt.cc
 	fsp/fsp0fsp.cc
+	fsp/fsp0file.cc
+	fsp/fsp0space.cc
+	fsp/fsp0sysspace.cc
 	fut/fut0fut.cc
 	fut/fut0lst.cc
 	ha/ha0ha.cc
@@ -412,27 +425,34 @@ SET(INNOBASE_SOURCES
 	fts/fts0config.cc
 	fts/fts0opt.cc
 	fts/fts0pars.cc
+	fts/fts0plugin.cc
 	fts/fts0que.cc
 	fts/fts0sql.cc
 	fts/fts0tlex.cc
+	gis/gis0geo.cc
+	gis/gis0rtree.cc
+	gis/gis0sea.cc
 	handler/ha_innodb.cc
+#	handler/ha_innopart.cc
 	handler/handler0alter.cc
 	handler/i_s.cc
 	ibuf/ibuf0ibuf.cc
 	lock/lock0iter.cc
 	lock/lock0lock.cc
+	lock/lock0prdt.cc
 	lock/lock0wait.cc
 	log/log0log.cc
 	log/log0recv.cc
 	log/log0crypt.cc
 	mach/mach0data.cc
 	mem/mem0mem.cc
-	mem/mem0pool.cc
+#	mem/mem0pool.cc
 	mtr/mtr0log.cc
 	mtr/mtr0mtr.cc
+	os/os0event.cc
 	os/os0file.cc
 	os/os0proc.cc
-	os/os0sync.cc
+#	os/os0sync.cc
 	os/os0thread.cc
 	page/page0cur.cc
 	page/page0page.cc
@@ -456,6 +476,7 @@ SET(INNOBASE_SOURCES
 	row/row0purge.cc
 	row/row0row.cc
 	row/row0sel.cc
+	row/row0trunc.cc
 	row/row0uins.cc
 	row/row0umod.cc
 	row/row0undo.cc
@@ -467,6 +488,7 @@ SET(INNOBASE_SOURCES
 	srv/srv0srv.cc
 	srv/srv0start.cc
 	sync/sync0arr.cc
+	sync/sync0debug.cc
 	sync/sync0rw.cc
 	sync/sync0sync.cc
 	trx/trx0i_s.cc
@@ -478,12 +500,13 @@ SET(INNOBASE_SOURCES
 	trx/trx0trx.cc
 	trx/trx0undo.cc
 	usr/usr0sess.cc
-	ut/ut0bh.cc
+#	ut/ut0bh.cc
 	ut/ut0byte.cc
 	ut/ut0crc32.cc
 	ut/ut0dbg.cc
 	ut/ut0list.cc
 	ut/ut0mem.cc
+	ut/ut0new.cc
 	ut/ut0rbt.cc
 	ut/ut0rnd.cc
 	ut/ut0ut.cc
@@ -515,7 +538,8 @@ ELSE()
 ENDIF()
 
 MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
-  MODULE_ONLY
-  MODULE_OUTPUT_NAME ha_innodb
+#  MODULE_ONLY
+#  MODULE_OUTPUT_NAME ha_innodb
+  DEFAULT RECOMPILE_FOR_EMBEDDED
   LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})
 
diff --git a/storage/innobase/Doxyfile b/storage/innobase/Doxyfile
deleted file mode 100644
index 7cf5048..0000000
--- a/storage/innobase/Doxyfile
+++ /dev/null
@@ -1,1419 +0,0 @@
-# Doxyfile 1.5.6
-
-# Usage: SVNVERSION=-r$(svnversion) doxygen
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-#       TAG = value [value, ...]
-# For lists items can also be appended using:
-#       TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME           = "InnoDB Plugin"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER         = 1.0$(SVNVERSION)
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY       = dox
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS         = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
-# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
-# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,
-# and Ukrainian.
-
-OUTPUT_LANGUAGE        = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC      = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF           = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF       =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC    = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB  = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES        = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH        =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH    =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES            = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF      = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF           = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member
-# documentation.
-
-DETAILS_AT_TOP         = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES  = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE               = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES                =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C  = YES
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA   = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN   = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT    = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT        = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT            = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT   = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC   = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING            = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT   = NO
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL            = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE        = YES
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC         = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS  = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES   = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS     = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES     = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS  = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS      = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS          = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES       = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES       = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO            = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS       = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES       = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST      = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST      = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST       = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS       =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES  = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES        = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES       = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES             = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.  This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES        = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER    =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET                  = YES
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS               = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED   = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC       = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT            = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE           =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT                  = . include/univ.i
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING         = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS          = *.c *.ic *.h
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE              = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE                =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS       = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS        =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH           =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS       =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE      = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH             =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.  If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER           =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.  Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.  The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS        =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES    = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER         = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES         = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS    = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION    = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.  Otherwise they will link to the documentstion.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS              = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS       = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX     = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX    = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX          =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML          = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT            = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION    = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER            =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER            =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET        =
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS     = YES
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP      = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-
-GENERATE_DOCSET        = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME        = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID       = org.doxygen.Project
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS  = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE               =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION           =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI           = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING     =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC             = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND             = NO
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX          = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE   = 4
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to FRAME, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature. Other possible values
-# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
-# and Class Hiererachy pages using a tree view instead of an ordered list;
-# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
-# disables this behavior completely. For backwards compatibility with previous
-# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
-# respectively.
-
-GENERATE_TREEVIEW      = NONE
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH         = 250
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE       = 10
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX         = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT           = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-
-LATEX_CMD_NAME         = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME     = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX          = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE             = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES         =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER           =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS         = YES
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX           = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE        = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES     = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF           = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT             = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF            = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS         = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE    =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE    =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN           = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT             = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION          = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT             = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA             =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD                =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD       = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX          = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.  This is useful
-# if you want to understand what is going on.  On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY         = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING   = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION        = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF     = YES
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES        = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH           =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS  =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED             = DOXYGEN UNIV_DEBUG UNIV_SYNC_DEBUG __attribute__()=
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED      = UT_LIST_BASE_NODE_T UT_LIST_NODE_T
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS   = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#   TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#   TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES               =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE       =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS           = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS        = NO
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS         = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH            =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS   = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT               = YES
-
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
-
-DOT_FONTNAME           = FreeSans
-
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
-
-DOT_FONTPATH           =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH            = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH    = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS           = NO
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK               = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS     = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH          = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH      = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH             = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH           = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY    = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH        = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT       = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH               =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS           =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES    = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH    = 3
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is enabled by default, which results in a transparent
-# background. Warning: Depending on the platform used, enabling this option
-# may lead to badly anti-aliased labels on the edges of a graph (i.e. they
-# become hard to read).
-
-DOT_TRANSPARENT        = YES
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS      = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND        = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP            = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE           = NO
diff --git a/storage/innobase/api/api0api.cc b/storage/innobase/api/api0api.cc
index 739ea9f..1f04b1b 100644
--- a/storage/innobase/api/api0api.cc
+++ b/storage/innobase/api/api0api.cc
@@ -24,15 +24,7 @@ InnoDB Native API
 3/20/2011 Jimmy Yang extracted from Embedded InnoDB
 *******************************************************/
 
-#include "univ.i"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include "ha_prototypes.h"
 
 #include "api0api.h"
 #include "api0misc.h"
@@ -50,11 +42,9 @@ InnoDB Native API
 #include "row0sel.h"
 #include "lock0lock.h"
 #include "rem0cmp.h"
-#include "ut0dbg.h"
 #include "dict0priv.h"
-#include "ut0ut.h"
-#include "ha_prototypes.h"
 #include "trx0roll.h"
+#include "row0trunc.h"
 
 /** configure variable for binlog option with InnoDB APIs */
 my_bool ib_binlog_enabled = FALSE;
@@ -212,15 +202,15 @@ operation, we only do it every INNOBASE_WAKE_INTERVAL'th step. */
 #define INNOBASE_WAKE_INTERVAL	32
 
 /*****************************************************************//**
-Check whether the Innodb persistent cursor is positioned.
- at return	IB_TRUE if positioned */
+Check whether the InnoDB persistent cursor is positioned.
+ at return IB_TRUE if positioned */
 UNIV_INLINE
 ib_bool_t
 ib_btr_cursor_is_positioned(
 /*========================*/
 	btr_pcur_t*	pcur)		/*!< in: InnoDB persistent cursor */
 {
-	return(pcur->old_stored == BTR_PCUR_OLD_STORED
+	return(pcur->old_stored
 	       && (pcur->pos_state == BTR_PCUR_IS_POSITIONED
 	           || pcur->pos_state == BTR_PCUR_WAS_POSITIONED));
 }
@@ -228,7 +218,7 @@ ib_btr_cursor_is_positioned(
 
 /********************************************************************//**
 Open a table using the table id, if found then increment table ref count.
- at return	table instance if found */
+ at return table instance if found */
 static
 dict_table_t*
 ib_open_table_by_id(
@@ -260,9 +250,9 @@ ib_open_table_by_id(
 
 /********************************************************************//**
 Open a table using the table name, if found then increment table ref count.
- at return	table instance if found */
-UNIV_INTERN
-void*
+ at return table instance if found */
+static
+dict_table_t*
 ib_open_table_by_name(
 /*==================*/
 	const char*	name)		/*!< in: table name to lookup */
@@ -281,7 +271,7 @@ ib_open_table_by_name(
 
 /********************************************************************//**
 Find table using table name.
- at return	table instance if found */
+ at return table instance if found */
 static
 dict_table_t*
 ib_lookup_table_by_name(
@@ -358,7 +348,7 @@ ib_read_tuple(
 			*len = offset_size;
 		}
 		ptr = *rec_buf;
-	}  else {
+	} else {
 		/* Make a copy of the rec. */
 		ptr = mem_heap_alloc(tuple->heap, offset_size);
 	}
@@ -392,13 +382,12 @@ ib_read_tuple(
 		/* Fetch and copy any externally stored column. */
 		if (rec_offs_nth_extern(offsets, i)) {
 
-			ulint	zip_size;
-
-			zip_size = dict_table_zip_size(index->table);
+			const page_size_t	page_size(
+				dict_table_page_size(index->table));
 
 			data = btr_rec_copy_externally_stored_field(
-				copy, offsets, zip_size, i, &len,
-				tuple->heap, NULL);
+				copy, offsets, page_size, i, &len,
+				tuple->heap);
 
 			ut_a(len != UNIV_SQL_NULL);
 		}
@@ -409,7 +398,7 @@ ib_read_tuple(
 
 /*****************************************************************//**
 Create an InnoDB key tuple.
- at return	tuple instance created, or NULL */
+ at return tuple instance created, or NULL */
 static
 ib_tpl_t
 ib_key_tuple_new_low(
@@ -462,7 +451,7 @@ ib_key_tuple_new_low(
 
 /*****************************************************************//**
 Create an InnoDB key tuple.
- at return	tuple instance created, or NULL */
+ at return tuple instance created, or NULL */
 static
 ib_tpl_t
 ib_key_tuple_new(
@@ -483,7 +472,7 @@ ib_key_tuple_new(
 
 /*****************************************************************//**
 Create an InnoDB row tuple.
- at return	tuple instance, or NULL */
+ at return tuple instance, or NULL */
 static
 ib_tpl_t
 ib_row_tuple_new_low(
@@ -515,7 +504,7 @@ ib_row_tuple_new_low(
 
 /*****************************************************************//**
 Create an InnoDB row tuple.
- at return	tuple instance, or NULL */
+ at return tuple instance, or NULL */
 static
 ib_tpl_t
 ib_row_tuple_new(
@@ -536,8 +525,7 @@ ib_row_tuple_new(
 
 /*****************************************************************//**
 Begin a transaction.
- at return	innobase txn handle */
-UNIV_INTERN
+ at return innobase txn handle */
 ib_err_t
 ib_trx_start(
 /*=========*/
@@ -558,7 +546,7 @@ ib_trx_start(
 	trx->api_auto_commit = auto_commit;
 	trx->read_write = read_write;
 
-	trx_start_if_not_started(trx);
+	trx_start_if_not_started(trx, read_write);
 
 	trx->isolation_level = ib_trx_level;
 
@@ -572,8 +560,7 @@ ib_trx_start(
 /*****************************************************************//**
 Begin a transaction. This will allocate a new transaction handle.
 put the transaction in the active state.
- at return	innobase txn handle */
-UNIV_INTERN
+ at return innobase txn handle */
 ib_trx_t
 ib_trx_begin(
 /*=========*/
@@ -595,11 +582,9 @@ ib_trx_begin(
 	return(static_cast<ib_trx_t>(trx));
 }
 
-
 /*****************************************************************//**
 Check if transaction is read_only
 @return transaction read_only status */
-UNIV_INTERN
 ib_u32_t
 ib_trx_read_only(
 /*=============*/
@@ -609,25 +594,9 @@ ib_trx_read_only(
 
 	return(trx->read_only);
 }
-
-/*****************************************************************//**
-Get the transaction's state.
- at return	transaction state */
-UNIV_INTERN
-ib_trx_state_t
-ib_trx_state(
-/*=========*/
-	ib_trx_t	ib_trx)		/*!< in: trx handle */
-{
-	trx_t*		trx = (trx_t*) ib_trx;
-
-	return((ib_trx_state_t) trx->state);
-}
-
 /*****************************************************************//**
 Get a trx start time.
- at return	trx start_time */
-UNIV_INTERN
+ at return trx start_time */
 ib_u64_t
 ib_trx_get_start_time(
 /*==================*/
@@ -638,8 +607,7 @@ ib_trx_get_start_time(
 }
 /*****************************************************************//**
 Release the resources of the transaction.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_trx_release(
 /*===========*/
@@ -656,17 +624,17 @@ ib_trx_release(
 /*****************************************************************//**
 Commit a transaction. This function will also release the schema
 latches too.
- at return	DB_SUCCESS or err code */
-
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_trx_commit(
 /*==========*/
 	ib_trx_t	ib_trx)		/*!< in: trx handle */
 {
 	ib_err_t	err = DB_SUCCESS;
-	trx_t*		trx = (trx_t*) ib_trx;
+	trx_t*		trx = reinterpret_cast<trx_t*>(ib_trx);
+
+	if (!trx_is_started(trx)) {
 
-	if (trx->state == TRX_STATE_NOT_STARTED) {
 		return(err);
 	}
 
@@ -678,8 +646,7 @@ ib_trx_commit(
 /*****************************************************************//**
 Rollback a transaction. This function will also release the schema
 latches too.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_trx_rollback(
 /*============*/
@@ -696,7 +663,7 @@ ib_trx_rollback(
 	return(err);
 }
 
-#ifdef __WIN__
+#ifdef _WIN32
 /*****************************************************************//**
 Convert a string to lower case. */
 static
@@ -710,7 +677,7 @@ ib_to_lower_case(
 		++ptr;
 	}
 }
-#endif /* __WIN__ */
+#endif /* _WIN32 */
 
 /*****************************************************************//**
 Normalizes a table name string. A normalized name consists of the
@@ -762,7 +729,7 @@ ib_normalize_table_name(
 			ut_strlen(name) + 1 - (db_name - name));
 
 		norm_name[table_name - db_name - 1] = '/';
-#ifdef __WIN__
+#ifdef _WIN32
 		ib_to_lower_case(norm_name);
 #endif
 	} else {
@@ -771,56 +738,8 @@ ib_normalize_table_name(
 }
 
 /*****************************************************************//**
-Check whether the table name conforms to our requirements. Currently
-we only do a simple check for the presence of a '/'.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
-ib_err_t
-ib_table_name_check(
-/*================*/
-	const char*	name)		/*!< in: table name to check */
-{
-	const char*	slash = NULL;
-	ulint		len = ut_strlen(name);
-
-	if (len < 2
-	    || *name == '/'
-	    || name[len - 1] == '/'
-	    || (name[0] == '.' && name[1] == '/')
-	    || (name[0] == '.' && name[1] == '.' && name[2] == '/')) {
-
-		return(DB_DATA_MISMATCH);
-	}
-
-	for ( ; *name; ++name) {
-#ifdef __WIN__
-		/* Check for reserved characters in DOS filenames. */
-		switch (*name) {
-		case ':':
-		case '|':
-		case '"':
-		case '*':
-		case '<':
-		case '>':
-			return(DB_DATA_MISMATCH);
-		}
-#endif /* __WIN__ */
-		if (*name == '/') {
-			if (slash) {
-				return(DB_DATA_MISMATCH);
-			}
-			slash = name;
-		}
-	}
-
-	return(slash ? DB_SUCCESS : DB_DATA_MISMATCH);
-}
-
-
-
-/*****************************************************************//**
 Get a table id. The caller must have acquired the dictionary mutex.
- at return	DB_SUCCESS if found */
+ at return DB_SUCCESS if found */
 static
 ib_err_t
 ib_table_get_id_low(
@@ -846,7 +765,7 @@ ib_table_get_id_low(
 
 /*****************************************************************//**
 Create an internal cursor instance.
- at return	DB_SUCCESS or err code */
+ at return DB_SUCCESS or err code */
 static
 ib_err_t
 ib_create_cursor(
@@ -918,7 +837,7 @@ ib_create_cursor(
 /*****************************************************************//**
 Create an internal cursor instance, and set prebuilt->index to index
 with supplied index_id.
- at return	DB_SUCCESS or err code */
+ at return DB_SUCCESS or err code */
 static
 ib_err_t
 ib_create_cursor_with_index_id(
@@ -943,8 +862,7 @@ ib_create_cursor_with_index_id(
 
 /*****************************************************************//**
 Open an InnoDB table and return a cursor handle to it.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_open_table_using_id(
 /*==========================*/
@@ -955,12 +873,10 @@ ib_cursor_open_table_using_id(
 {
 	ib_err_t	err;
 	dict_table_t*	table;
+	const ib_bool_t	locked
+		= ib_trx && ib_schema_lock_is_exclusive(ib_trx);
 
-	if (ib_trx == NULL || !ib_schema_lock_is_exclusive(ib_trx)) {
-		table = ib_open_table_by_id(table_id, FALSE);
-	} else {
-		table = ib_open_table_by_id(table_id, TRUE);
-	}
+	table = ib_open_table_by_id(table_id, locked);
 
 	if (table == NULL) {
 
@@ -974,58 +890,8 @@ ib_cursor_open_table_using_id(
 }
 
 /*****************************************************************//**
-Open an InnoDB index and return a cursor handle to it.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
-ib_err_t
-ib_cursor_open_index_using_id(
-/*==========================*/
-	ib_id_u64_t	index_id,	/*!< in: index id of index to open */
-	ib_trx_t	ib_trx,		/*!< in: Current transaction handle
-					can be NULL */
-	ib_crsr_t*	ib_crsr)	/*!< out: InnoDB cursor */
-{
-	ib_err_t	err;
-	dict_table_t*	table;
-	ulint		table_id = (ulint)( index_id >> 32);
-
-	if (ib_trx == NULL || !ib_schema_lock_is_exclusive(ib_trx)) {
-		table = ib_open_table_by_id(table_id, FALSE);
-	} else {
-		table = ib_open_table_by_id(table_id, TRUE);
-	}
-
-	if (table == NULL) {
-
-		return(DB_TABLE_NOT_FOUND);
-	}
-
-	/* We only return the lower 32 bits of the dulint. */
-	err = ib_create_cursor_with_index_id(
-		ib_crsr, table, index_id, (trx_t*) ib_trx);
-
-	if (ib_crsr != NULL) {
-		const ib_cursor_t*	cursor;
-
-		cursor = *(ib_cursor_t**) ib_crsr;
-
-		if (cursor->prebuilt->index == NULL) {
-			ib_err_t	crsr_err;
-
-			crsr_err = ib_cursor_close(*ib_crsr);
-			ut_a(crsr_err == DB_SUCCESS);
-
-			*ib_crsr = NULL;
-		}
-	}
-
-	return(err);
-}
-
-/*****************************************************************//**
 Open an InnoDB secondary index cursor and return a cursor handle to it.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_open_index_using_name(
 /*============================*/
@@ -1092,8 +958,7 @@ ib_cursor_open_index_using_name(
 
 /*****************************************************************//**
 Open an InnoDB table and return a cursor handle to it.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_open_table(
 /*=================*/
@@ -1106,22 +971,22 @@ ib_cursor_open_table(
 	dict_table_t*	table;
 	char*		normalized_name;
 
-	normalized_name = static_cast<char*>(mem_alloc(ut_strlen(name) + 1));
+	normalized_name = static_cast<char*>(ut_malloc_nokey(ut_strlen(name)
+							     + 1));
 	ib_normalize_table_name(normalized_name, name);
 
 	if (ib_trx != NULL) {
-	       if (!ib_schema_lock_is_exclusive(ib_trx)) {
-			table = (dict_table_t*)ib_open_table_by_name(
-				normalized_name);
+		if (!ib_schema_lock_is_exclusive(ib_trx)) {
+			table = ib_open_table_by_name(normalized_name);
 		} else {
 			/* NOTE: We do not acquire MySQL metadata lock */
 			table = ib_lookup_table_by_name(normalized_name);
 		}
 	} else {
-		table = (dict_table_t*)ib_open_table_by_name(normalized_name);
+		table = ib_open_table_by_name(normalized_name);
 	}
 
-	mem_free(normalized_name);
+	ut_free(normalized_name);
 	normalized_name = NULL;
 
 	/* It can happen that another thread has created the table but
@@ -1157,22 +1022,8 @@ ib_qry_proc_free(
 }
 
 /*****************************************************************//**
-set a cursor trx to NULL */
-UNIV_INTERN
-void
-ib_cursor_clear_trx(
-/*================*/
-	ib_crsr_t	ib_crsr)	/*!< in/out: InnoDB cursor */
-{
-	ib_cursor_t*	cursor = (ib_cursor_t*) ib_crsr;
-
-	cursor->prebuilt->trx = NULL;
-}
-
-/*****************************************************************//**
 Reset the cursor.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_reset(
 /*============*/
@@ -1198,7 +1049,7 @@ ib_cursor_reset(
 
 /*****************************************************************//**
 update the cursor with new transactions and also reset the cursor
- at return	DB_SUCCESS or err code */
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_new_trx(
 /*==============*/
@@ -1217,16 +1068,16 @@ ib_cursor_new_trx(
 
 	trx_assign_read_view(prebuilt->trx);
 
-        ib_qry_proc_free(&cursor->q_proc);
+	ib_qry_proc_free(&cursor->q_proc);
 
-        mem_heap_empty(cursor->query_heap);
+	mem_heap_empty(cursor->query_heap);
 
 	return(err);
 }
 
 /*****************************************************************//**
 Commit the transaction in a cursor
- at return	DB_SUCCESS or err code */
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_commit_trx(
 /*=================*/
@@ -1247,8 +1098,7 @@ ib_cursor_commit_trx(
 
 /*****************************************************************//**
 Close an InnoDB table and free the cursor.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_close(
 /*============*/
@@ -1285,8 +1135,7 @@ ib_cursor_close(
 
 /*****************************************************************//**
 Close the table, decrement n_ref_count count.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_close_table(
 /*==================*/
@@ -1303,7 +1152,7 @@ ib_cursor_close_table(
 }
 /**********************************************************************//**
 Run the insert query and do error handling.
- at return	DB_SUCCESS or error code */
+ at return DB_SUCCESS or error code */
 UNIV_INLINE
 ib_err_t
 ib_insert_row_with_lock_retry(
@@ -1344,7 +1193,7 @@ ib_insert_row_with_lock_retry(
 
 /*****************************************************************//**
 Write a row.
- at return	DB_SUCCESS or err code */
+ at return DB_SUCCESS or err code */
 static
 ib_err_t
 ib_execute_insert_query_graph(
@@ -1397,7 +1246,7 @@ ib_insert_query_graph_create(
 	ib_qry_node_t*	node = &q_proc->node;
 	trx_t*		trx = cursor->prebuilt->trx;
 
-	ut_a(trx->state != TRX_STATE_NOT_STARTED);
+	ut_a(trx_is_started(trx));
 
 	if (node->ins == NULL) {
 		dtuple_t*	row;
@@ -1426,8 +1275,7 @@ ib_insert_query_graph_create(
 
 /*****************************************************************//**
 Insert a row to a table.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_insert_row(
 /*=================*/
@@ -1507,7 +1355,7 @@ ib_cursor_insert_row(
 
 /*********************************************************************//**
 Gets pointer to a prebuilt update vector used in updates.
- at return	update vector */
+ at return update vector */
 UNIV_INLINE
 upd_t*
 ib_update_vector_create(
@@ -1521,7 +1369,7 @@ ib_update_vector_create(
 	ib_qry_grph_t*	grph = &q_proc->grph;
 	ib_qry_node_t*	node = &q_proc->node;
 
-	ut_a(trx->state != TRX_STATE_NOT_STARTED);
+	ut_a(trx_is_started(trx));
 
 	if (node->upd == NULL) {
 		node->upd = static_cast<upd_node_t*>(
@@ -1572,7 +1420,7 @@ ib_update_col(
 /**********************************************************************//**
 Checks which fields have changed in a row and stores the new data
 to an update vector.
- at return	DB_SUCCESS or err code */
+ at return DB_SUCCESS or err code */
 static
 ib_err_t
 ib_calc_diff(
@@ -1639,7 +1487,7 @@ ib_calc_diff(
 
 /**********************************************************************//**
 Run the update query and do error handling.
- at return	DB_SUCCESS or error code */
+ at return DB_SUCCESS or error code */
 UNIV_INLINE
 ib_err_t
 ib_update_row_with_lock_retry(
@@ -1687,7 +1535,7 @@ ib_update_row_with_lock_retry(
 
 /*********************************************************************//**
 Does an update or delete of a row.
- at return	DB_SUCCESS or err code */
+ at return DB_SUCCESS or err code */
 UNIV_INLINE
 ib_err_t
 ib_execute_update_query_graph(
@@ -1704,7 +1552,7 @@ ib_execute_update_query_graph(
 	ib_qry_proc_t*	q_proc = &cursor->q_proc;
 
 	/* The transaction must be running. */
-	ut_a(trx->state != TRX_STATE_NOT_STARTED);
+	ut_a(trx_is_started(trx));
 
 	node = q_proc->node.upd;
 
@@ -1755,8 +1603,7 @@ ib_execute_update_query_graph(
 
 /*****************************************************************//**
 Update a row in a table.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_update_row(
 /*=================*/
@@ -1773,9 +1620,9 @@ ib_cursor_update_row(
 	const ib_tuple_t*new_tuple = (const ib_tuple_t*) ib_new_tpl;
 
 	if (dict_index_is_clust(prebuilt->index)) {
-		pcur = &cursor->prebuilt->pcur;
+		pcur = cursor->prebuilt->pcur;
 	} else if (prebuilt->need_to_access_clustered) {
-		pcur = &cursor->prebuilt->clust_pcur;
+		pcur = cursor->prebuilt->clust_pcur;
 	} else {
 		return(DB_ERROR);
 	}
@@ -1801,7 +1648,7 @@ ib_cursor_update_row(
 
 /**********************************************************************//**
 Build the update query graph to delete a row from an index.
- at return	DB_SUCCESS or err code */
+ at return DB_SUCCESS or err code */
 static
 ib_err_t
 ib_delete_row(
@@ -1868,8 +1715,7 @@ ib_delete_row(
 
 /*****************************************************************//**
 Delete a row in a table.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_delete_row(
 /*=================*/
@@ -1886,12 +1732,12 @@ ib_cursor_delete_row(
 	/* Check whether this is a secondary index cursor */
 	if (index != prebuilt->index) {
 		if (prebuilt->need_to_access_clustered) {
-			pcur = &prebuilt->clust_pcur;
+			pcur = prebuilt->clust_pcur;
 		} else {
 			return(DB_ERROR);
 		}
 	} else {
-		pcur = &prebuilt->pcur;
+		pcur = prebuilt->pcur;
 	}
 
 	if (ib_btr_cursor_is_positioned(pcur)) {
@@ -1943,8 +1789,7 @@ ib_cursor_delete_row(
 
 /*****************************************************************//**
 Read current row.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_read_row(
 /*===============*/
@@ -1957,7 +1802,7 @@ ib_cursor_read_row(
 	ib_tuple_t*	tuple = (ib_tuple_t*) ib_tpl;
 	ib_cursor_t*	cursor = (ib_cursor_t*) ib_crsr;
 
-	ut_a(cursor->prebuilt->trx->state != TRX_STATE_NOT_STARTED);
+	ut_a(trx_is_started(cursor->prebuilt->trx));
 
 	/* When searching with IB_EXACT_MATCH set, row_search_for_mysql()
 	will not position the persistent cursor but will copy the record
@@ -1971,9 +1816,9 @@ ib_cursor_read_row(
 
 		if (prebuilt->need_to_access_clustered
 		    && tuple->type == TPL_TYPE_ROW) {
-			pcur = &prebuilt->clust_pcur;
+			pcur = prebuilt->clust_pcur;
 		} else {
-			pcur = &prebuilt->pcur;
+			pcur = prebuilt->pcur;
 		}
 
 		if (pcur == NULL) {
@@ -2015,7 +1860,7 @@ ib_cursor_read_row(
 
 /*****************************************************************//**
 Move cursor to the first record in the table.
- at return	DB_SUCCESS or err code */
+ at return DB_SUCCESS or err code */
 UNIV_INLINE
 ib_err_t
 ib_cursor_position(
@@ -2027,24 +1872,23 @@ ib_cursor_position(
 	row_prebuilt_t*	prebuilt = cursor->prebuilt;
 	unsigned char*	buf;
 
-	buf = static_cast<unsigned char*>(mem_alloc(UNIV_PAGE_SIZE));
+	buf = static_cast<unsigned char*>(ut_malloc_nokey(UNIV_PAGE_SIZE));
 
 	/* We want to position at one of the ends, row_search_for_mysql()
 	uses the search_tuple fields to work out what to do. */
 	dtuple_set_n_fields(prebuilt->search_tuple, 0);
 
 	err = static_cast<ib_err_t>(row_search_for_mysql(
-		buf, mode, prebuilt, 0, 0));
+		buf, static_cast<page_cur_mode_t>(mode), prebuilt, 0, 0));
 
-	mem_free(buf);
+	ut_free(buf);
 
 	return(err);
 }
 
 /*****************************************************************//**
 Move cursor to the first record in the table.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_first(
 /*============*/
@@ -2056,23 +1900,8 @@ ib_cursor_first(
 }
 
 /*****************************************************************//**
-Move cursor to the last record in the table.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
-ib_err_t
-ib_cursor_last(
-/*===========*/
-	ib_crsr_t	ib_crsr)	/*!< in: InnoDB cursor instance */
-{
-	ib_cursor_t*	cursor = (ib_cursor_t*) ib_crsr;
-
-	return(ib_cursor_position(cursor, IB_CUR_L));
-}
-
-/*****************************************************************//**
 Move cursor to the next user record in the table.
 @return DB_SUCCESS or err code */
-UNIV_INTERN
 ib_err_t
 ib_cursor_next(
 /*===========*/
@@ -2094,8 +1923,7 @@ ib_cursor_next(
 
 /*****************************************************************//**
 Search for key.
- at return	DB_SUCCESS or err code */
-UNIV_INTERN
+ at return DB_SUCCESS or err code */
 ib_err_t
 ib_cursor_moveto(
 /*=============*/
@@ -2133,19 +1961,19 @@ ib_cursor_moveto(
 
 	prebuilt->innodb_api_rec = NULL;
 
-	buf = static_cast<unsigned char*>(mem_alloc(UNIV_PAGE_SIZE));
+	buf = static_cast<unsigned char*>(ut_malloc_nokey(UNIV_PAGE_SIZE));
 
 	err = static_cast<ib_err_t>(row_search_for_mysql(
-		buf, ib_srch_mode, prebuilt, cursor->match_mode, 0));
+		buf, static_cast<page_cur_mode_t>(ib_srch_mode), prebuilt,
+		cursor->match_mode, 0));
 
-	mem_free(buf);
+	ut_free(buf);
 
 	return(err);
 }
 
 /*****************************************************************//**
 Set the cursor search mode. */
-UNIV_INTERN
 void
 ib_cursor_set_match_mode(
 /*=====================*/
@@ -2159,7 +1987,7 @@ ib_cursor_set_match_mode(
 
 /*****************************************************************//**
 Get the dfield instance for the column in the tuple.
- at return	dfield instance in tuple */
+ at return dfield instance in tuple */
 UNIV_INLINE
 dfield_t*
 ib_col_get_dfield(
@@ -2176,7 +2004,7 @@ ib_col_get_dfield(
 
 /*****************************************************************//**
 Predicate to check whether a column type contains variable length data.
- at return	DB_SUCCESS or error code */
+ at return DB_SUCCESS or error code */
 UNIV_INLINE
 ib_err_t
 ib_col_is_capped(
@@ -2189,14 +2017,14 @@ ib_col_is_capped(
 		|| dtype_get_mtype(dtype) == DATA_MYSQL
 		|| dtype_get_mtype(dtype) == DATA_VARMYSQL
 		|| dtype_get_mtype(dtype) == DATA_FIXBINARY
-		|| dtype_get_mtype(dtype) == DATA_BINARY)
+		|| dtype_get_mtype(dtype) == DATA_BINARY
+		|| dtype_get_mtype(dtype) == DATA_POINT)
 	       && dtype_get_len(dtype) > 0));
 }
 
 /*****************************************************************//**
 Set a column of the tuple. Make a copy using the tuple's heap.
- at return	DB_SUCCESS or error code */
-UNIV_INTERN
+ at return DB_SUCCESS or error code */
 ib_err_t
 ib_col_set_value(
 /*=============*/
@@ -2287,24 +2115,19 @@ ib_col_set_value(
 		ut_error;
 		break;
 
-	case DATA_CHAR: {
-		ulint	pad_char = ULINT_UNDEFINED;
-
-		pad_char = dtype_get_pad_char(
-			dtype_get_mtype(dtype),	dtype_get_prtype(dtype));
-
-		ut_a(pad_char != ULINT_UNDEFINED);
-
-		memset((byte*) dst + len,
-		       static_cast<int>(pad_char),
-			   static_cast<size_t>(col_len - len));
-
+	case DATA_CHAR:
 		memcpy(dst, src, len);
+		memset((byte*) dst + len, 0x20, col_len - len);
+		len = col_len;
+		break;
 
-		len = static_cast<ib_ulint_t>(col_len);
+	case DATA_POINT:
+		memcpy(dst, src, len);
 		break;
-	}
+
 	case DATA_BLOB:
+	case DATA_VAR_POINT:
+	case DATA_GEOMETRY:
 	case DATA_BINARY:
 	case DATA_DECIMAL:
 	case DATA_VARCHAR:
@@ -2403,8 +2226,7 @@ ib_col_set_value(
 
 /*****************************************************************//**
 Get the size of the data available in a column of the tuple.
- at return	bytes avail or IB_SQL_NULL */
-UNIV_INTERN
+ at return bytes avail or IB_SQL_NULL */
 ib_ulint_t
 ib_col_get_len(
 /*===========*/
@@ -2425,7 +2247,7 @@ ib_col_get_len(
 
 /*****************************************************************//**
 Copy a column value from the tuple.
- at return	bytes copied or IB_SQL_NULL */
+ at return bytes copied or IB_SQL_NULL */
 UNIV_INLINE
 ib_ulint_t
 ib_col_copy_value_low(
@@ -2452,7 +2274,7 @@ ib_col_copy_value_low(
 		switch (dtype_get_mtype(dfield_get_type(dfield))) {
 		case DATA_INT: {
 			ibool		usign;
-			ullint		ret;
+			uintmax_t	ret;
 
 			ut_a(data_len == len);
 
@@ -2521,8 +2343,7 @@ ib_col_copy_value_low(
 
 /*****************************************************************//**
 Copy a column value from the tuple.
- at return	bytes copied or IB_SQL_NULL */
-UNIV_INTERN
+ at return bytes copied or IB_SQL_NULL */
 ib_ulint_t
 ib_col_copy_value(
 /*==============*/
@@ -2536,7 +2357,7 @@ ib_col_copy_value(
 
 /*****************************************************************//**
 Get the InnoDB column attribute from the internal column precise type.
- at return	precise type in api format */
+ at return precise type in api format */
 UNIV_INLINE
 ib_col_attr_t
 ib_col_get_attr(
@@ -2558,8 +2379,7 @@ ib_col_get_attr(
 
 /*****************************************************************//**
 Get a column name from the tuple.
- at return	name of the column */
-UNIV_INTERN
+ at return name of the column */
 const char*
 ib_col_get_name(
 /*============*/
@@ -2579,8 +2399,7 @@ ib_col_get_name(
 
 /*****************************************************************//**
 Get an index field name from the cursor.
- at return	name of the field */
-UNIV_INTERN
+ at return name of the field */
 const char*
 ib_get_idx_field_name(
 /*==================*/
@@ -2604,7 +2423,7 @@ ib_get_idx_field_name(
 
 /*****************************************************************//**
 Get a column type, length and attributes from the tuple.
- at return	len of column data */
+ at return len of column data */
 UNIV_INLINE
 ib_ulint_t
 ib_col_get_meta_low(
@@ -2667,8 +2486,7 @@ ib_tuple_check_int(
 
 /*************************************************************//**
 Read a signed int 8 bit column from an InnoDB tuple.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_read_i8(
 /*=============*/
@@ -2689,8 +2507,7 @@ ib_tuple_read_i8(
 
 /*************************************************************//**
 Read an unsigned int 8 bit column from an InnoDB tuple.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_read_u8(
 /*=============*/
@@ -2711,8 +2528,7 @@ ib_tuple_read_u8(
 
 /*************************************************************//**
 Read a signed int 16 bit column from an InnoDB tuple.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_read_i16(
 /*==============*/
@@ -2733,8 +2549,7 @@ ib_tuple_read_i16(
 
 /*************************************************************//**
 Read an unsigned int 16 bit column from an InnoDB tuple.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_read_u16(
 /*==============*/
@@ -2755,8 +2570,7 @@ ib_tuple_read_u16(
 
 /*************************************************************//**
 Read a signed int 32 bit column from an InnoDB tuple.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_read_i32(
 /*==============*/
@@ -2777,8 +2591,7 @@ ib_tuple_read_i32(
 
 /*************************************************************//**
 Read an unsigned int 32 bit column from an InnoDB tuple.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_read_u32(
 /*==============*/
@@ -2799,8 +2612,7 @@ ib_tuple_read_u32(
 
 /*************************************************************//**
 Read a signed int 64 bit column from an InnoDB tuple.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_read_i64(
 /*==============*/
@@ -2821,8 +2633,7 @@ ib_tuple_read_i64(
 
 /*************************************************************//**
 Read an unsigned int 64 bit column from an InnoDB tuple.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_read_u64(
 /*==============*/
@@ -2843,8 +2654,7 @@ ib_tuple_read_u64(
 
 /*****************************************************************//**
 Get a column value pointer from the tuple.
- at return	NULL or pointer to buffer */
-UNIV_INTERN
+ at return NULL or pointer to buffer */
 const void*
 ib_col_get_value(
 /*=============*/
@@ -2866,8 +2676,7 @@ ib_col_get_value(
 
 /*****************************************************************//**
 Get a column type, length and attributes from the tuple.
- at return	len of column data */
-UNIV_INTERN
+ at return len of column data */
 ib_ulint_t
 ib_col_get_meta(
 /*============*/
@@ -2880,8 +2689,7 @@ ib_col_get_meta(
 
 /*****************************************************************//**
 "Clear" or reset an InnoDB tuple. We free the heap and recreate the tuple.
- at return	new tuple, or NULL */
-UNIV_INTERN
+ at return new tuple, or NULL */
 ib_tpl_t
 ib_tuple_clear(
 /*============*/
@@ -2909,8 +2717,7 @@ ib_tuple_clear(
 Create a new cluster key search tuple and copy the contents of  the
 secondary index key tuple columns that refer to the cluster index record
 to the cluster key. It does a deep copy of the column data.
- at return	DB_SUCCESS or error code */
-UNIV_INTERN
+ at return DB_SUCCESS or error code */
 ib_err_t
 ib_tuple_get_cluster_key(
 /*=====================*/
@@ -2982,64 +2789,8 @@ ib_tuple_get_cluster_key(
 }
 
 /*****************************************************************//**
-Copy the contents of  source tuple to destination tuple. The tuples
-must be of the same type and belong to the same table/index.
- at return	DB_SUCCESS or error code */
-UNIV_INTERN
-ib_err_t
-ib_tuple_copy(
-/*==========*/
-	ib_tpl_t	ib_dst_tpl,	/*!< in: destination tuple */
-	const ib_tpl_t	ib_src_tpl)	/*!< in: source tuple */
-{
-	ulint		i;
-	ulint		n_fields;
-	ib_err_t	err = DB_SUCCESS;
-	const ib_tuple_t*src_tuple = (const ib_tuple_t*) ib_src_tpl;
-	ib_tuple_t*	dst_tuple = (ib_tuple_t*) ib_dst_tpl;
-
-	/* Make sure src and dst are not the same. */
-	ut_a(src_tuple != dst_tuple);
-
-	/* Make sure they are the same type and refer to the same index. */
-	if (src_tuple->type != dst_tuple->type
-	   || src_tuple->index != dst_tuple->index) {
-
-		return(DB_DATA_MISMATCH);
-	}
-
-	n_fields = dtuple_get_n_fields(src_tuple->ptr);
-	ut_ad(n_fields == dtuple_get_n_fields(dst_tuple->ptr));
-
-	/* Do a deep copy of the data fields. */
-	for (i = 0; i < n_fields; ++i) {
-		dfield_t*	src_field;
-		dfield_t*	dst_field;
-
-		src_field = dtuple_get_nth_field(src_tuple->ptr, i);
-		dst_field = dtuple_get_nth_field(dst_tuple->ptr, i);
-
-		if (!dfield_is_null(src_field)) {
-			UNIV_MEM_ASSERT_RW(src_field->data, src_field->len);
-
-			dst_field->data = mem_heap_dup(
-				dst_tuple->heap,
-				src_field->data,
-				src_field->len);
-
-			dst_field->len = src_field->len;
-		} else {
-			dfield_set_null(dst_field);
-		}
-	}
-
-	return(err);
-}
-
-/*****************************************************************//**
 Create an InnoDB tuple used for index/table search.
- at return	own: Tuple for current index */
-UNIV_INTERN
+ at return own: Tuple for current index */
 ib_tpl_t
 ib_sec_search_tuple_create(
 /*=======================*/
@@ -3055,8 +2806,7 @@ ib_sec_search_tuple_create(
 
 /*****************************************************************//**
 Create an InnoDB tuple used for index/table search.
- at return	own: Tuple for current index */
-UNIV_INTERN
+ at return own: Tuple for current index */
 ib_tpl_t
 ib_sec_read_tuple_create(
 /*=====================*/
@@ -3072,8 +2822,7 @@ ib_sec_read_tuple_create(
 
 /*****************************************************************//**
 Create an InnoDB tuple used for table key operations.
- at return	own: Tuple for current table */
-UNIV_INTERN
+ at return own: Tuple for current table */
 ib_tpl_t
 ib_clust_search_tuple_create(
 /*=========================*/
@@ -3091,8 +2840,7 @@ ib_clust_search_tuple_create(
 
 /*****************************************************************//**
 Create an InnoDB tuple for table row operations.
- at return	own: Tuple for current table */
-UNIV_INTERN
+ at return own: Tuple for current table */
 ib_tpl_t
 ib_clust_read_tuple_create(
 /*=======================*/
@@ -3110,8 +2858,7 @@ ib_clust_read_tuple_create(
 
 /*****************************************************************//**
 Return the number of user columns in the tuple definition.
- at return	number of user columns */
-UNIV_INTERN
+ at return number of user columns */
 ib_ulint_t
 ib_tuple_get_n_user_cols(
 /*=====================*/
@@ -3130,8 +2877,7 @@ ib_tuple_get_n_user_cols(
 
 /*****************************************************************//**
 Return the number of columns in the tuple definition.
- at return	number of columns */
-UNIV_INTERN
+ at return number of columns */
 ib_ulint_t
 ib_tuple_get_n_cols(
 /*================*/
@@ -3144,7 +2890,6 @@ ib_tuple_get_n_cols(
 
 /*****************************************************************//**
 Destroy an InnoDB tuple. */
-UNIV_INTERN
 void
 ib_tuple_delete(
 /*============*/
@@ -3161,8 +2906,7 @@ ib_tuple_delete(
 
 /*****************************************************************//**
 Get a table id. This function will acquire the dictionary mutex.
- at return	DB_SUCCESS if found */
-UNIV_INTERN
+ at return DB_SUCCESS if found */
 ib_err_t
 ib_table_get_id(
 /*============*/
@@ -3181,62 +2925,8 @@ ib_table_get_id(
 }
 
 /*****************************************************************//**
-Get an index id.
- at return	DB_SUCCESS if found */
-UNIV_INTERN
-ib_err_t
-ib_index_get_id(
-/*============*/
-	const char*	table_name,	/*!< in: find index for this table */
-	const char*	index_name,	/*!< in: index to find */
-	ib_id_u64_t*	index_id)	/*!< out: index id if found */
-{
-	dict_table_t*	table;
-	char*		normalized_name;
-	ib_err_t	err = DB_TABLE_NOT_FOUND;
-
-	*index_id = 0;
-
-	normalized_name = static_cast<char*>(
-		mem_alloc(ut_strlen(table_name) + 1));
-	ib_normalize_table_name(normalized_name, table_name);
-
-	table = ib_lookup_table_by_name(normalized_name);
-
-	mem_free(normalized_name);
-	normalized_name = NULL;
-
-	if (table != NULL) {
-		dict_index_t*	index;
-
-		index = dict_table_get_index_on_name(table, index_name);
-
-		if (index != NULL) {
-			/* We only support 32 bit table and index ids. Because
-			we need to pack the table id into the index id. */
-
-			*index_id = (table->id);
-			*index_id <<= 32;
-			*index_id |= (index->id);
-
-			err = DB_SUCCESS;
-		}
-	}
-
-	return(err);
-}
-
-#ifdef __WIN__
-#define SRV_PATH_SEPARATOR      '\\'
-#else
-#define SRV_PATH_SEPARATOR      '/'
-#endif
-
-
-/*****************************************************************//**
 Check if cursor is positioned.
- at return	IB_TRUE if positioned */
-UNIV_INTERN
+ at return IB_TRUE if positioned */
 ib_bool_t
 ib_cursor_is_positioned(
 /*====================*/
@@ -3245,14 +2935,13 @@ ib_cursor_is_positioned(
 	const ib_cursor_t*	cursor = (const ib_cursor_t*) ib_crsr;
 	row_prebuilt_t*		prebuilt = cursor->prebuilt;
 
-	return(ib_btr_cursor_is_positioned(&prebuilt->pcur));
+	return(ib_btr_cursor_is_positioned(prebuilt->pcur));
 }
 
 
 /*****************************************************************//**
 Checks if the data dictionary is latched in exclusive mode.
- at return	TRUE if exclusive latch */
-UNIV_INTERN
+ at return TRUE if exclusive latch */
 ib_bool_t
 ib_schema_lock_is_exclusive(
 /*========================*/
@@ -3265,8 +2954,7 @@ ib_schema_lock_is_exclusive(
 
 /*****************************************************************//**
 Checks if the data dictionary is latched in shared mode.
- at return	TRUE if shared latch */
-UNIV_INTERN
+ at return TRUE if shared latch */
 ib_bool_t
 ib_schema_lock_is_shared(
 /*=====================*/
@@ -3279,8 +2967,7 @@ ib_schema_lock_is_shared(
 
 /*****************************************************************//**
 Set the Lock an InnoDB cursor/table.
- at return	DB_SUCCESS or error code */
-UNIV_INTERN
+ at return DB_SUCCESS or error code */
 ib_err_t
 ib_cursor_lock(
 /*===========*/
@@ -3298,8 +2985,7 @@ ib_cursor_lock(
 
 /*****************************************************************//**
 Set the Lock an InnoDB table using the table id.
- at return	DB_SUCCESS or error code */
-UNIV_INTERN
+ at return DB_SUCCESS or error code */
 ib_err_t
 ib_table_lock(
 /*==========*/
@@ -3314,7 +3000,7 @@ ib_table_lock(
 	ib_qry_proc_t	q_proc;
 	trx_t*		trx = (trx_t*) ib_trx;
 
-	ut_a(trx->state != TRX_STATE_NOT_STARTED);
+	ut_ad(trx_is_started(trx));
 
 	table = ib_open_table_by_id(table_id, FALSE);
 
@@ -3348,8 +3034,7 @@ ib_table_lock(
 
 /*****************************************************************//**
 Unlock an InnoDB table.
- at return	DB_SUCCESS or error code */
-UNIV_INTERN
+ at return DB_SUCCESS or error code */
 ib_err_t
 ib_cursor_unlock(
 /*=============*/
@@ -3370,8 +3055,7 @@ ib_cursor_unlock(
 
 /*****************************************************************//**
 Set the Lock mode of the cursor.
- at return	DB_SUCCESS or error code */
-UNIV_INTERN
+ at return DB_SUCCESS or error code */
 ib_err_t
 ib_cursor_set_lock_mode(
 /*====================*/
@@ -3391,8 +3075,8 @@ ib_cursor_set_lock_mode(
 	}
 
 	if (err == DB_SUCCESS) {
-		prebuilt->select_lock_type = (enum lock_mode) ib_lck_mode;
-		ut_a(prebuilt->trx->state != TRX_STATE_NOT_STARTED);
+		prebuilt->select_lock_type = (lock_mode) ib_lck_mode;
+		ut_a(trx_is_started(prebuilt->trx));
 	}
 
 	return(err);
@@ -3400,7 +3084,6 @@ ib_cursor_set_lock_mode(
 
 /*****************************************************************//**
 Set need to access clustered index record. */
-UNIV_INTERN
 void
 ib_cursor_set_cluster_access(
 /*=========================*/
@@ -3413,128 +3096,7 @@ ib_cursor_set_cluster_access(
 }
 
 /*****************************************************************//**
-Write an integer value to a column. Integers are stored in big-endian
-format and will need to be converted from the host format.
- at return	DB_SUCESS or error */
-UNIV_INTERN
-ib_err_t
-ib_tuple_write_i8(
-/*==============*/
-	ib_tpl_t	ib_tpl,		/*!< in/out: tuple to write to */
-	int		col_no,		/*!< in: column number */
-	ib_i8_t		val)		/*!< in: value to write */
-{
-	return(ib_col_set_value(ib_tpl, col_no, &val, sizeof(val), true));
-}
-
-/*****************************************************************//**
-Write an integer value to a column. Integers are stored in big-endian
-format and will need to be converted from the host format.
- at return	DB_SUCESS or error */
-UNIV_INTERN
-ib_err_t
-ib_tuple_write_i16(
-/*===============*/
-	ib_tpl_t	ib_tpl,		/*!< in/out: tuple to write to */
-	int		col_no,		/*!< in: column number */
-	ib_i16_t	val)		/*!< in: value to write */
-{
-	return(ib_col_set_value(ib_tpl, col_no, &val, sizeof(val), true));
-}
-
-/*****************************************************************//**
-Write an integer value to a column. Integers are stored in big-endian
-format and will need to be converted from the host format.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
-ib_err_t
-ib_tuple_write_i32(
-/*===============*/
-	ib_tpl_t	ib_tpl,		/*!< in/out: tuple to write to */
-	int		col_no,		/*!< in: column number */
-	ib_i32_t	val)		/*!< in: value to write */
-{
-	return(ib_col_set_value(ib_tpl, col_no, &val, sizeof(val), true));
-}
-
-/*****************************************************************//**
-Write an integer value to a column. Integers are stored in big-endian
-format and will need to be converted from the host format.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
-ib_err_t
-ib_tuple_write_i64(
-/*===============*/
-	ib_tpl_t	ib_tpl,		/*!< in/out: tuple to write to */
-	int		col_no,		/*!< in: column number */
-	ib_i64_t	val)		/*!< in: value to write */
-{
-	return(ib_col_set_value(ib_tpl, col_no, &val, sizeof(val), true));
-}
-
-/*****************************************************************//**
-Write an integer value to a column. Integers are stored in big-endian
-format and will need to be converted from the host format.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
-ib_err_t
-ib_tuple_write_u8(
-/*==============*/
-	ib_tpl_t	ib_tpl,		/*!< in/out: tuple to write to */
-	int		col_no,		/*!< in: column number */
-	ib_u8_t		val)		/*!< in: value to write */
-{
-	return(ib_col_set_value(ib_tpl, col_no, &val, sizeof(val), true));
-}
-
-/*****************************************************************//**
-Write an integer value to a column. Integers are stored in big-endian
-format and will need to be converted from the host format.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
-ib_err_t
-ib_tuple_write_u16(
-/*===============*/
-	ib_tpl_t	ib_tpl,		/*!< in/out: tupe to write to */
-	int		col_no,		/*!< in: column number */
-	ib_u16_t	val)		/*!< in: value to write */
-{
-	return(ib_col_set_value(ib_tpl, col_no, &val, sizeof(val), true));
-}
-
-/*****************************************************************//**
-Write an integer value to a column. Integers are stored in big-endian
-format and will need to be converted from the host format.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
-ib_err_t
-ib_tuple_write_u32(
-/*===============*/
-	ib_tpl_t	ib_tpl,		/*!< in/out: tuple to write to */
-	int		col_no,		/*!< in: column number */
-	ib_u32_t	val)		/*!< in: value to write */
-{
-	return(ib_col_set_value(ib_tpl, col_no, &val, sizeof(val), true));
-}
-
-/*****************************************************************//**
-Write an integer value to a column. Integers are stored in big-endian
-format and will need to be converted from the host format.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
-ib_err_t
-ib_tuple_write_u64(
-/*===============*/
-	ib_tpl_t	ib_tpl,		/*!< in/out: tuple to write to */
-	int		col_no,		/*!< in: column number */
-	ib_u64_t	val)		/*!< in: value to write */
-{
-	return(ib_col_set_value(ib_tpl, col_no, &val, sizeof(val), true));
-}
-
-/*****************************************************************//**
 Inform the cursor that it's the start of an SQL statement. */
-UNIV_INTERN
 void
 ib_cursor_stmt_begin(
 /*=================*/
@@ -3547,8 +3109,7 @@ ib_cursor_stmt_begin(
 
 /*****************************************************************//**
 Write a double value to a column.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_write_double(
 /*==================*/
@@ -3571,8 +3132,7 @@ ib_tuple_write_double(
 
 /*************************************************************//**
 Read a double column value from an InnoDB tuple.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_read_double(
 /*=================*/
@@ -3598,8 +3158,7 @@ ib_tuple_read_double(
 
 /*****************************************************************//**
 Write a float value to a column.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_write_float(
 /*=================*/
@@ -3622,8 +3181,7 @@ ib_tuple_write_float(
 
 /*************************************************************//**
 Read a float value from an InnoDB tuple.
- at return	DB_SUCCESS or error */
-UNIV_INTERN
+ at return DB_SUCCESS or error */
 ib_err_t
 ib_tuple_read_float(
 /*================*/
@@ -3651,7 +3209,6 @@ ib_tuple_read_float(
 Truncate a table. The cursor handle will be closed and set to NULL
 on success.
 @return DB_SUCCESS or error code */
-UNIV_INTERN
 ib_err_t
 ib_cursor_truncate(
 /*===============*/
@@ -3704,7 +3261,6 @@ ib_cursor_truncate(
 /*****************************************************************//**
 Truncate a table.
 @return DB_SUCCESS or error code */
-UNIV_INTERN
 ib_err_t
 ib_table_truncate(
 /*==============*/
@@ -3755,8 +3311,7 @@ ib_table_truncate(
 	}
 
 	if (trunc_err == DB_SUCCESS) {
-		ut_a(ib_trx_state(ib_trx) == static_cast<ib_trx_state_t>(
-			TRX_STATE_NOT_STARTED));
+		ut_a(!trx_is_started(static_cast<trx_t*>(ib_trx)));
 	} else {
 		err = ib_trx_rollback(ib_trx);
 		ut_a(err == DB_SUCCESS);
@@ -3778,35 +3333,18 @@ ib_table_truncate(
 }
 
 /*****************************************************************//**
-Frees a possible InnoDB trx object associated with the current THD.
- at return 0 or error number */
-UNIV_INTERN
-ib_err_t
-ib_close_thd(
-/*=========*/
-	void*		thd)	/*!< in: handle to the MySQL thread of the user
-				whose resources should be free'd */
-{
-	innobase_close_thd(static_cast<THD*>(thd));
-
-	return(DB_SUCCESS);
-}
-
-/*****************************************************************//**
 Return isolation configuration set by "innodb_api_trx_level"
 @return trx isolation level*/
-UNIV_INTERN
-ib_trx_state_t
+ib_trx_level_t
 ib_cfg_trx_level()
 /*==============*/
 {
-	return(static_cast<ib_trx_state_t>(ib_trx_level_setting));
+	return(static_cast<ib_trx_level_t>(ib_trx_level_setting));
 }
 
 /*****************************************************************//**
 Return configure value for background commit interval (in seconds)
 @return background commit interval (in seconds) */
-UNIV_INTERN
 ib_ulint_t
 ib_cfg_bk_commit_interval()
 /*=======================*/
@@ -3817,7 +3355,6 @@ ib_cfg_bk_commit_interval()
 /*****************************************************************//**
 Get generic configure status
 @return configure status*/
-UNIV_INTERN
 int
 ib_cfg_get_cfg()
 /*============*/
@@ -3838,10 +3375,21 @@ ib_cfg_get_cfg()
 }
 
 /*****************************************************************//**
+Wrapper of ut_strerr() which converts an InnoDB error number to a
+human readable text message.
+ at return string, describing the error */
+const char*
+ib_ut_strerr(
+/*=========*/
+	ib_err_t	num)	/*!< in: error number */
+{
+	return(ut_strerr(num));
+}
+
+/*****************************************************************//**
 Increase/decrease the memcached sync count of table to sync memcached
 DML with SQL DDLs.
 @return DB_SUCCESS or error number */
-UNIV_INTERN
 ib_err_t
 ib_cursor_set_memcached_sync(
 /*=========================*/
@@ -3861,21 +3409,9 @@ ib_cursor_set_memcached_sync(
                 }
 
 		if (flag) {
-#ifdef HAVE_ATOMIC_BUILTINS
 			os_atomic_increment_lint(&table->memcached_sync_count, 1);
-#else
-		        dict_mutex_enter_for_mysql();
-                        ++table->memcached_sync_count;
-                        dict_mutex_exit_for_mysql();
-#endif
 		} else {
-#ifdef HAVE_ATOMIC_BUILTINS
 			os_atomic_decrement_lint(&table->memcached_sync_count, 1);
-#else
-		        dict_mutex_enter_for_mysql();
-                        --table->memcached_sync_count;
-                        dict_mutex_exit_for_mysql();
-#endif
 		        ut_a(table->memcached_sync_count >= 0);
 		}
 	} else {
diff --git a/storage/innobase/api/api0misc.cc b/storage/innobase/api/api0misc.cc
index a980d32..c83eaed 100644
--- a/storage/innobase/api/api0misc.cc
+++ b/storage/innobase/api/api0misc.cc
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 2008, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2008, 2014, Oracle and/or its affiliates. All Rights Reserved.
 
 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
@@ -24,12 +24,7 @@ InnoDB Native API
 3/20/2011 Jimmy Yang extracted from Embedded InnoDB
 *******************************************************/
 
-#include <my_config.h>
-#include <errno.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
+#include "ha_prototypes.h"
 
 #include "api0misc.h"
 #include "trx0roll.h"
@@ -39,15 +34,10 @@ InnoDB Native API
 #include "pars0pars.h"
 #include "row0sel.h"
 #include "lock0lock.h"
-#include "ha_prototypes.h"
-#include <m_ctype.h>
-#include <mysys_err.h>
-#include <mysql/plugin.h>
 
 /*********************************************************************//**
 Sets a lock on a table.
- at return	error code or DB_SUCCESS */
-UNIV_INTERN
+ at return error code or DB_SUCCESS */
 dberr_t
 ib_trx_lock_table_with_retry(
 /*=========================*/
@@ -123,85 +113,84 @@ ib_trx_lock_table_with_retry(
 Handles user errors and lock waits detected by the database engine.
 @return TRUE if it was a lock wait and we should continue running
 the query thread */
-UNIV_INTERN
 ibool
 ib_handle_errors(
 /*=============*/
-        dberr_t*	new_err,/*!< out: possible new error encountered in
-                                lock wait, or if no new error, the value
-                                of trx->error_state at the entry of this
-                                function */
-        trx_t*          trx,    /*!< in: transaction */
-        que_thr_t*      thr,    /*!< in: query thread */
-        trx_savept_t*   savept) /*!< in: savepoint or NULL */
+	dberr_t*	new_err,/*!< out: possible new error encountered in
+				lock wait, or if no new error, the value
+				of trx->error_state at the entry of this
+				function */
+	trx_t*		trx,    /*!< in: transaction */
+	que_thr_t*	thr,    /*!< in: query thread */
+	trx_savept_t*	savept) /*!< in: savepoint or NULL */
 {
-        dberr_t		err;
+	dberr_t		err;
 handle_new_error:
-        err = trx->error_state;
+	err = trx->error_state;
 
-        ut_a(err != DB_SUCCESS);
+	ut_a(err != DB_SUCCESS);
 
-        trx->error_state = DB_SUCCESS;
+	trx->error_state = DB_SUCCESS;
 
-        switch (err) {
-        case DB_LOCK_WAIT_TIMEOUT:
+	switch (err) {
+	case DB_LOCK_WAIT_TIMEOUT:
 		trx_rollback_for_mysql(trx);
 		break;
-                /* fall through */
-        case DB_DUPLICATE_KEY:
-        case DB_FOREIGN_DUPLICATE_KEY:
-        case DB_TOO_BIG_RECORD:
-        case DB_ROW_IS_REFERENCED:
-        case DB_NO_REFERENCED_ROW:
-        case DB_CANNOT_ADD_CONSTRAINT:
-        case DB_TOO_MANY_CONCURRENT_TRXS:
-        case DB_OUT_OF_FILE_SPACE:
-                if (savept) {
-                        /* Roll back the latest, possibly incomplete
-                        insertion or update */
+		/* fall through */
+	case DB_DUPLICATE_KEY:
+	case DB_FOREIGN_DUPLICATE_KEY:
+	case DB_TOO_BIG_RECORD:
+	case DB_ROW_IS_REFERENCED:
+	case DB_NO_REFERENCED_ROW:
+	case DB_CANNOT_ADD_CONSTRAINT:
+	case DB_TOO_MANY_CONCURRENT_TRXS:
+	case DB_OUT_OF_FILE_SPACE:
+		if (savept) {
+			/* Roll back the latest, possibly incomplete
+			insertion or update */
 
 			trx_rollback_to_savepoint(trx, savept);
-                }
-                break;
-        case DB_LOCK_WAIT:
+		}
+		break;
+	case DB_LOCK_WAIT:
 		lock_wait_suspend_thread(thr);
 
-                if (trx->error_state != DB_SUCCESS) {
-                        que_thr_stop_for_mysql(thr);
+		if (trx->error_state != DB_SUCCESS) {
+			que_thr_stop_for_mysql(thr);
 
-                        goto handle_new_error;
-                }
+			goto handle_new_error;
+		}
 
-                *new_err = err;
+		*new_err = err;
 
-                return(TRUE); /* Operation needs to be retried. */
+		return(TRUE); /* Operation needs to be retried. */
 
-        case DB_DEADLOCK:
-        case DB_LOCK_TABLE_FULL:
-                /* Roll back the whole transaction; this resolution was added
-                to version 3.23.43 */
+	case DB_DEADLOCK:
+	case DB_LOCK_TABLE_FULL:
+		/* Roll back the whole transaction; this resolution was added
+		to version 3.23.43 */
 
-                trx_rollback_for_mysql(trx);
-                break;
+		trx_rollback_for_mysql(trx);
+		break;
 
-        case DB_MUST_GET_MORE_FILE_SPACE:
+	case DB_MUST_GET_MORE_FILE_SPACE:
 
-                exit(1);
+		ut_error;
 
-        case DB_CORRUPTION:
+	case DB_CORRUPTION:
 	case DB_FOREIGN_EXCEED_MAX_CASCADE:
-                break;
-        default:
-                ut_error;
-        }
+		break;
+	default:
+		ut_error;
+	}
 
-        if (trx->error_state != DB_SUCCESS) {
-                *new_err = trx->error_state;
-        } else {
-                *new_err = err;
-        }
+	if (trx->error_state != DB_SUCCESS) {
+		*new_err = trx->error_state;
+	} else {
+		*new_err = err;
+	}
 
-        trx->error_state = DB_SUCCESS;
+	trx->error_state = DB_SUCCESS;
 
-        return(FALSE);
+	return(FALSE);
 }
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 33ca57c..36ec01d 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -2,7 +2,7 @@
 
 Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
 Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2014, 2015, MariaDB Corporation
+Copyright (c) 2014, 2016, MariaDB Corporation
 
 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
@@ -26,14 +26,16 @@ Created 6/2/1994 Heikki Tuuri
 *******************************************************/
 
 #include "btr0btr.h"
+#include "ha_prototypes.h"
 
 #ifdef UNIV_NONINL
 #include "btr0btr.ic"
 #endif
 
-#include "fsp0fsp.h"
+#include "fsp0sysspace.h"
 #include "page0page.h"
 #include "page0zip.h"
+#include "gis0rtree.h"
 
 #ifndef UNIV_HOTBACKUP
 #include "btr0cur.h"
@@ -45,13 +47,15 @@ Created 6/2/1994 Heikki Tuuri
 #include "ibuf0ibuf.h"
 #include "trx0trx.h"
 #include "srv0mon.h"
+#include "gis0geo.h"
+#include "ut0new.h"
+#include "dict0boot.h"
 
 /**************************************************************//**
 Checks if the page in the cursor can be merged with given page.
 If necessary, re-organize the merge_page.
- at return	TRUE if possible to merge. */
-UNIV_INTERN
-ibool
+ at return	true if possible to merge. */
+bool
 btr_can_merge_with_page(
 /*====================*/
 	btr_cur_t*	cursor,		/*!< in: cursor on the page to merge */
@@ -63,581 +67,19 @@ btr_can_merge_with_page(
 
 /**************************************************************//**
 Report that an index page is corrupted. */
-UNIV_INTERN
 void
 btr_corruption_report(
 /*==================*/
 	const buf_block_t*	block,	/*!< in: corrupted block */
 	const dict_index_t*	index)	/*!< in: index tree */
 {
-	fprintf(stderr, "InnoDB: flag mismatch in space %u page %u"
-		" index %s of table %s\n",
-		(unsigned) buf_block_get_space(block),
-		(unsigned) buf_block_get_page_no(block),
-		index->name, index->table_name);
-	if (block->page.zip.data) {
-		buf_page_print(block->page.zip.data,
-			       buf_block_get_zip_size(block),
-			       BUF_PAGE_PRINT_NO_CRASH);
-	}
-	buf_page_print(buf_block_get_frame(block), 0, 0);
+	ib::error()
+		<< "Flag mismatch in page " << block->page.id
+		<< " index " << index->name
+		<< " of table " << index->table->name;
 }
 
 #ifndef UNIV_HOTBACKUP
-#ifdef UNIV_BLOB_DEBUG
-# include "srv0srv.h"
-# include "ut0rbt.h"
-
-/** TRUE when messages about index->blobs modification are enabled. */
-static ibool btr_blob_dbg_msg;
-
-/** Issue a message about an operation on index->blobs.
- at param op	operation
- at param b	the entry being subjected to the operation
- at param ctx	the context of the operation */
-#define btr_blob_dbg_msg_issue(op, b, ctx)			\
-	fprintf(stderr, op " %u:%u:%u->%u %s(%u,%u,%u)\n",	\
-		(b)->ref_page_no, (b)->ref_heap_no,		\
-		(b)->ref_field_no, (b)->blob_page_no, ctx,	\
-		(b)->owner, (b)->always_owner, (b)->del)
-
-/** Insert to index->blobs a reference to an off-page column.
- at param index	the index tree
- at param b	the reference
- at param ctx	context (for logging) */
-UNIV_INTERN
-void
-btr_blob_dbg_rbt_insert(
-/*====================*/
-	dict_index_t*		index,	/*!< in/out: index tree */
-	const btr_blob_dbg_t*	b,	/*!< in: the reference */
-	const char*		ctx)	/*!< in: context (for logging) */
-{
-	if (btr_blob_dbg_msg) {
-		btr_blob_dbg_msg_issue("insert", b, ctx);
-	}
-	mutex_enter(&index->blobs_mutex);
-	rbt_insert(index->blobs, b, b);
-	mutex_exit(&index->blobs_mutex);
-}
-
-/** Remove from index->blobs a reference to an off-page column.
- at param index	the index tree
- at param b	the reference
- at param ctx	context (for logging) */
-UNIV_INTERN
-void
-btr_blob_dbg_rbt_delete(
-/*====================*/
-	dict_index_t*		index,	/*!< in/out: index tree */
-	const btr_blob_dbg_t*	b,	/*!< in: the reference */
-	const char*		ctx)	/*!< in: context (for logging) */
-{
-	if (btr_blob_dbg_msg) {
-		btr_blob_dbg_msg_issue("delete", b, ctx);
-	}
-	mutex_enter(&index->blobs_mutex);
-	ut_a(rbt_delete(index->blobs, b));
-	mutex_exit(&index->blobs_mutex);
-}
-
-/**************************************************************//**
-Comparator for items (btr_blob_dbg_t) in index->blobs.
-The key in index->blobs is (ref_page_no, ref_heap_no, ref_field_no).
- at return negative, 0 or positive if *a<*b, *a=*b, *a>*b */
-static
-int
-btr_blob_dbg_cmp(
-/*=============*/
-	const void*	a,	/*!< in: first btr_blob_dbg_t to compare */
-	const void*	b)	/*!< in: second btr_blob_dbg_t to compare */
-{
-	const btr_blob_dbg_t*	aa = static_cast<const btr_blob_dbg_t*>(a);
-	const btr_blob_dbg_t*	bb = static_cast<const btr_blob_dbg_t*>(b);
-
-	ut_ad(aa != NULL);
-	ut_ad(bb != NULL);
-
-	if (aa->ref_page_no != bb->ref_page_no) {
-		return(aa->ref_page_no < bb->ref_page_no ? -1 : 1);
-	}
-	if (aa->ref_heap_no != bb->ref_heap_no) {
-		return(aa->ref_heap_no < bb->ref_heap_no ? -1 : 1);
-	}
-	if (aa->ref_field_no != bb->ref_field_no) {
-		return(aa->ref_field_no < bb->ref_field_no ? -1 : 1);
-	}
-	return(0);
-}
-
-/**************************************************************//**
-Add a reference to an off-page column to the index->blobs map. */
-UNIV_INTERN
-void
-btr_blob_dbg_add_blob(
-/*==================*/
-	const rec_t*	rec,		/*!< in: clustered index record */
-	ulint		field_no,	/*!< in: off-page column number */
-	ulint		page_no,	/*!< in: start page of the column */
-	dict_index_t*	index,		/*!< in/out: index tree */
-	const char*	ctx)		/*!< in: context (for logging) */
-{
-	btr_blob_dbg_t	b;
-	const page_t*	page	= page_align(rec);
-
-	ut_a(index->blobs);
-
-	b.blob_page_no = page_no;
-	b.ref_page_no = page_get_page_no(page);
-	b.ref_heap_no = page_rec_get_heap_no(rec);
-	b.ref_field_no = field_no;
-	ut_a(b.ref_field_no >= index->n_uniq);
-	b.always_owner = b.owner = TRUE;
-	b.del = FALSE;
-	ut_a(!rec_get_deleted_flag(rec, page_is_comp(page)));
-	btr_blob_dbg_rbt_insert(index, &b, ctx);
-}
-
-/**************************************************************//**
-Add to index->blobs any references to off-page columns from a record.
- at return number of references added */
-UNIV_INTERN
-ulint
-btr_blob_dbg_add_rec(
-/*=================*/
-	const rec_t*	rec,	/*!< in: record */
-	dict_index_t*	index,	/*!< in/out: index */
-	const ulint*	offsets,/*!< in: offsets */
-	const char*	ctx)	/*!< in: context (for logging) */
-{
-	ulint		count	= 0;
-	ulint		i;
-	btr_blob_dbg_t	b;
-	ibool		del;
-
-	ut_ad(rec_offs_validate(rec, index, offsets));
-
-	if (!rec_offs_any_extern(offsets)) {
-		return(0);
-	}
-
-	b.ref_page_no = page_get_page_no(page_align(rec));
-	b.ref_heap_no = page_rec_get_heap_no(rec);
-	del = (rec_get_deleted_flag(rec, rec_offs_comp(offsets)) != 0);
-
-	for (i = 0; i < rec_offs_n_fields(offsets); i++) {
-		if (rec_offs_nth_extern(offsets, i)) {
-			ulint		len;
-			const byte*	field_ref = rec_get_nth_field(
-				rec, offsets, i, &len);
-
-			ut_a(len != UNIV_SQL_NULL);
-			ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
-			field_ref += len - BTR_EXTERN_FIELD_REF_SIZE;
-
-			if (!memcmp(field_ref, field_ref_zero,
-				    BTR_EXTERN_FIELD_REF_SIZE)) {
-				/* the column has not been stored yet */
-				continue;
-			}
-
-			b.ref_field_no = i;
-			b.blob_page_no = mach_read_from_4(
-				field_ref + BTR_EXTERN_PAGE_NO);
-			ut_a(b.ref_field_no >= index->n_uniq);
-			b.always_owner = b.owner
-				= !(field_ref[BTR_EXTERN_LEN]
-				    & BTR_EXTERN_OWNER_FLAG);
-			b.del = del;
-
-			btr_blob_dbg_rbt_insert(index, &b, ctx);
-			count++;
-		}
-	}
-
-	return(count);
-}
-
-/**************************************************************//**
-Display the references to off-page columns.
-This function is to be called from a debugger,
-for example when a breakpoint on ut_dbg_assertion_failed is hit. */
-UNIV_INTERN
-void
-btr_blob_dbg_print(
-/*===============*/
-	const dict_index_t*	index)	/*!< in: index tree */
-{
-	const ib_rbt_node_t*	node;
-
-	if (!index->blobs) {
-		return;
-	}
-
-	/* We intentionally do not acquire index->blobs_mutex here.
-	This function is to be called from a debugger, and the caller
-	should make sure that the index->blobs_mutex is held. */
-
-	for (node = rbt_first(index->blobs);
-	     node != NULL; node = rbt_next(index->blobs, node)) {
-		const btr_blob_dbg_t*	b
-			= rbt_value(btr_blob_dbg_t, node);
-		fprintf(stderr, "%u:%u:%u->%u%s%s%s\n",
-			b->ref_page_no, b->ref_heap_no, b->ref_field_no,
-			b->blob_page_no,
-			b->owner ? "" : "(disowned)",
-			b->always_owner ? "" : "(has disowned)",
-			b->del ? "(deleted)" : "");
-	}
-}
-
-/**************************************************************//**
-Remove from index->blobs any references to off-page columns from a record.
- at return number of references removed */
-UNIV_INTERN
-ulint
-btr_blob_dbg_remove_rec(
-/*====================*/
-	const rec_t*	rec,	/*!< in: record */
-	dict_index_t*	index,	/*!< in/out: index */
-	const ulint*	offsets,/*!< in: offsets */
-	const char*	ctx)	/*!< in: context (for logging) */
-{
-	ulint		i;
-	ulint		count	= 0;
-	btr_blob_dbg_t	b;
-
-	ut_ad(rec_offs_validate(rec, index, offsets));
-
-	if (!rec_offs_any_extern(offsets)) {
-		return(0);
-	}
-
-	b.ref_page_no = page_get_page_no(page_align(rec));
-	b.ref_heap_no = page_rec_get_heap_no(rec);
-
-	for (i = 0; i < rec_offs_n_fields(offsets); i++) {
-		if (rec_offs_nth_extern(offsets, i)) {
-			ulint		len;
-			const byte*	field_ref = rec_get_nth_field(
-				rec, offsets, i, &len);
-
-			ut_a(len != UNIV_SQL_NULL);
-			ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
-			field_ref += len - BTR_EXTERN_FIELD_REF_SIZE;
-
-			b.ref_field_no = i;
-			b.blob_page_no = mach_read_from_4(
-				field_ref + BTR_EXTERN_PAGE_NO);
-
-			switch (b.blob_page_no) {
-			case 0:
-				/* The column has not been stored yet.
-				The BLOB pointer must be all zero.
-				There cannot be a BLOB starting at
-				page 0, because page 0 is reserved for
-				the tablespace header. */
-				ut_a(!memcmp(field_ref, field_ref_zero,
-					     BTR_EXTERN_FIELD_REF_SIZE));
-				/* fall through */
-			case FIL_NULL:
-				/* the column has been freed already */
-				continue;
-			}
-
-			btr_blob_dbg_rbt_delete(index, &b, ctx);
-			count++;
-		}
-	}
-
-	return(count);
-}
-
-/**************************************************************//**
-Check that there are no references to off-page columns from or to
-the given page. Invoked when freeing or clearing a page.
- at return TRUE when no orphan references exist */
-UNIV_INTERN
-ibool
-btr_blob_dbg_is_empty(
-/*==================*/
-	dict_index_t*	index,		/*!< in: index */
-	ulint		page_no)	/*!< in: page number */
-{
-	const ib_rbt_node_t*	node;
-	ibool			success	= TRUE;
-
-	if (!index->blobs) {
-		return(success);
-	}
-
-	mutex_enter(&index->blobs_mutex);
-
-	for (node = rbt_first(index->blobs);
-	     node != NULL; node = rbt_next(index->blobs, node)) {
-		const btr_blob_dbg_t*	b
-			= rbt_value(btr_blob_dbg_t, node);
-
-		if (b->ref_page_no != page_no && b->blob_page_no != page_no) {
-			continue;
-		}
-
-		fprintf(stderr,
-			"InnoDB: orphan BLOB ref%s%s%s %u:%u:%u->%u\n",
-			b->owner ? "" : "(disowned)",
-			b->always_owner ? "" : "(has disowned)",
-			b->del ? "(deleted)" : "",
-			b->ref_page_no, b->ref_heap_no, b->ref_field_no,
-			b->blob_page_no);
-
-		if (b->blob_page_no != page_no || b->owner || !b->del) {
-			success = FALSE;
-		}
-	}
-
-	mutex_exit(&index->blobs_mutex);
-	return(success);
-}
-
-/**************************************************************//**
-Count and process all references to off-page columns on a page.
- at return number of references processed */
-UNIV_INTERN
-ulint
-btr_blob_dbg_op(
-/*============*/
-	const page_t*		page,	/*!< in: B-tree leaf page */
-	const rec_t*		rec,	/*!< in: record to start from
-					(NULL to process the whole page) */
-	dict_index_t*		index,	/*!< in/out: index */
-	const char*		ctx,	/*!< in: context (for logging) */
-	const btr_blob_dbg_op_f	op)	/*!< in: operation on records */
-{
-	ulint		count	= 0;
-	mem_heap_t*	heap	= NULL;
-	ulint		offsets_[REC_OFFS_NORMAL_SIZE];
-	ulint*		offsets	= offsets_;
-	rec_offs_init(offsets_);
-
-	ut_a(fil_page_get_type(page) == FIL_PAGE_INDEX);
-	ut_a(!rec || page_align(rec) == page);
-
-	if (!index->blobs || !page_is_leaf(page)
-	    || !dict_index_is_clust(index)) {
-		return(0);
-	}
-
-	if (rec == NULL) {
-		rec = page_get_infimum_rec(page);
-	}
-
-	do {
-		offsets = rec_get_offsets(rec, index, offsets,
-					  ULINT_UNDEFINED, &heap);
-		count += op(rec, index, offsets, ctx);
-		rec = page_rec_get_next_const(rec);
-	} while (!page_rec_is_supremum(rec));
-
-	if (heap) {
-		mem_heap_free(heap);
-	}
-
-	return(count);
-}
-
-/**************************************************************//**
-Count and add to index->blobs any references to off-page columns
-from records on a page.
- at return number of references added */
-UNIV_INTERN
-ulint
-btr_blob_dbg_add(
-/*=============*/
-	const page_t*	page,	/*!< in: rewritten page */
-	dict_index_t*	index,	/*!< in/out: index */
-	const char*	ctx)	/*!< in: context (for logging) */
-{
-	btr_blob_dbg_assert_empty(index, page_get_page_no(page));
-
-	return(btr_blob_dbg_op(page, NULL, index, ctx, btr_blob_dbg_add_rec));
-}
-
-/**************************************************************//**
-Count and remove from index->blobs any references to off-page columns
-from records on a page.
-Used when reorganizing a page, before copying the records.
- at return number of references removed */
-UNIV_INTERN
-ulint
-btr_blob_dbg_remove(
-/*================*/
-	const page_t*	page,	/*!< in: b-tree page */
-	dict_index_t*	index,	/*!< in/out: index */
-	const char*	ctx)	/*!< in: context (for logging) */
-{
-	ulint	count;
-
-	count = btr_blob_dbg_op(page, NULL, index, ctx,
-				btr_blob_dbg_remove_rec);
-
-	/* Check that no references exist. */
-	btr_blob_dbg_assert_empty(index, page_get_page_no(page));
-
-	return(count);
-}
-
-/**************************************************************//**
-Restore in index->blobs any references to off-page columns
-Used when page reorganize fails due to compressed page overflow. */
-UNIV_INTERN
-void
-btr_blob_dbg_restore(
-/*=================*/
-	const page_t*	npage,	/*!< in: page that failed to compress  */
-	const page_t*	page,	/*!< in: copy of original page */
-	dict_index_t*	index,	/*!< in/out: index */
-	const char*	ctx)	/*!< in: context (for logging) */
-{
-	ulint	removed;
-	ulint	added;
-
-	ut_a(page_get_page_no(npage) == page_get_page_no(page));
-	ut_a(page_get_space_id(npage) == page_get_space_id(page));
-
-	removed = btr_blob_dbg_remove(npage, index, ctx);
-	added = btr_blob_dbg_add(page, index, ctx);
-	ut_a(added == removed);
-}
-
-/**************************************************************//**
-Modify the 'deleted' flag of a record. */
-UNIV_INTERN
-void
-btr_blob_dbg_set_deleted_flag(
-/*==========================*/
-	const rec_t*		rec,	/*!< in: record */
-	dict_index_t*		index,	/*!< in/out: index */
-	const ulint*		offsets,/*!< in: rec_get_offs(rec, index) */
-	ibool			del)	/*!< in: TRUE=deleted, FALSE=exists */
-{
-	const ib_rbt_node_t*	node;
-	btr_blob_dbg_t		b;
-	btr_blob_dbg_t*		c;
-	ulint			i;
-
-	ut_ad(rec_offs_validate(rec, index, offsets));
-	ut_a(dict_index_is_clust(index));
-	ut_a(del == !!del);/* must be FALSE==0 or TRUE==1 */
-
-	if (!rec_offs_any_extern(offsets) || !index->blobs) {
-
-		return;
-	}
-
-	b.ref_page_no = page_get_page_no(page_align(rec));
-	b.ref_heap_no = page_rec_get_heap_no(rec);
-
-	for (i = 0; i < rec_offs_n_fields(offsets); i++) {
-		if (rec_offs_nth_extern(offsets, i)) {
-			ulint		len;
-			const byte*	field_ref = rec_get_nth_field(
-				rec, offsets, i, &len);
-
-			ut_a(len != UNIV_SQL_NULL);
-			ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
-			field_ref += len - BTR_EXTERN_FIELD_REF_SIZE;
-
-			b.ref_field_no = i;
-			b.blob_page_no = mach_read_from_4(
-				field_ref + BTR_EXTERN_PAGE_NO);
-
-			switch (b.blob_page_no) {
-			case 0:
-				ut_a(memcmp(field_ref, field_ref_zero,
-					    BTR_EXTERN_FIELD_REF_SIZE));
-				/* page number 0 is for the
-				page allocation bitmap */
-			case FIL_NULL:
-				/* the column has been freed already */
-				ut_error;
-			}
-
-			mutex_enter(&index->blobs_mutex);
-			node = rbt_lookup(index->blobs, &b);
-			ut_a(node);
-
-			c = rbt_value(btr_blob_dbg_t, node);
-			/* The flag should be modified. */
-			c->del = del;
-			if (btr_blob_dbg_msg) {
-				b = *c;
-				mutex_exit(&index->blobs_mutex);
-				btr_blob_dbg_msg_issue("del_mk", &b, "");
-			} else {
-				mutex_exit(&index->blobs_mutex);
-			}
-		}
-	}
-}
-
-/**************************************************************//**
-Change the ownership of an off-page column. */
-UNIV_INTERN
-void
-btr_blob_dbg_owner(
-/*===============*/
-	const rec_t*		rec,	/*!< in: record */
-	dict_index_t*		index,	/*!< in/out: index */
-	const ulint*		offsets,/*!< in: rec_get_offs(rec, index) */
-	ulint			i,	/*!< in: ith field in rec */
-	ibool			own)	/*!< in: TRUE=owned, FALSE=disowned */
-{
-	const ib_rbt_node_t*	node;
-	btr_blob_dbg_t		b;
-	const byte*		field_ref;
-	ulint			len;
-
-	ut_ad(rec_offs_validate(rec, index, offsets));
-	ut_a(rec_offs_nth_extern(offsets, i));
-
-	field_ref = rec_get_nth_field(rec, offsets, i, &len);
-	ut_a(len != UNIV_SQL_NULL);
-	ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
-	field_ref += len - BTR_EXTERN_FIELD_REF_SIZE;
-
-	b.ref_page_no = page_get_page_no(page_align(rec));
-	b.ref_heap_no = page_rec_get_heap_no(rec);
-	b.ref_field_no = i;
-	b.owner = !(field_ref[BTR_EXTERN_LEN] & BTR_EXTERN_OWNER_FLAG);
-	b.blob_page_no = mach_read_from_4(field_ref + BTR_EXTERN_PAGE_NO);
-
-	ut_a(b.owner == own);
-
-	mutex_enter(&index->blobs_mutex);
-	node = rbt_lookup(index->blobs, &b);
-	/* row_ins_clust_index_entry_by_modify() invokes
-	btr_cur_unmark_extern_fields() also for the newly inserted
-	references, which are all zero bytes until the columns are stored.
-	The node lookup must fail if and only if that is the case. */
-	ut_a(!memcmp(field_ref, field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE)
-	     == !node);
-
-	if (node) {
-		btr_blob_dbg_t*	c = rbt_value(btr_blob_dbg_t, node);
-		/* Some code sets ownership from TRUE to TRUE.
-		We do not allow changing ownership from FALSE to FALSE. */
-		ut_a(own || c->owner);
-
-		c->owner = own;
-		if (!own) {
-			c->always_owner = FALSE;
-		}
-	}
-
-	mutex_exit(&index->blobs_mutex);
-}
-#endif /* UNIV_BLOB_DEBUG */
-
 /*
 Latching strategy of the InnoDB B-tree
 --------------------------------------
@@ -696,7 +138,7 @@ we allocate pages for the non-leaf levels of the tree.
 #ifdef UNIV_BTR_DEBUG
 /**************************************************************//**
 Checks a file segment header within a B-tree root page.
- at return	TRUE if valid */
+ at return TRUE if valid */
 static
 ibool
 btr_root_fseg_validate(
@@ -715,8 +157,7 @@ btr_root_fseg_validate(
 
 /**************************************************************//**
 Gets the root node of a tree and x- or s-latches it.
- at return	root page, x- or s-latched */
-static
+ at return root page, x- or s-latched */
 buf_block_t*
 btr_root_block_get(
 /*===============*/
@@ -725,16 +166,13 @@ btr_root_block_get(
 					or RW_X_LATCH */
 	mtr_t*			mtr)	/*!< in: mtr */
 {
-	ulint		space;
-	ulint		zip_size;
-	ulint		root_page_no;
-	buf_block_t*	block;
+	const ulint		space = dict_index_get_space(index);
+	const page_id_t		page_id(space, dict_index_get_page(index));
+	const page_size_t	page_size(dict_table_page_size(index->table));
 
-	space = dict_index_get_space(index);
-	zip_size = dict_table_zip_size(index->table);
-	root_page_no = dict_index_get_page(index);
+	buf_block_t*	block = btr_block_get(page_id, page_size, mode,
+					      index, mtr);
 
-	block = btr_block_get(space, zip_size, root_page_no, mode, (dict_index_t*)index, mtr);
 
 	if (!block) {
 		index->table->is_encrypted = TRUE;
@@ -765,17 +203,19 @@ btr_root_block_get(
 }
 
 /**************************************************************//**
-Gets the root node of a tree and x-latches it.
- at return	root page, x-latched */
-UNIV_INTERN
+Gets the root node of a tree and sx-latches it for segment access.
+ at return root page, sx-latched */
 page_t*
 btr_root_get(
 /*=========*/
 	const dict_index_t*	index,	/*!< in: index tree */
 	mtr_t*			mtr)	/*!< in: mtr */
 {
-	buf_block_t* root = btr_root_block_get(index, RW_X_LATCH,
-			mtr);
+	/* Intended to be used for segment list access.
+	SX lock doesn't block reading user data by other threads.
+	And block the segment list access by others.*/
+	buf_block_t* root = btr_root_block_get(index, RW_SX_LATCH,
+					       mtr);
 
 	if (root && root->page.encrypted == true) {
 		root = NULL;
@@ -788,8 +228,7 @@ btr_root_get(
 Gets the height of the B-tree (the level of the root, when the leaf
 level is assumed to be 0). The caller must hold an S or X latch on
 the index.
- at return	tree height (level of the root) */
-UNIV_INTERN
+ at return tree height (level of the root) */
 ulint
 btr_height_get(
 /*===========*/
@@ -799,22 +238,23 @@ btr_height_get(
 	ulint		height=0;
 	buf_block_t*	root_block;
 
-	ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
-				MTR_MEMO_S_LOCK)
-	      || mtr_memo_contains(mtr, dict_index_get_lock(index),
-				MTR_MEMO_X_LOCK));
+	ut_ad(srv_read_only_mode
+	      || mtr_memo_contains_flagged(mtr, dict_index_get_lock(index),
+					   MTR_MEMO_S_LOCK
+					   | MTR_MEMO_X_LOCK
+					   | MTR_MEMO_SX_LOCK)
+	      || dict_table_is_intrinsic(index->table));
 
-        /* S latches the page */
-        root_block = btr_root_block_get(index, RW_S_LATCH, mtr);
+	/* S latches the page */
+	root_block = btr_root_block_get(index, RW_S_LATCH, mtr);
 
 	if (root_block) {
 		height = btr_page_get_level(buf_block_get_frame(root_block), mtr);
 
 		/* Release the S latch on the root page. */
-		mtr_memo_release(mtr, root_block, MTR_MEMO_PAGE_S_FIX);
-#ifdef UNIV_SYNC_DEBUG
-		sync_thread_reset_level(&root_block->lock);
-#endif /* UNIV_SYNC_DEBUG */
+		mtr->memo_release(root_block, MTR_MEMO_PAGE_S_FIX);
+
+		ut_d(sync_check_unlock(&root_block->lock));
 	}
 
 	return(height);
@@ -823,7 +263,7 @@ btr_height_get(
 /**************************************************************//**
 Checks a file segment header within a B-tree root page and updates
 the segment header space id.
- at return	TRUE if valid */
+ at return TRUE if valid */
 static
 bool
 btr_root_fseg_adjust_on_import(
@@ -856,41 +296,34 @@ btr_root_fseg_adjust_on_import(
 /**************************************************************//**
 Checks and adjusts the root node of a tree during IMPORT TABLESPACE.
 @return error code, or DB_SUCCESS */
-UNIV_INTERN
 dberr_t
 btr_root_adjust_on_import(
 /*======================*/
 	const dict_index_t*	index)	/*!< in: index tree */
 {
-	dberr_t		err;
-	mtr_t		mtr;
-	page_t*		page;
-	buf_block_t*	block;
-	page_zip_des_t*	page_zip;
-	dict_table_t*	table		= index->table;
-	ulint		space_id	= dict_index_get_space(index);
-	ulint		zip_size	= dict_table_zip_size(table);
-	ulint		root_page_no	= dict_index_get_page(index);
+	dberr_t			err;
+	mtr_t			mtr;
+	page_t*			page;
+	buf_block_t*		block;
+	page_zip_des_t*		page_zip;
+	dict_table_t*		table = index->table;
+	const ulint		space_id = dict_index_get_space(index);
+	const page_id_t		page_id(space_id, dict_index_get_page(index));
+	const page_size_t	page_size(dict_table_page_size(table));
+
+	DBUG_EXECUTE_IF("ib_import_trigger_corruption_3",
+			return(DB_CORRUPTION););
 
 	mtr_start(&mtr);
 
 	mtr_set_log_mode(&mtr, MTR_LOG_NO_REDO);
 
-	DBUG_EXECUTE_IF("ib_import_trigger_corruption_3",
-			return(DB_CORRUPTION););
-
-	block = btr_block_get(
-		space_id, zip_size, root_page_no, RW_X_LATCH, (dict_index_t*)index, &mtr);
+	block = btr_block_get(page_id, page_size, RW_X_LATCH, index, &mtr);
 
 	page = buf_block_get_frame(block);
 	page_zip = buf_block_get_page_zip(block);
 
-	/* Check that this is a B-tree page and both the PREV and NEXT
-	pointers are FIL_NULL, because the root page does not have any
-	siblings. */
-	if (fil_page_get_type(page) != FIL_PAGE_INDEX
-	    || fil_page_get_prev(page) != FIL_NULL
-	    || fil_page_get_next(page) != FIL_NULL) {
+	if (!page_is_root(page)) {
 
 		err = DB_CORRUPTION;
 
@@ -903,18 +336,13 @@ btr_root_adjust_on_import(
 		if (page_is_compact_format != dict_table_is_comp(table)) {
 			err = DB_CORRUPTION;
 		} else {
-
 			/* Check that the table flags and the tablespace
 			flags match. */
-			ulint	flags = fil_space_get_flags(table->space);
-
-			if (flags
-			    && flags != dict_tf_to_fsp_flags(table->flags)) {
-
-				err = DB_CORRUPTION;
-			} else {
-				err = DB_SUCCESS;
-			}
+			ulint	flags = dict_tf_to_fsp_flags(table->flags,
+							     false);
+			ulint	fsp_flags = fil_space_get_flags(table->space);
+			err = fsp_flags_are_equal(flags, fsp_flags)
+			      ? DB_SUCCESS : DB_CORRUPTION;
 		}
 	} else {
 		err = DB_SUCCESS;
@@ -937,124 +365,9 @@ btr_root_adjust_on_import(
 	return(err);
 }
 
-/*************************************************************//**
-Gets pointer to the previous user record in the tree. It is assumed that
-the caller has appropriate latches on the page and its neighbor.
- at return	previous user record, NULL if there is none */
-UNIV_INTERN
-rec_t*
-btr_get_prev_user_rec(
-/*==================*/
-	rec_t*	rec,	/*!< in: record on leaf level */
-	mtr_t*	mtr)	/*!< in: mtr holding a latch on the page, and if
-			needed, also to the previous page */
-{
-	page_t*	page;
-	page_t*	prev_page;
-	ulint	prev_page_no;
-
-	if (!page_rec_is_infimum(rec)) {
-
-		rec_t*	prev_rec = page_rec_get_prev(rec);
-
-		if (!page_rec_is_infimum(prev_rec)) {
-
-			return(prev_rec);
-		}
-	}
-
-	page = page_align(rec);
-	prev_page_no = btr_page_get_prev(page, mtr);
-
-	if (prev_page_no != FIL_NULL) {
-
-		ulint		space;
-		ulint		zip_size;
-		buf_block_t*	prev_block;
-
-		space = page_get_space_id(page);
-		zip_size = fil_space_get_zip_size(space);
-
-		prev_block = buf_page_get_with_no_latch(space, zip_size,
-							prev_page_no, mtr);
-		prev_page = buf_block_get_frame(prev_block);
-		/* The caller must already have a latch to the brother */
-		ut_ad(mtr_memo_contains(mtr, prev_block,
-					MTR_MEMO_PAGE_S_FIX)
-		      || mtr_memo_contains(mtr, prev_block,
-					   MTR_MEMO_PAGE_X_FIX));
-#ifdef UNIV_BTR_DEBUG
-		ut_a(page_is_comp(prev_page) == page_is_comp(page));
-		ut_a(btr_page_get_next(prev_page, mtr)
-		     == page_get_page_no(page));
-#endif /* UNIV_BTR_DEBUG */
-
-		return(page_rec_get_prev(page_get_supremum_rec(prev_page)));
-	}
-
-	return(NULL);
-}
-
-/*************************************************************//**
-Gets pointer to the next user record in the tree. It is assumed that the
-caller has appropriate latches on the page and its neighbor.
- at return	next user record, NULL if there is none */
-UNIV_INTERN
-rec_t*
-btr_get_next_user_rec(
-/*==================*/
-	rec_t*	rec,	/*!< in: record on leaf level */
-	mtr_t*	mtr)	/*!< in: mtr holding a latch on the page, and if
-			needed, also to the next page */
-{
-	page_t*	page;
-	page_t*	next_page;
-	ulint	next_page_no;
-
-	if (!page_rec_is_supremum(rec)) {
-
-		rec_t*	next_rec = page_rec_get_next(rec);
-
-		if (!page_rec_is_supremum(next_rec)) {
-
-			return(next_rec);
-		}
-	}
-
-	page = page_align(rec);
-	next_page_no = btr_page_get_next(page, mtr);
-
-	if (next_page_no != FIL_NULL) {
-		ulint		space;
-		ulint		zip_size;
-		buf_block_t*	next_block;
-
-		space = page_get_space_id(page);
-		zip_size = fil_space_get_zip_size(space);
-
-		next_block = buf_page_get_with_no_latch(space, zip_size,
-							next_page_no, mtr);
-		next_page = buf_block_get_frame(next_block);
-		/* The caller must already have a latch to the brother */
-		ut_ad(mtr_memo_contains(mtr, next_block, MTR_MEMO_PAGE_S_FIX)
-		      || mtr_memo_contains(mtr, next_block,
-					   MTR_MEMO_PAGE_X_FIX));
-#ifdef UNIV_BTR_DEBUG
-		ut_a(page_is_comp(next_page) == page_is_comp(page));
-		ut_a(btr_page_get_prev(next_page, mtr)
-		     == page_get_page_no(page));
-#endif /* UNIV_BTR_DEBUG */
-
-		return(page_rec_get_next(page_get_infimum_rec(next_page)));
-	}
-
-	return(NULL);
-}
-
 /**************************************************************//**
 Creates a new index page (not the root, and also not
 used in page reorganization).  @see btr_page_empty(). */
-static
 void
 btr_page_create(
 /*============*/
@@ -1066,18 +379,21 @@ btr_page_create(
 {
 	page_t*		page = buf_block_get_frame(block);
 
-	ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
-	btr_blob_dbg_assert_empty(index, buf_block_get_page_no(block));
+	ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table));
 
 	if (page_zip) {
-		page_create_zip(block, index, level, 0, mtr);
+		page_create_zip(block, index, level, 0, NULL, mtr);
 	} else {
-		page_create(block, mtr, dict_table_is_comp(index->table));
+		page_create(block, mtr, dict_table_is_comp(index->table),
+			    dict_index_is_spatial(index));
 		/* Set the level of the new index page */
 		btr_page_set_level(page, NULL, level, mtr);
 	}
 
-	block->check_index_page_at_flush = TRUE;
+	/* For Spatial Index, initialize the Split Sequence Number */
+	if (dict_index_is_spatial(index)) {
+		page_set_ssn_id(block, page_zip, 0, mtr);
+	}
 
 	btr_page_set_index_id(page, page_zip, index->id, mtr);
 }
@@ -1085,7 +401,7 @@ btr_page_create(
 /**************************************************************//**
 Allocates a new file page to be used in an ibuf tree. Takes the page from
 the free list of the tree, which must contain pages!
- at return	new allocated block, x-latched */
+ at return new allocated block, x-latched */
 static
 buf_block_t*
 btr_page_alloc_for_ibuf(
@@ -1104,9 +420,11 @@ btr_page_alloc_for_ibuf(
 				   + PAGE_BTR_IBUF_FREE_LIST, mtr);
 	ut_a(node_addr.page != FIL_NULL);
 
-	new_block = buf_page_get(dict_index_get_space(index),
-				 dict_table_zip_size(index->table),
-				 node_addr.page, RW_X_LATCH, mtr);
+	new_block = buf_page_get(
+		page_id_t(dict_index_get_space(index), node_addr.page),
+		dict_table_page_size(index->table),
+		RW_X_LATCH, mtr);
+
 	new_page = buf_block_get_frame(new_block);
 	buf_block_dbg_add_level(new_block, SYNC_IBUF_TREE_NODE_NEW);
 
@@ -1190,7 +508,6 @@ that the caller has made the reservation for free extents!
 @retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded
 (init_mtr == mtr, or the page was not previously freed in mtr)
 @retval block (not allocated or initialized) otherwise */
-UNIV_INTERN
 buf_block_t*
 btr_page_alloc(
 /*===========*/
@@ -1225,8 +542,7 @@ btr_page_alloc(
 
 /**************************************************************//**
 Gets the number of pages in a B-tree.
- at return	number of pages, or ULINT_UNDEFINED if the index is unavailable */
-UNIV_INTERN
+ at return number of pages, or ULINT_UNDEFINED if the index is unavailable */
 ulint
 btr_get_size(
 /*=========*/
@@ -1235,16 +551,46 @@ btr_get_size(
 	mtr_t*		mtr)	/*!< in/out: mini-transaction where index
 				is s-latched */
 {
-	ulint used;
-	if (flag == BTR_N_LEAF_PAGES) {
-		btr_get_size_and_reserved(index, flag, &used, mtr);
-		return used;
-	} else if (flag == BTR_TOTAL_SIZE) {
-		return btr_get_size_and_reserved(index, flag, &used, mtr);
+	fseg_header_t*	seg_header;
+	page_t*		root;
+	ulint		n=0;
+	ulint		dummy;
+
+	ut_ad(srv_read_only_mode
+	      || mtr_memo_contains(mtr, dict_index_get_lock(index),
+				   MTR_MEMO_S_LOCK)
+	      || dict_table_is_intrinsic(index->table));
+
+	if (index->page == FIL_NULL
+	    || dict_index_is_online_ddl(index)
+	    || !index->is_committed()) {
+		return(ULINT_UNDEFINED);
+	}
+
+	root = btr_root_get(index, mtr);
+
+	if (root) {
+		if (flag == BTR_N_LEAF_PAGES) {
+			seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_LEAF;
+
+			fseg_n_reserved_pages(seg_header, &n, mtr);
+
+		} else if (flag == BTR_TOTAL_SIZE) {
+			seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_TOP;
+
+			n = fseg_n_reserved_pages(seg_header, &dummy, mtr);
+
+			seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_LEAF;
+
+			n += fseg_n_reserved_pages(seg_header, &dummy, mtr);
+		} else {
+			ut_error;
+		}
 	} else {
-		ut_error;
+		n = ULINT_UNDEFINED;
 	}
-	return (ULINT_UNDEFINED);
+
+	return(n);
 }
 
 /**************************************************************//**
@@ -1271,8 +617,9 @@ btr_get_size_and_reserved(
 
 	ut_a(flag == BTR_N_LEAF_PAGES || flag == BTR_TOTAL_SIZE);
 
-	if (index->page == FIL_NULL || dict_index_is_online_ddl(index)
-	    || *index->name == TEMP_INDEX_PREFIX) {
+	if (index->page == FIL_NULL
+	    || dict_index_is_online_ddl(index)
+	    || !index->is_committed()) {
 		return(ULINT_UNDEFINED);
 	}
 
@@ -1310,7 +657,7 @@ btr_page_free_for_ibuf(
 {
 	page_t*		root;
 
-	ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
+	ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table));
 	root = btr_root_get(index, mtr);
 
 	flst_add_first(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
@@ -1323,27 +670,24 @@ btr_page_free_for_ibuf(
 
 /**************************************************************//**
 Frees a file page used in an index tree. Can be used also to (BLOB)
-external storage pages, because the page level 0 can be given as an
-argument. */
-UNIV_INTERN
+external storage pages. */
 void
 btr_page_free_low(
 /*==============*/
 	dict_index_t*	index,	/*!< in: index tree */
 	buf_block_t*	block,	/*!< in: block to be freed, x-latched */
-	ulint		level,	/*!< in: page level */
+	ulint		level,	/*!< in: page level (ULINT_UNDEFINED=BLOB) */
 	bool		blob,   /*!< in: blob page */
 	mtr_t*		mtr)	/*!< in: mtr */
 {
 	fseg_header_t*	seg_header;
 	page_t*		root;
 
-	ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
+	ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table));
 	/* The page gets invalid for optimistic searches: increment the frame
 	modify clock */
 
 	buf_block_modify_clock_inc(block);
-	btr_blob_dbg_assert_empty(index, buf_block_get_page_no(block));
 
 	if (blob) {
 		ut_a(level == 0);
@@ -1424,12 +768,19 @@ btr_page_free_low(
 
 	root = btr_root_get(index, mtr);
 
-	if (level == 0) {
+	if (level == 0 || level == ULINT_UNDEFINED) {
 		seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_LEAF;
 	} else {
 		seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_TOP;
 	}
 
+#ifdef UNIV_GIS_DEBUG
+	if (dict_index_is_spatial(index)) {
+		fprintf(stderr, "GIS_DIAG: Freed  %ld\n",
+			(long) block->page.id.page_no());
+	}
+#endif
+
 	if (scrub) {
 		/**
 		* Reset page type so that scrub thread won't try to scrub it
@@ -1439,13 +790,14 @@ btr_page_free_low(
 	}
 
 	fseg_free_page(seg_header,
-		       buf_block_get_space(block),
-		       buf_block_get_page_no(block), mtr);
+		       block->page.id.space(),
+		       block->page.id.page_no(),
+		       level != ULINT_UNDEFINED, mtr);
 
 	/* The page was marked free in the allocation bitmap, but it
 	should remain buffer-fixed until mtr_commit(mtr) or until it
 	is explicitly freed from the mini-transaction. */
-	ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
+	ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table));
 	/* TODO: Discard any operations on the page from the redo log
 	and remove the block from the flush list and the buffer pool.
 	This would free up buffer pool earlier and reduce writes to
@@ -1455,7 +807,6 @@ btr_page_free_low(
 /**************************************************************//**
 Frees a file page used in an index tree. NOTE: cannot free field external
 storage pages because the page must contain info on its level. */
-UNIV_INTERN
 void
 btr_page_free(
 /*==========*/
@@ -1466,7 +817,8 @@ btr_page_free(
 	const page_t*	page	= buf_block_get_frame(block);
 	ulint		level	= btr_page_get_level(page, mtr);
 
-	ut_ad(fil_page_get_type(block->frame) == FIL_PAGE_INDEX);
+	ut_ad(fil_page_index_page_check(block->frame));
+	ut_ad(level != ULINT_UNDEFINED);
 	btr_page_free_low(index, block, level, false, mtr);
 }
 
@@ -1506,8 +858,8 @@ btr_node_ptr_set_child_page_no(
 }
 
 /************************************************************//**
-Returns the child page of a node pointer and x-latches it.
- at return	child page, x-latched */
+Returns the child page of a node pointer and sx-latches it.
+ at return child page, sx-latched */
 static
 buf_block_t*
 btr_node_ptr_get_child(
@@ -1517,21 +869,20 @@ btr_node_ptr_get_child(
 	const ulint*	offsets,/*!< in: array returned by rec_get_offsets() */
 	mtr_t*		mtr)	/*!< in: mtr */
 {
-	ulint	page_no;
-	ulint	space;
-
 	ut_ad(rec_offs_validate(node_ptr, index, offsets));
-	space = page_get_space_id(page_align(node_ptr));
-	page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
 
-	return(btr_block_get(space, dict_table_zip_size(index->table),
-			     page_no, RW_X_LATCH, index, mtr));
+	const page_id_t	page_id(
+		page_get_space_id(page_align(node_ptr)),
+		btr_node_ptr_get_child_page_no(node_ptr, offsets));
+
+	return(btr_block_get(page_id, dict_table_page_size(index->table),
+			     RW_SX_LATCH, index, mtr));
 }
 
 /************************************************************//**
 Returns the upper level node pointer to a page. It is assumed that mtr holds
-an x-latch on the tree.
- at return	rec_get_offsets() of the node pointer record */
+an sx-latch on the tree.
+ at return rec_get_offsets() of the node pointer record */
 static
 ulint*
 btr_page_get_father_node_ptr_func(
@@ -1541,6 +892,8 @@ btr_page_get_father_node_ptr_func(
 	btr_cur_t*	cursor,	/*!< in: cursor pointing to user record,
 				out: cursor on node pointer record,
 				its page x-latched */
+	ulint		latch_mode,/*!< in: BTR_CONT_MODIFY_TREE
+				or BTR_CONT_SEARCH_TREE */
 	const char*	file,	/*!< in: file name */
 	ulint		line,	/*!< in: line where called */
 	mtr_t*		mtr)	/*!< in: mtr */
@@ -1552,11 +905,17 @@ btr_page_get_father_node_ptr_func(
 	ulint		page_no;
 	dict_index_t*	index;
 
-	page_no = buf_block_get_page_no(btr_cur_get_block(cursor));
+	ut_ad(latch_mode == BTR_CONT_MODIFY_TREE
+	      || latch_mode == BTR_CONT_SEARCH_TREE);
+
+	page_no = btr_cur_get_block(cursor)->page.id.page_no();
 	index = btr_cur_get_index(cursor);
 
-	ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
-				MTR_MEMO_X_LOCK));
+	ut_ad(srv_read_only_mode
+	      || mtr_memo_contains_flagged(mtr, dict_index_get_lock(index),
+					   MTR_MEMO_X_LOCK
+					   | MTR_MEMO_SX_LOCK)
+	      || dict_table_is_intrinsic(index->table));
 
 	ut_ad(dict_index_get_page(index) != page_no);
 
@@ -1566,9 +925,38 @@ btr_page_get_father_node_ptr_func(
 	ut_a(page_rec_is_user_rec(user_rec));
 	tuple = dict_index_build_node_ptr(index, user_rec, 0, heap, level);
 
-	btr_cur_search_to_nth_level(index, level + 1, tuple, PAGE_CUR_LE,
-				    BTR_CONT_MODIFY_TREE, cursor, 0,
-				    file, line, mtr);
+	if (!dict_index_is_spatial(index)) {
+		dberr_t err = DB_SUCCESS;
+		if (dict_table_is_intrinsic(index->table)) {
+			err = btr_cur_search_to_nth_level_with_no_latch(
+				index, level + 1, tuple, PAGE_CUR_LE, cursor,
+				file, line, mtr);
+		} else {
+			err = btr_cur_search_to_nth_level(
+				index, level + 1, tuple,
+				PAGE_CUR_LE, latch_mode, cursor, 0,
+				file, line, mtr);
+		}
+
+		if (err != DB_SUCCESS) {
+			ib::warn() << " Error code: " << err
+				   << " btr_page_get_father_node_ptr_func "
+				   << " level: " << level + 1
+				   << " called from file: "
+				   << file << " line: " << line
+				   << " table: " << index->table->name
+				   << " index: " << index->name;
+		}
+	} else {
+		/* For R-tree, only latch mode from caller would be
+		BTR_CONT_MODIFY_TREE */
+		ut_ad(latch_mode == BTR_CONT_MODIFY_TREE);
+
+		/* Try to avoid traverse from the root, and get the
+		father node from parent_path vector */
+		rtr_get_father_node(index, level + 1, tuple,
+				    NULL, cursor, page_no, mtr);
+	}
 
 	node_ptr = btr_cur_get_rec(cursor);
 	ut_ad(!page_rec_is_comp(node_ptr)
@@ -1578,22 +966,15 @@ btr_page_get_father_node_ptr_func(
 
 	if (btr_node_ptr_get_child_page_no(node_ptr, offsets) != page_no) {
 		rec_t*	print_rec;
-		fputs("InnoDB: Dump of the child page:\n", stderr);
-		buf_page_print(page_align(user_rec), 0,
-			       BUF_PAGE_PRINT_NO_CRASH);
-		fputs("InnoDB: Dump of the parent page:\n", stderr);
-		buf_page_print(page_align(node_ptr), 0,
-			       BUF_PAGE_PRINT_NO_CRASH);
-
-		fputs("InnoDB: Corruption of an index tree: table ", stderr);
-		ut_print_name(stderr, NULL, TRUE, index->table_name);
-		fputs(", index ", stderr);
-		ut_print_name(stderr, NULL, FALSE, index->name);
-		fprintf(stderr, ",\n"
-			"InnoDB: father ptr page no %lu, child page no %lu\n",
-			(ulong)
-			btr_node_ptr_get_child_page_no(node_ptr, offsets),
-			(ulong) page_no);
+
+		ib::error()
+			<< "Corruption of an index tree: table "
+			<< index->table->name
+			<< " index " << index->name
+			<< ", father ptr page no "
+			<< btr_node_ptr_get_child_page_no(node_ptr, offsets)
+			<< ", child page no " << page_no;
+
 		print_rec = page_rec_get_next(
 			page_get_infimum_rec(page_align(user_rec)));
 		offsets = rec_get_offsets(print_rec, index,
@@ -1603,27 +984,28 @@ btr_page_get_father_node_ptr_func(
 					  ULINT_UNDEFINED, &heap);
 		page_rec_print(node_ptr, offsets);
 
-		fputs("InnoDB: You should dump + drop + reimport the table"
-		      " to fix the\n"
-		      "InnoDB: corruption. If the crash happens at "
-		      "the database startup, see\n"
-		      "InnoDB: " REFMAN "forcing-innodb-recovery.html about\n"
-		      "InnoDB: forcing recovery. "
-		      "Then dump + drop + reimport.\n", stderr);
-
-		ut_error;
+		ib::fatal()
+			<< "You should dump + drop + reimport the table to"
+			<< " fix the corruption. If the crash happens at"
+			<< " database startup. " << FORCE_RECOVERY_MSG
+			<< " Then dump + drop + reimport.";
 	}
 
 	return(offsets);
 }
 
 #define btr_page_get_father_node_ptr(of,heap,cur,mtr)			\
-	btr_page_get_father_node_ptr_func(of,heap,cur,__FILE__,__LINE__,mtr)
+	btr_page_get_father_node_ptr_func(				\
+		of,heap,cur,BTR_CONT_MODIFY_TREE,__FILE__,__LINE__,mtr)
+
+#define btr_page_get_father_node_ptr_for_validate(of,heap,cur,mtr)	\
+	btr_page_get_father_node_ptr_func(				\
+		of,heap,cur,BTR_CONT_SEARCH_TREE,__FILE__,__LINE__,mtr)
 
 /************************************************************//**
 Returns the upper level node pointer to a page. It is assumed that mtr holds
 an x-latch on the tree.
- at return	rec_get_offsets() of the node pointer record */
+ at return rec_get_offsets() of the node pointer record */
 static
 ulint*
 btr_page_get_father_block(
@@ -1667,26 +1049,123 @@ btr_page_get_father(
 	mem_heap_free(heap);
 }
 
-/************************************************************//**
-Creates the root node for a new index tree.
- at return	page number of the created root, FIL_NULL if did not succeed */
-UNIV_INTERN
+/** Free a B-tree root page. btr_free_but_not_root() must already
+have been called.
+In a persistent tablespace, the caller must invoke fsp_init_file_page()
+before mtr.commit().
+ at param[in,out]	block	index root page
+ at param[in,out]	mtr	mini-transaction */
+static
+void
+btr_free_root(
+	buf_block_t*	block,
+	mtr_t*		mtr)
+{
+	fseg_header_t*	header;
+
+	ut_ad(mtr_memo_contains_flagged(mtr, block, MTR_MEMO_PAGE_X_FIX));
+	ut_ad(mtr->is_named_space(block->page.id.space()));
+
+	btr_search_drop_page_hash_index(block);
+
+	header = buf_block_get_frame(block) + PAGE_HEADER + PAGE_BTR_SEG_TOP;
+#ifdef UNIV_BTR_DEBUG
+	ut_a(btr_root_fseg_validate(header, block->page.id.space()));
+#endif /* UNIV_BTR_DEBUG */
+
+	while (!fseg_free_step(header, true, mtr)) {
+		/* Free the entire segment in small steps. */
+	}
+}
+
+/** PAGE_INDEX_ID value for freed index B-trees */
+static const index_id_t	BTR_FREED_INDEX_ID = 0;
+
+/** Invalidate an index root page so that btr_free_root_check()
+will not find it.
+ at param[in,out]	block	index root page
+ at param[in,out]	mtr	mini-transaction */
+static
+void
+btr_free_root_invalidate(
+	buf_block_t*	block,
+	mtr_t*		mtr)
+{
+	ut_ad(page_is_root(block->frame));
+
+	btr_page_set_index_id(
+		buf_block_get_frame(block),
+		buf_block_get_page_zip(block),
+		BTR_FREED_INDEX_ID, mtr);
+}
+
+/** Prepare to free a B-tree.
+ at param[in]	page_id		page id
+ at param[in]	page_size	page size
+ at param[in]	index_id	PAGE_INDEX_ID contents
+ at param[in,out]	mtr		mini-transaction
+ at return root block, to invoke btr_free_but_not_root() and btr_free_root()
+ at retval NULL if the page is no longer a matching B-tree page */
+static __attribute__((warn_unused_result))
+buf_block_t*
+btr_free_root_check(
+	const page_id_t&	page_id,
+	const page_size_t&	page_size,
+	index_id_t		index_id,
+	mtr_t*			mtr)
+{
+	ut_ad(page_id.space() != srv_tmp_space.space_id());
+	ut_ad(index_id != BTR_FREED_INDEX_ID);
+
+	buf_block_t*	block = buf_page_get(
+		page_id, page_size, RW_X_LATCH, mtr);
+
+	if (block) {
+		buf_block_dbg_add_level(block, SYNC_TREE_NODE);
+
+		if (fil_page_index_page_check(block->frame)
+			&& index_id == btr_page_get_index_id(block->frame)) {
+			/* This should be a root page.
+			It should not be possible to reassign the same
+			index_id for some other index in the tablespace. */
+			ut_ad(page_is_root(block->frame));
+		} else {
+			block = NULL;
+		}
+	}
+
+	return(block);
+}
+
+/** Create the root node for a new index tree.
+ at param[in]	type			type of the index
+ at param[in]	space			space where created
+ at param[in]	page_size		page size
+ at param[in]	index_id		index id
+ at param[in]	index			index, or NULL when applying TRUNCATE
+log record during recovery
+ at param[in]	btr_redo_create_info	used for applying TRUNCATE log
+ at param[in]	mtr			mini-transaction handle
+record during recovery
+ at return page number of the created root, FIL_NULL if did not succeed */
 ulint
 btr_create(
-/*=======*/
-	ulint		type,	/*!< in: type of the index */
-	ulint		space,	/*!< in: space where created */
-	ulint		zip_size,/*!< in: compressed page size in bytes
-				or 0 for uncompressed pages */
-	index_id_t	index_id,/*!< in: index id */
-	dict_index_t*	index,	/*!< in: index */
-	mtr_t*		mtr)	/*!< in: mini-transaction handle */
+	ulint			type,
+	ulint			space,
+	const page_size_t&	page_size,
+	index_id_t		index_id,
+	dict_index_t*		index,
+	const btr_create_t*	btr_redo_create_info,
+	mtr_t*			mtr)
 {
-	ulint		page_no;
-	buf_block_t*	block;
-	buf_frame_t*	frame;
-	page_t*		page;
-	page_zip_des_t*	page_zip;
+	ulint			page_no;
+	buf_block_t*		block;
+	buf_frame_t*		frame;
+	page_t*			page;
+	page_zip_des_t*		page_zip;
+
+	ut_ad(mtr->is_named_space(space));
+	ut_ad(index_id != BTR_FREED_INDEX_ID);
 
 	/* Create the two new segments (one, in the case of an ibuf tree) for
 	the index tree; the segment headers are put on the allocated root page
@@ -1699,10 +1178,14 @@ btr_create(
 			space, 0,
 			IBUF_HEADER + IBUF_TREE_SEG_HEADER, mtr);
 
+		if (ibuf_hdr_block == NULL) {
+			return(FIL_NULL);
+		}
+
 		buf_block_dbg_add_level(
 			ibuf_hdr_block, SYNC_IBUF_TREE_NODE_NEW);
 
-		ut_ad(buf_block_get_page_no(ibuf_hdr_block)
+		ut_ad(ibuf_hdr_block->page.id.page_no()
 		      == IBUF_HEADER_PAGE_NO);
 		/* Allocate then the next page to the segment: it will be the
 		tree root page */
@@ -1712,16 +1195,8 @@ btr_create(
 			+ IBUF_HEADER + IBUF_TREE_SEG_HEADER,
 			IBUF_TREE_ROOT_PAGE_NO,
 			FSP_UP, mtr);
-		ut_ad(buf_block_get_page_no(block) == IBUF_TREE_ROOT_PAGE_NO);
+		ut_ad(block->page.id.page_no() == IBUF_TREE_ROOT_PAGE_NO);
 	} else {
-#ifdef UNIV_BLOB_DEBUG
-		if ((type & DICT_CLUSTERED) && !index->blobs) {
-			mutex_create(PFS_NOT_INSTRUMENTED,
-				     &index->blobs_mutex, SYNC_ANY_LATCH);
-			index->blobs = rbt_create(sizeof(btr_blob_dbg_t),
-						  btr_blob_dbg_cmp);
-		}
-#endif /* UNIV_BLOB_DEBUG */
 		block = fseg_create(space, 0,
 				    PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr);
 	}
@@ -1731,7 +1206,7 @@ btr_create(
 		return(FIL_NULL);
 	}
 
-	page_no = buf_block_get_page_no(block);
+	page_no = block->page.id.page_no();
 	frame = buf_block_get_frame(block);
 
 	if (type & DICT_IBUF) {
@@ -1750,7 +1225,10 @@ btr_create(
 				 PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr)) {
 			/* Not enough space for new segment, free root
 			segment before return. */
-			btr_free_root(space, zip_size, page_no, mtr);
+			btr_free_root(block, mtr);
+			if (!dict_table_is_temporary(index->table)) {
+				btr_free_root_invalidate(block, mtr);
+			}
 
 			return(FIL_NULL);
 		}
@@ -1764,16 +1242,48 @@ btr_create(
 	page_zip = buf_block_get_page_zip(block);
 
 	if (page_zip) {
-		page = page_create_zip(block, index, 0, 0, mtr);
+		if (index != NULL) {
+			page = page_create_zip(block, index, 0, 0, NULL, mtr);
+		} else {
+			/* Create a compressed index page when applying
+			TRUNCATE log record during recovery */
+			ut_ad(btr_redo_create_info != NULL);
+
+			redo_page_compress_t	page_comp_info;
+
+			page_comp_info.type = type;
+
+			page_comp_info.index_id = index_id;
+
+			page_comp_info.n_fields =
+				btr_redo_create_info->n_fields;
+
+			page_comp_info.field_len =
+				btr_redo_create_info->field_len;
+
+			page_comp_info.fields = btr_redo_create_info->fields;
+
+			page_comp_info.trx_id_pos =
+				btr_redo_create_info->trx_id_pos;
+
+			page = page_create_zip(block, NULL, 0, 0,
+					       &page_comp_info, mtr);
+		}
 	} else {
-		page = page_create(block, mtr,
-				   dict_table_is_comp(index->table));
+		if (index != NULL) {
+			page = page_create(block, mtr,
+					   dict_table_is_comp(index->table),
+					   dict_index_is_spatial(index));
+		} else {
+			ut_ad(btr_redo_create_info != NULL);
+			page = page_create(
+				block, mtr, btr_redo_create_info->format_flags,
+				type == DICT_SPATIAL);
+		}
 		/* Set the level of the new index page */
 		btr_page_set_level(page, NULL, 0, mtr);
 	}
 
-	block->check_index_page_at_flush = TRUE;
-
 	/* Set the index id of the page */
 	btr_page_set_index_id(page, page_zip, index_id, mtr);
 
@@ -1783,9 +1293,16 @@ btr_create(
 
 	/* We reset the free bits for the page to allow creation of several
 	trees in the same mtr, otherwise the latch on a bitmap page would
-	prevent it because of the latching order */
+	prevent it because of the latching order.
+
+	index will be NULL if we are recreating the table during recovery
+	on behalf of TRUNCATE.
+
+	Note: Insert Buffering is disabled for temporary tables given that
+	most temporary tables are smaller in size and short-lived. */
+	if (!(type & DICT_CLUSTERED)
+	    && (index == NULL || !dict_table_is_temporary(index->table))) {
 
-	if (!(type & DICT_CLUSTERED)) {
 		ibuf_reset_free_bits(block);
 	}
 
@@ -1798,39 +1315,39 @@ btr_create(
 	return(page_no);
 }
 
-/************************************************************//**
-Frees a B-tree except the root page, which MUST be freed after this
-by calling btr_free_root. */
-UNIV_INTERN
+/** Free a B-tree except the root page. The root page MUST be freed after
+this by calling btr_free_root.
+ at param[in,out]	block		root page
+ at param[in]	log_mode	mtr logging mode */
+static
 void
 btr_free_but_not_root(
-/*==================*/
-	ulint	space,		/*!< in: space where created */
-	ulint	zip_size,	/*!< in: compressed page size in bytes
-				or 0 for uncompressed pages */
-	ulint	root_page_no)	/*!< in: root page number */
+	buf_block_t*	block,
+	mtr_log_t	log_mode)
 {
 	ibool	finished;
-	page_t*	root;
 	mtr_t	mtr;
 
+	ut_ad(page_is_root(block->frame));
 leaf_loop:
 	mtr_start(&mtr);
+	mtr_set_log_mode(&mtr, log_mode);
+	mtr.set_named_space(block->page.id.space());
+
+	page_t*	root = block->frame;
 
-	root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH,
-			    NULL, &mtr);
 #ifdef UNIV_BTR_DEBUG
 	ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
-				    + root, space));
+				    + root, block->page.id.space()));
 	ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_TOP
-				    + root, space));
+				    + root, block->page.id.space()));
 #endif /* UNIV_BTR_DEBUG */
 
 	/* NOTE: page hash indexes are dropped when a page is freed inside
 	fsp0fsp. */
 
 	finished = fseg_free_step(root + PAGE_HEADER + PAGE_BTR_SEG_LEAF,
-				  &mtr);
+				  true, &mtr);
 	mtr_commit(&mtr);
 
 	if (!finished) {
@@ -1839,16 +1356,18 @@ btr_free_but_not_root(
 	}
 top_loop:
 	mtr_start(&mtr);
+	mtr_set_log_mode(&mtr, log_mode);
+	mtr.set_named_space(block->page.id.space());
+
+	root = block->frame;
 
-	root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH,
-			    NULL, &mtr);
 #ifdef UNIV_BTR_DEBUG
 	ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_TOP
-				    + root, space));
+				    + root, block->page.id.space()));
 #endif /* UNIV_BTR_DEBUG */
 
 	finished = fseg_free_step_not_header(
-		root + PAGE_HEADER + PAGE_BTR_SEG_TOP, &mtr);
+		root + PAGE_HEADER + PAGE_BTR_SEG_TOP, true, &mtr);
 	mtr_commit(&mtr);
 
 	if (!finished) {
@@ -1857,34 +1376,51 @@ btr_free_but_not_root(
 	}
 }
 
-/************************************************************//**
-Frees the B-tree root page. Other tree MUST already have been freed. */
-UNIV_INTERN
+/** Free a persistent index tree if it exists.
+ at param[in]	page_id		root page id
+ at param[in]	page_size	page size
+ at param[in]	index_id	PAGE_INDEX_ID contents
+ at param[in,out]	mtr		mini-transaction */
 void
-btr_free_root(
-/*==========*/
-	ulint	space,		/*!< in: space where created */
-	ulint	zip_size,	/*!< in: compressed page size in bytes
-				or 0 for uncompressed pages */
-	ulint	root_page_no,	/*!< in: root page number */
-	mtr_t*	mtr)		/*!< in/out: mini-transaction */
+btr_free_if_exists(
+	const page_id_t&	page_id,
+	const page_size_t&	page_size,
+	index_id_t		index_id,
+	mtr_t*			mtr)
 {
-	buf_block_t*	block;
-	fseg_header_t*	header;
+	buf_block_t* root = btr_free_root_check(
+		page_id, page_size, index_id, mtr);
 
-	block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH,
-			      NULL, mtr);
+	if (root == NULL) {
+		return;
+	}
 
-	btr_search_drop_page_hash_index(block);
+	btr_free_but_not_root(root, mtr->get_log_mode());
+	mtr->set_named_space(page_id.space());
+	btr_free_root(root, mtr);
+	btr_free_root_invalidate(root, mtr);
+}
 
-	header = buf_block_get_frame(block) + PAGE_HEADER + PAGE_BTR_SEG_TOP;
-#ifdef UNIV_BTR_DEBUG
-	ut_a(btr_root_fseg_validate(header, space));
-#endif /* UNIV_BTR_DEBUG */
+/** Free an index tree in a temporary tablespace or during TRUNCATE TABLE.
+ at param[in]	page_id		root page id
+ at param[in]	page_size	page size */
+void
+btr_free(
+	const page_id_t&	page_id,
+	const page_size_t&	page_size)
+{
+	mtr_t		mtr;
+	mtr.start();
+	mtr.set_log_mode(MTR_LOG_NO_REDO);
 
-	while (!fseg_free_step(header, mtr)) {
-		/* Free the entire segment in small steps. */
-	}
+	buf_block_t*	block = buf_page_get(
+		page_id, page_size, RW_X_LATCH, &mtr);
+
+	ut_ad(page_is_root(block->frame));
+
+	btr_free_but_not_root(block, MTR_LOG_NO_REDO);
+	btr_free_root(block, &mtr);
+	mtr.commit();
 }
 #endif /* !UNIV_HOTBACKUP */
 
@@ -1899,7 +1435,6 @@ IBUF_BITMAP_FREE is unaffected by reorganization.
 
 @retval true if the operation was successful
 @retval false if it is a compressed page, and recompression failed */
-UNIV_INTERN
 bool
 btr_page_reorganize_low(
 /*====================*/
@@ -1922,7 +1457,6 @@ btr_page_reorganize_low(
 	page_zip_des_t*	page_zip	= buf_block_get_page_zip(block);
 	buf_block_t*	temp_block;
 	page_t*		temp_page;
-	ulint		log_mode;
 	ulint		data_size1;
 	ulint		data_size2;
 	ulint		max_ins_size1;
@@ -1930,8 +1464,9 @@ btr_page_reorganize_low(
 	bool		success		= false;
 	ulint		pos;
 	bool		log_compressed;
+	bool		is_spatial;
 
-	ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
+	ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table));
 	btr_assert_not_corrupted(block, index);
 #ifdef UNIV_ZIP_DEBUG
 	ut_a(!page_zip || page_zip_validate(page_zip, page, index));
@@ -1940,7 +1475,7 @@ btr_page_reorganize_low(
 	max_ins_size1 = page_get_max_insert_size_after_reorganize(page, 1);
 
 	/* Turn logging off */
-	log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);
+	mtr_log_t	log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);
 
 #ifndef UNIV_HOTBACKUP
 	temp_block = buf_block_alloc(buf_pool);
@@ -1952,6 +1487,11 @@ btr_page_reorganize_low(
 
 	MONITOR_INC(MONITOR_INDEX_REORG_ATTEMPTS);
 
+	/* This function can be called by log redo with a "dummy" index.
+	So we would trust more on the original page's type */
+	is_spatial = (fil_page_get_type(page) == FIL_PAGE_RTREE
+		      || dict_index_is_spatial(index));
+
 	/* Copy the old page to temporary space */
 	buf_frame_copy(temp_page, page);
 
@@ -1959,10 +1499,7 @@ btr_page_reorganize_low(
 	if (!recovery) {
 		btr_search_drop_page_hash_index(block);
 	}
-
-	block->check_index_page_at_flush = TRUE;
 #endif /* !UNIV_HOTBACKUP */
-	btr_blob_dbg_remove(page, index, "btr_page_reorganize");
 
 	/* Save the cursor position. */
 	pos = page_rec_get_n_recs_before(page_cur_get_rec(cursor));
@@ -1970,7 +1507,7 @@ btr_page_reorganize_low(
 	/* Recreate the page: note that global data on page (possible
 	segment headers, next page-field, etc.) is preserved intact */
 
-	page_create(block, mtr, dict_table_is_comp(index->table));
+	page_create(block, mtr, dict_table_is_comp(index->table), is_spatial);
 
 	/* Copy the records from the temporary space to the recreated page;
 	do not copy the lock bits yet */
@@ -1979,7 +1516,13 @@ btr_page_reorganize_low(
 					page_get_infimum_rec(temp_page),
 					index, mtr);
 
-	if (dict_index_is_sec_or_ibuf(index) && page_is_leaf(page)) {
+	/* Multiple transactions cannot simultaneously operate on the
+	same temp-table in parallel.
+	max_trx_id is ignored for temp tables because it not required
+	for MVCC. */
+	if (dict_index_is_sec_or_ibuf(index)
+	    && page_is_leaf(page)
+	    && !dict_table_is_temporary(index->table)) {
 		/* Copy max trx id to recreated page */
 		trx_id_t	max_trx_id = page_get_max_trx_id(temp_page);
 		page_set_max_trx_id(block, NULL, max_trx_id, mtr);
@@ -1998,12 +1541,9 @@ btr_page_reorganize_low(
 	}
 
 	if (page_zip
-	    && !page_zip_compress(page_zip, page, index, z_level, mtr)) {
+	    && !page_zip_compress(page_zip, page, index, z_level, NULL, mtr)) {
 
 		/* Restore the old page and exit. */
-		btr_blob_dbg_restore(page, temp_page, index,
-				     "btr_page_reorganize_compress_fail");
-
 #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
 		/* Check that the bytes that we skip are identical. */
 		ut_a(!memcmp(page, temp_page, PAGE_HEADER));
@@ -2028,7 +1568,8 @@ btr_page_reorganize_low(
 	}
 
 #ifndef UNIV_HOTBACKUP
-	if (!recovery) {
+	/* No locks are acquried for intrinsic tables. */
+	if (!recovery && !dict_table_is_locking_disabled(index->table)) {
 		/* Update the record lock bitmaps */
 		lock_move_reorganize_page(block, temp_block);
 	}
@@ -2038,19 +1579,13 @@ btr_page_reorganize_low(
 	max_ins_size2 = page_get_max_insert_size_after_reorganize(page, 1);
 
 	if (data_size1 != data_size2 || max_ins_size1 != max_ins_size2) {
-		buf_page_print(page, 0, BUF_PAGE_PRINT_NO_CRASH);
-		buf_page_print(temp_page, 0, BUF_PAGE_PRINT_NO_CRASH);
+		ib::error()
+			<< "Page old data size " << data_size1
+			<< " new data size " << data_size2
+			<< ", page old max ins size " << max_ins_size1
+			<< " new max ins size " << max_ins_size2;
 
-		fprintf(stderr,
-			"InnoDB: Error: page old data size %lu"
-			" new data size %lu\n"
-			"InnoDB: Error: page old max ins size %lu"
-			" new max ins size %lu\n"
-			"InnoDB: Submit a detailed bug report"
-			" to http://bugs.mysql.com\n",
-			(unsigned long) data_size1, (unsigned long) data_size2,
-			(unsigned long) max_ins_size1,
-			(unsigned long) max_ins_size2);
+		ib::error() << BUG_REPORT_MSG;
 		ut_ad(0);
 	} else {
 		success = true;
@@ -2076,8 +1611,8 @@ btr_page_reorganize_low(
 
 #ifndef UNIV_HOTBACKUP
 	if (success) {
-		byte	type;
-		byte*	log_ptr;
+		mlog_id_t	type;
+		byte*		log_ptr;
 
 		/* Write the log record */
 		if (page_zip) {
@@ -2152,7 +1687,6 @@ IBUF_BITMAP_FREE is unaffected by reorganization.
 
 @retval true if the operation was successful
 @retval false if it is a compressed page, and recompression failed */
-UNIV_INTERN
 bool
 btr_page_reorganize(
 /*================*/
@@ -2167,8 +1701,7 @@ btr_page_reorganize(
 
 /***********************************************************//**
 Parses a redo log record of reorganizing a page.
- at return	end of log record or NULL */
-UNIV_INTERN
+ at return end of log record or NULL */
 byte*
 btr_parse_page_reorganize(
 /*======================*/
@@ -2183,6 +1716,7 @@ btr_parse_page_reorganize(
 
 	ut_ad(ptr != NULL);
 	ut_ad(end_ptr != NULL);
+	ut_ad(index != NULL);
 
 	/* If dealing with a compressed page the record has the
 	compression level used during original compression written in
@@ -2222,26 +1756,24 @@ btr_page_empty(
 {
 	page_t*	page = buf_block_get_frame(block);
 
-	ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
+	ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table));
 	ut_ad(page_zip == buf_block_get_page_zip(block));
 #ifdef UNIV_ZIP_DEBUG
 	ut_a(!page_zip || page_zip_validate(page_zip, page, index));
 #endif /* UNIV_ZIP_DEBUG */
 
 	btr_search_drop_page_hash_index(block);
-	btr_blob_dbg_remove(page, index, "btr_page_empty");
 
 	/* Recreate the page: note that global data on page (possible
 	segment headers, next page-field, etc.) is preserved intact */
 
 	if (page_zip) {
-		page_create_zip(block, index, level, 0, mtr);
+		page_create_zip(block, index, level, 0, NULL, mtr);
 	} else {
-		page_create(block, mtr, dict_table_is_comp(index->table));
+		page_create(block, mtr, dict_table_is_comp(index->table),
+			    dict_index_is_spatial(index));
 		btr_page_set_level(page, NULL, level, mtr);
 	}
-
-	block->check_index_page_at_flush = TRUE;
 }
 
 /*************************************************************//**
@@ -2251,7 +1783,6 @@ NOTE that the operation of this function must always succeed,
 we cannot reverse it: therefore enough free disk space must be
 guaranteed to be available before this function is called.
 @return	inserted record or NULL if run out of space */
-UNIV_INTERN
 rec_t*
 btr_root_raise_and_insert(
 /*======================*/
@@ -2300,9 +1831,12 @@ btr_root_raise_and_insert(
 
 	ut_a(dict_index_get_page(index) == page_get_page_no(root));
 #endif /* UNIV_BTR_DEBUG */
-	ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
-				MTR_MEMO_X_LOCK));
-	ut_ad(mtr_memo_contains(mtr, root_block, MTR_MEMO_PAGE_X_FIX));
+	ut_ad(mtr_memo_contains_flagged(mtr, dict_index_get_lock(index),
+					MTR_MEMO_X_LOCK
+					| MTR_MEMO_SX_LOCK)
+	      || dict_table_is_intrinsic(index->table));
+	ut_ad(mtr_is_block_fix(
+		mtr, root_block, MTR_MEMO_PAGE_X_FIX, index->table));
 
 	/* Allocate a new page to the tree. Root splitting is done by first
 	moving the root records to the new page, emptying the root, putting
@@ -2346,8 +1880,15 @@ btr_root_raise_and_insert(
 
 		/* Update the lock table and possible hash index. */
 
-		lock_move_rec_list_end(new_block, root_block,
-				       page_get_infimum_rec(root));
+		if (!dict_table_is_locking_disabled(index->table)) {
+			lock_move_rec_list_end(new_block, root_block,
+					       page_get_infimum_rec(root));
+		}
+
+		/* Move any existing predicate locks */
+		if (dict_index_is_spatial(index)) {
+			lock_prdt_rec_move(new_block, root_block);
+		}
 
 		btr_search_move_or_delete_hash_entries(new_block, root_block,
 						       index);
@@ -2358,7 +1899,9 @@ btr_root_raise_and_insert(
 	information of the record to be inserted on the infimum of the
 	root page: we cannot discard the lock structs on the root page */
 
-	lock_update_root_raise(new_block, root_block);
+	if (!dict_table_is_locking_disabled(index->table)) {
+		lock_update_root_raise(new_block, root_block);
+	}
 
 	/* Create a memory heap where the node pointer is stored */
 	if (!*heap) {
@@ -2366,13 +1909,20 @@ btr_root_raise_and_insert(
 	}
 
 	rec = page_rec_get_next(page_get_infimum_rec(new_page));
-	new_page_no = buf_block_get_page_no(new_block);
+	new_page_no = new_block->page.id.page_no();
 
 	/* Build the node pointer (= node key and page address) for the
 	child */
+	if (dict_index_is_spatial(index)) {
+		rtr_mbr_t		new_mbr;
 
-	node_ptr = dict_index_build_node_ptr(
-		index, rec, new_page_no, *heap, level);
+		rtr_page_cal_mbr(index, new_block, &new_mbr, *heap);
+		node_ptr = rtr_index_build_node_ptr(
+			index, &new_mbr, rec, new_page_no, *heap, level);
+	} else {
+		node_ptr = dict_index_build_node_ptr(
+			index, rec, new_page_no, *heap, level);
+	}
 	/* The node pointer must be marked as the predefined minimum record,
 	as there is no lower alphabetical limit to records in the leftmost
 	node of a level: */
@@ -2406,33 +1956,34 @@ btr_root_raise_and_insert(
 
 	/* We play safe and reset the free bits for the new page */
 
-#if 0
-	fprintf(stderr, "Root raise new page no %lu\n", new_page_no);
-#endif
-
-	if (!dict_index_is_clust(index)) {
+	if (!dict_index_is_clust(index)
+	    && !dict_table_is_temporary(index->table)) {
 		ibuf_reset_free_bits(new_block);
 	}
 
 	if (tuple != NULL) {
 		/* Reposition the cursor to the child node */
-		page_cur_search(new_block, index, tuple,
-				PAGE_CUR_LE, page_cursor);
+		page_cur_search(new_block, index, tuple, page_cursor);
 	} else {
 		/* Set cursor to first record on child node */
 		page_cur_set_before_first(new_block, page_cursor);
 	}
 
 	/* Split the child and insert tuple */
-	return(btr_page_split_and_insert(flags, cursor, offsets, heap,
-					 tuple, n_ext, mtr));
+	if (dict_index_is_spatial(index)) {
+		/* Split rtree page and insert tuple */
+		return(rtr_page_split_and_insert(flags, cursor, offsets, heap,
+						 tuple, n_ext, mtr));
+	} else {
+		return(btr_page_split_and_insert(flags, cursor, offsets, heap,
+						 tuple, n_ext, mtr));
+	}
 }
 
 /*************************************************************//**
 Decides if the page should be split at the convergence point of inserts
 converging to the left.
- at return	TRUE if split recommended */
-UNIV_INTERN
+ at return TRUE if split recommended */
 ibool
 btr_page_get_split_rec_to_left(
 /*===========================*/
@@ -2476,8 +2027,7 @@ btr_page_get_split_rec_to_left(
 /*************************************************************//**
 Decides if the page should be split at the convergence point of inserts
 converging to the right.
- at return	TRUE if split recommended */
-UNIV_INTERN
+ at return TRUE if split recommended */
 ibool
 btr_page_get_split_rec_to_right(
 /*============================*/
@@ -2653,7 +2203,7 @@ btr_page_get_split_rec(
 /*************************************************************//**
 Returns TRUE if the insert fits on the appropriate half-page with the
 chosen split_rec.
- at return	true if fits */
+ at return true if fits */
 static MY_ATTRIBUTE((nonnull(1,3,4,6), warn_unused_result))
 bool
 btr_page_insert_fits(
@@ -2746,7 +2296,6 @@ btr_page_insert_fits(
 /*******************************************************//**
 Inserts a data tuple to a tree on a non-leaf level. It is assumed
 that mtr holds an x-latch on the tree. */
-UNIV_INTERN
 void
 btr_insert_on_non_leaf_level_func(
 /*==============================*/
@@ -2762,14 +2311,48 @@ btr_insert_on_non_leaf_level_func(
 	btr_cur_t	cursor;
 	dberr_t		err;
 	rec_t*		rec;
-	ulint*		offsets	= NULL;
 	mem_heap_t*	heap = NULL;
+	ulint           offsets_[REC_OFFS_NORMAL_SIZE];
+	ulint*          offsets         = offsets_;
+	rec_offs_init(offsets_);
+	rtr_info_t	rtr_info;
 
 	ut_ad(level > 0);
 
-	btr_cur_search_to_nth_level(index, level, tuple, PAGE_CUR_LE,
-				    BTR_CONT_MODIFY_TREE,
-				    &cursor, 0, file, line, mtr);
+	if (!dict_index_is_spatial(index)) {
+		dberr_t err = DB_SUCCESS;
+		if (dict_table_is_intrinsic(index->table)) {
+			err = btr_cur_search_to_nth_level_with_no_latch(
+				index, level, tuple, PAGE_CUR_LE, &cursor,
+				__FILE__, __LINE__, mtr);
+		} else {
+			err = btr_cur_search_to_nth_level(
+				index, level, tuple, PAGE_CUR_LE,
+				BTR_CONT_MODIFY_TREE,
+				&cursor, 0, file, line, mtr);
+		}
+
+		if (err != DB_SUCCESS) {
+			ib::warn() << " Error code: " << err
+				   << " btr_page_get_father_node_ptr_func "
+				   << " level: " << level
+				   << " called from file: "
+				   << file << " line: " << line
+				   << " table: " << index->table->name
+				   << " index: " << index->name;
+		}
+	} else {
+		/* For spatial index, initialize structures to track
+		its parents etc. */
+		rtr_init_rtr_info(&rtr_info, false, &cursor, index, false);
+
+		rtr_info_update_btr(&cursor, &rtr_info);
+
+		btr_cur_search_to_nth_level(index, level, tuple,
+					    PAGE_CUR_RTREE_INSERT,
+					    BTR_CONT_MODIFY_TREE,
+					    &cursor, 0, file, line, mtr);
+	}
 
 	ut_ad(cursor.flag == BTR_CUR_BINARY);
 
@@ -2791,7 +2374,16 @@ btr_insert_on_non_leaf_level_func(
 						 &dummy_big_rec, 0, NULL, mtr);
 		ut_a(err == DB_SUCCESS);
 	}
-	mem_heap_free(heap);
+
+	if (heap != NULL) {
+		mem_heap_free(heap);
+	}
+
+	if (dict_index_is_spatial(index)) {
+		ut_ad(c