From ccd534c3ea41415af672a60033493a23ffc7501f Mon Sep 17 00:00:00 2001
From: Kristofer Pettersson <kpettersson@mysql.com>
Date: Wed, 18 Jun 2008 21:09:30 +0200
Subject: [PATCH 01/33] Bug#21226 FLUSH PRIVILEGES does not provided feedback
 when it fails.

If during a FLUSH PRIVILEGES the server fails to load the new privilege
tables, the error message is lost. This patch is a back port from 5.1 which
adresses this issue by setting the server in an error state if a failure
occurrs.

This patch also corrects an incorrect variable assignment which might
cause an error state to be reverted by coincidence.
---
 sql/sql_parse.cc | 31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)

diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 98e04e45bdd..a192bcc38f2 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -7054,11 +7054,23 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
       thd->thread_stack= (char*) &tmp_thd;
       thd->store_globals();
     }
+    
     if (thd)
     {
-      (void)acl_reload(thd);
-      (void)grant_reload(thd);
+      bool reload_acl_failed= acl_reload(thd);
+      bool reload_grants_failed= grant_reload(thd);
+
+      if (reload_acl_failed || reload_grants_failed)
+      {
+        result= 1;
+        /*
+          When an error is returned, my_message may have not been called and
+          the client will hang waiting for a response.
+        */
+        my_error(ER_UNKNOWN_ERROR, MYF(0), "FLUSH PRIVILEGES failed");
+      }
     }
+
     if (tmp_thd)
     {
       delete tmp_thd;
@@ -7144,8 +7156,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
       tmp_write_to_binlog= 0;
       if (lock_global_read_lock(thd))
 	return 1;                               // Killed
-      result=close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1,
-                                 tables);
+      if (close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1,
+                                 tables))
+          result= 1;
+      
       if (make_global_read_lock_block_commit(thd)) // Killed
       {
         /* Don't leave things in a half-locked state */
@@ -7154,7 +7168,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
       }
     }
     else
-      result=close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1, tables);
+    {
+      if (close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1, tables))
+        result= 1;
+    }
     my_dbopt_cleanup();
   }
   if (options & REFRESH_HOSTS)
@@ -7178,8 +7195,8 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
 #ifdef OPENSSL
    if (options & REFRESH_DES_KEY_FILE)
    {
-     if (des_key_file)
-       result=load_des_key_file(des_key_file);
+     if (des_key_file && load_des_key_file(des_key_file))
+         result= 1;
    }
 #endif
 #ifdef HAVE_REPLICATION

From bb6e6e3bb920b8978454ebf4a83554237fc6b1e9 Mon Sep 17 00:00:00 2001
From: Horst Hunger <horst@mysql.com>
Date: Tue, 22 Jul 2008 15:58:21 +0200
Subject: [PATCH 02/33] Fix for bug#37708:The allocation of very large buffer
 must not be done in the pushbuild.

---
 mysql-test/t/binlog_cache_size_basic_64.test            | 9 ---------
 mysql-test/t/bulk_insert_buffer_size_basic_64.test      | 9 ---------
 mysql-test/t/delayed_insert_limit_basic_64.test         | 9 ---------
 mysql-test/t/delayed_queue_size_basic_64.test           | 9 ---------
 mysql-test/t/innodb_concurrency_tickets_basic_64.test   | 9 ---------
 mysql-test/t/innodb_max_purge_lag_basic_64.test         | 9 ---------
 mysql-test/t/innodb_sync_spin_loops_basic_64.test       | 9 ---------
 mysql-test/t/join_buffer_size_basic_64.test             | 9 ---------
 mysql-test/t/key_buffer_size_basic_64.test              | 9 ---------
 mysql-test/t/key_cache_age_threshold_basic_64.test      | 9 ---------
 mysql-test/t/key_cache_block_size_basic_64.test         | 9 ---------
 mysql-test/t/key_cache_division_limit_basic_64.test     | 9 ---------
 mysql-test/t/log_warnings_basic_64.test                 | 9 ---------
 mysql-test/t/max_binlog_cache_size_basic_64.test        | 9 ---------
 mysql-test/t/max_connect_errors_basic_64.test           | 9 ---------
 mysql-test/t/max_heap_table_size_basic_64.test          | 9 ---------
 mysql-test/t/max_seeks_for_key_basic_64.test            | 9 ---------
 mysql-test/t/max_tmp_tables_basic_64.test               | 9 ---------
 mysql-test/t/max_write_lock_count_basic_64.test         | 9 ---------
 mysql-test/t/min_examined_row_limit_basic_64.test       | 9 ---------
 mysql-test/t/multi_range_count_basic_64.test            | 9 ---------
 mysql-test/t/myisam_max_sort_file_size_basic_64.test    | 9 ---------
 mysql-test/t/myisam_repair_threads_basic_64.test        | 9 ---------
 mysql-test/t/myisam_sort_buffer_size_basic_64.test      | 9 ---------
 mysql-test/t/net_retry_count_basic_64.test              | 9 ---------
 mysql-test/t/query_alloc_block_size_basic_64.test       | 9 ---------
 mysql-test/t/query_cache_limit_basic_64.test            | 9 ---------
 mysql-test/t/query_cache_min_res_unit_basic_64.test     | 9 ---------
 mysql-test/t/query_cache_size_basic_64.test             | 9 ---------
 mysql-test/t/query_prealloc_size_basic_64.test          | 9 ---------
 mysql-test/t/range_alloc_block_size_basic_64.test       | 9 ---------
 mysql-test/t/rpl_recovery_rank_basic_64.test            | 9 ---------
 mysql-test/t/server_id_basic_64.test                    | 9 ---------
 mysql-test/t/slave_transaction_retries_basic_64.test    | 9 ---------
 mysql-test/t/sort_buffer_size_basic_64.test             | 9 ---------
 mysql-test/t/sync_binlog_basic_64.test                  | 9 ---------
 mysql-test/t/timestamp_basic_64.test                    | 9 ---------
 mysql-test/t/tmp_table_size_basic_64.test               | 9 ---------
 mysql-test/t/transaction_alloc_block_size_basic_64.test | 9 ---------
 mysql-test/t/transaction_prealloc_size_basic_64.test    | 9 ---------
 mysql-test/t/wait_timeout_basic_64.test                 | 9 ---------
 41 files changed, 369 deletions(-)
 delete mode 100644 mysql-test/t/binlog_cache_size_basic_64.test
 delete mode 100644 mysql-test/t/bulk_insert_buffer_size_basic_64.test
 delete mode 100644 mysql-test/t/delayed_insert_limit_basic_64.test
 delete mode 100644 mysql-test/t/delayed_queue_size_basic_64.test
 delete mode 100644 mysql-test/t/innodb_concurrency_tickets_basic_64.test
 delete mode 100644 mysql-test/t/innodb_max_purge_lag_basic_64.test
 delete mode 100644 mysql-test/t/innodb_sync_spin_loops_basic_64.test
 delete mode 100644 mysql-test/t/join_buffer_size_basic_64.test
 delete mode 100644 mysql-test/t/key_buffer_size_basic_64.test
 delete mode 100644 mysql-test/t/key_cache_age_threshold_basic_64.test
 delete mode 100644 mysql-test/t/key_cache_block_size_basic_64.test
 delete mode 100644 mysql-test/t/key_cache_division_limit_basic_64.test
 delete mode 100644 mysql-test/t/log_warnings_basic_64.test
 delete mode 100644 mysql-test/t/max_binlog_cache_size_basic_64.test
 delete mode 100644 mysql-test/t/max_connect_errors_basic_64.test
 delete mode 100644 mysql-test/t/max_heap_table_size_basic_64.test
 delete mode 100644 mysql-test/t/max_seeks_for_key_basic_64.test
 delete mode 100644 mysql-test/t/max_tmp_tables_basic_64.test
 delete mode 100644 mysql-test/t/max_write_lock_count_basic_64.test
 delete mode 100644 mysql-test/t/min_examined_row_limit_basic_64.test
 delete mode 100644 mysql-test/t/multi_range_count_basic_64.test
 delete mode 100644 mysql-test/t/myisam_max_sort_file_size_basic_64.test
 delete mode 100644 mysql-test/t/myisam_repair_threads_basic_64.test
 delete mode 100644 mysql-test/t/myisam_sort_buffer_size_basic_64.test
 delete mode 100644 mysql-test/t/net_retry_count_basic_64.test
 delete mode 100644 mysql-test/t/query_alloc_block_size_basic_64.test
 delete mode 100644 mysql-test/t/query_cache_limit_basic_64.test
 delete mode 100644 mysql-test/t/query_cache_min_res_unit_basic_64.test
 delete mode 100644 mysql-test/t/query_cache_size_basic_64.test
 delete mode 100644 mysql-test/t/query_prealloc_size_basic_64.test
 delete mode 100644 mysql-test/t/range_alloc_block_size_basic_64.test
 delete mode 100644 mysql-test/t/rpl_recovery_rank_basic_64.test
 delete mode 100644 mysql-test/t/server_id_basic_64.test
 delete mode 100644 mysql-test/t/slave_transaction_retries_basic_64.test
 delete mode 100644 mysql-test/t/sort_buffer_size_basic_64.test
 delete mode 100644 mysql-test/t/sync_binlog_basic_64.test
 delete mode 100644 mysql-test/t/timestamp_basic_64.test
 delete mode 100644 mysql-test/t/tmp_table_size_basic_64.test
 delete mode 100644 mysql-test/t/transaction_alloc_block_size_basic_64.test
 delete mode 100644 mysql-test/t/transaction_prealloc_size_basic_64.test
 delete mode 100644 mysql-test/t/wait_timeout_basic_64.test

diff --git a/mysql-test/t/binlog_cache_size_basic_64.test b/mysql-test/t/binlog_cache_size_basic_64.test
deleted file mode 100644
index f4fdf8c2129..00000000000
--- a/mysql-test/t/binlog_cache_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# created by Horst Hunger        2008-05-07                                    #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/binlog_cache_size_basic.inc
-
diff --git a/mysql-test/t/bulk_insert_buffer_size_basic_64.test b/mysql-test/t/bulk_insert_buffer_size_basic_64.test
deleted file mode 100644
index 6363cfc12d1..00000000000
--- a/mysql-test/t/bulk_insert_buffer_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/bulk_insert_buffer_size_basic.inc
-
diff --git a/mysql-test/t/delayed_insert_limit_basic_64.test b/mysql-test/t/delayed_insert_limit_basic_64.test
deleted file mode 100644
index c1d628bbb34..00000000000
--- a/mysql-test/t/delayed_insert_limit_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/delayed_insert_limit_basic.inc
-
diff --git a/mysql-test/t/delayed_queue_size_basic_64.test b/mysql-test/t/delayed_queue_size_basic_64.test
deleted file mode 100644
index a9a929ae07b..00000000000
--- a/mysql-test/t/delayed_queue_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/delayed_queue_size_basic.inc
-
diff --git a/mysql-test/t/innodb_concurrency_tickets_basic_64.test b/mysql-test/t/innodb_concurrency_tickets_basic_64.test
deleted file mode 100644
index bec46df3d9a..00000000000
--- a/mysql-test/t/innodb_concurrency_tickets_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/innodb_concurrency_tickets_basic.inc
-
diff --git a/mysql-test/t/innodb_max_purge_lag_basic_64.test b/mysql-test/t/innodb_max_purge_lag_basic_64.test
deleted file mode 100644
index 5980e8ed12e..00000000000
--- a/mysql-test/t/innodb_max_purge_lag_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/innodb_max_purge_lag_basic.inc
-
diff --git a/mysql-test/t/innodb_sync_spin_loops_basic_64.test b/mysql-test/t/innodb_sync_spin_loops_basic_64.test
deleted file mode 100644
index f854bf475d6..00000000000
--- a/mysql-test/t/innodb_sync_spin_loops_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/innodb_sync_spin_loops_basic.inc
-
diff --git a/mysql-test/t/join_buffer_size_basic_64.test b/mysql-test/t/join_buffer_size_basic_64.test
deleted file mode 100644
index 6de911be04c..00000000000
--- a/mysql-test/t/join_buffer_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/join_buffer_size_basic.inc
-
diff --git a/mysql-test/t/key_buffer_size_basic_64.test b/mysql-test/t/key_buffer_size_basic_64.test
deleted file mode 100644
index ed8409fa70c..00000000000
--- a/mysql-test/t/key_buffer_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/key_buffer_size_basic.inc
-
diff --git a/mysql-test/t/key_cache_age_threshold_basic_64.test b/mysql-test/t/key_cache_age_threshold_basic_64.test
deleted file mode 100644
index 6524ec89127..00000000000
--- a/mysql-test/t/key_cache_age_threshold_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/key_cache_age_threshold_basic.inc
-
diff --git a/mysql-test/t/key_cache_block_size_basic_64.test b/mysql-test/t/key_cache_block_size_basic_64.test
deleted file mode 100644
index 0b6fb16238e..00000000000
--- a/mysql-test/t/key_cache_block_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/key_cache_block_size_basic.inc
-
diff --git a/mysql-test/t/key_cache_division_limit_basic_64.test b/mysql-test/t/key_cache_division_limit_basic_64.test
deleted file mode 100644
index 3b4e3ccaa99..00000000000
--- a/mysql-test/t/key_cache_division_limit_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/key_cache_division_limit_basic.inc
-
diff --git a/mysql-test/t/log_warnings_basic_64.test b/mysql-test/t/log_warnings_basic_64.test
deleted file mode 100644
index c11381735be..00000000000
--- a/mysql-test/t/log_warnings_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/log_warnings_basic.inc
-
diff --git a/mysql-test/t/max_binlog_cache_size_basic_64.test b/mysql-test/t/max_binlog_cache_size_basic_64.test
deleted file mode 100644
index ba3949ba90c..00000000000
--- a/mysql-test/t/max_binlog_cache_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/max_binlog_cache_size_basic.inc
-
diff --git a/mysql-test/t/max_connect_errors_basic_64.test b/mysql-test/t/max_connect_errors_basic_64.test
deleted file mode 100644
index 6a3d1be6978..00000000000
--- a/mysql-test/t/max_connect_errors_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/max_connect_errors_basic.inc
-
diff --git a/mysql-test/t/max_heap_table_size_basic_64.test b/mysql-test/t/max_heap_table_size_basic_64.test
deleted file mode 100644
index 76f1b658da1..00000000000
--- a/mysql-test/t/max_heap_table_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/max_heap_table_size_basic.inc
-
diff --git a/mysql-test/t/max_seeks_for_key_basic_64.test b/mysql-test/t/max_seeks_for_key_basic_64.test
deleted file mode 100644
index f700aafa044..00000000000
--- a/mysql-test/t/max_seeks_for_key_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/max_seeks_for_key_basic.inc
-
diff --git a/mysql-test/t/max_tmp_tables_basic_64.test b/mysql-test/t/max_tmp_tables_basic_64.test
deleted file mode 100644
index 81aa478b7af..00000000000
--- a/mysql-test/t/max_tmp_tables_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/max_tmp_tables_basic.inc
-
diff --git a/mysql-test/t/max_write_lock_count_basic_64.test b/mysql-test/t/max_write_lock_count_basic_64.test
deleted file mode 100644
index de1d2194c33..00000000000
--- a/mysql-test/t/max_write_lock_count_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/max_write_lock_count_basic.inc
-
diff --git a/mysql-test/t/min_examined_row_limit_basic_64.test b/mysql-test/t/min_examined_row_limit_basic_64.test
deleted file mode 100644
index 93cc4eda99d..00000000000
--- a/mysql-test/t/min_examined_row_limit_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/min_examined_row_limit_basic.inc
-
diff --git a/mysql-test/t/multi_range_count_basic_64.test b/mysql-test/t/multi_range_count_basic_64.test
deleted file mode 100644
index 0dd1ab50e4b..00000000000
--- a/mysql-test/t/multi_range_count_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/multi_range_count_basic.inc
-
diff --git a/mysql-test/t/myisam_max_sort_file_size_basic_64.test b/mysql-test/t/myisam_max_sort_file_size_basic_64.test
deleted file mode 100644
index e3846e2ccdc..00000000000
--- a/mysql-test/t/myisam_max_sort_file_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/myisam_max_sort_file_size_basic.inc
-
diff --git a/mysql-test/t/myisam_repair_threads_basic_64.test b/mysql-test/t/myisam_repair_threads_basic_64.test
deleted file mode 100644
index f1870409c28..00000000000
--- a/mysql-test/t/myisam_repair_threads_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/myisam_repair_threads_basic.inc
-
diff --git a/mysql-test/t/myisam_sort_buffer_size_basic_64.test b/mysql-test/t/myisam_sort_buffer_size_basic_64.test
deleted file mode 100644
index fd1c3c30e7d..00000000000
--- a/mysql-test/t/myisam_sort_buffer_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/myisam_sort_buffer_size_basic.inc
-
diff --git a/mysql-test/t/net_retry_count_basic_64.test b/mysql-test/t/net_retry_count_basic_64.test
deleted file mode 100644
index 08839b673f2..00000000000
--- a/mysql-test/t/net_retry_count_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/net_retry_count_basic.inc
-
diff --git a/mysql-test/t/query_alloc_block_size_basic_64.test b/mysql-test/t/query_alloc_block_size_basic_64.test
deleted file mode 100644
index 70f2f37d36b..00000000000
--- a/mysql-test/t/query_alloc_block_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/query_alloc_block_size_basic.inc
-
diff --git a/mysql-test/t/query_cache_limit_basic_64.test b/mysql-test/t/query_cache_limit_basic_64.test
deleted file mode 100644
index a3ebae0b244..00000000000
--- a/mysql-test/t/query_cache_limit_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/query_cache_limit_basic.inc
-
diff --git a/mysql-test/t/query_cache_min_res_unit_basic_64.test b/mysql-test/t/query_cache_min_res_unit_basic_64.test
deleted file mode 100644
index b35b07d4f1e..00000000000
--- a/mysql-test/t/query_cache_min_res_unit_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/query_cache_min_res_unit_basic.inc
-
diff --git a/mysql-test/t/query_cache_size_basic_64.test b/mysql-test/t/query_cache_size_basic_64.test
deleted file mode 100644
index d53be96a28b..00000000000
--- a/mysql-test/t/query_cache_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/query_cache_size_basic.inc
-
diff --git a/mysql-test/t/query_prealloc_size_basic_64.test b/mysql-test/t/query_prealloc_size_basic_64.test
deleted file mode 100644
index 532336e225e..00000000000
--- a/mysql-test/t/query_prealloc_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/query_prealloc_size_basic.inc
-
diff --git a/mysql-test/t/range_alloc_block_size_basic_64.test b/mysql-test/t/range_alloc_block_size_basic_64.test
deleted file mode 100644
index a9601d770c0..00000000000
--- a/mysql-test/t/range_alloc_block_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/range_alloc_block_size_basic.inc
-
diff --git a/mysql-test/t/rpl_recovery_rank_basic_64.test b/mysql-test/t/rpl_recovery_rank_basic_64.test
deleted file mode 100644
index 6fe04f26442..00000000000
--- a/mysql-test/t/rpl_recovery_rank_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/rpl_recovery_rank_basic.inc
-
diff --git a/mysql-test/t/server_id_basic_64.test b/mysql-test/t/server_id_basic_64.test
deleted file mode 100644
index 67653e0503e..00000000000
--- a/mysql-test/t/server_id_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/server_id_basic.inc
-
diff --git a/mysql-test/t/slave_transaction_retries_basic_64.test b/mysql-test/t/slave_transaction_retries_basic_64.test
deleted file mode 100644
index e07f96edf3f..00000000000
--- a/mysql-test/t/slave_transaction_retries_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/slave_transaction_retries_basic.inc
-
diff --git a/mysql-test/t/sort_buffer_size_basic_64.test b/mysql-test/t/sort_buffer_size_basic_64.test
deleted file mode 100644
index 86081b3820b..00000000000
--- a/mysql-test/t/sort_buffer_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/sort_buffer_size_basic.inc
-
diff --git a/mysql-test/t/sync_binlog_basic_64.test b/mysql-test/t/sync_binlog_basic_64.test
deleted file mode 100644
index 9f605445ded..00000000000
--- a/mysql-test/t/sync_binlog_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/sync_binlog_basic.inc
-
diff --git a/mysql-test/t/timestamp_basic_64.test b/mysql-test/t/timestamp_basic_64.test
deleted file mode 100644
index 4614e470a4c..00000000000
--- a/mysql-test/t/timestamp_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/timestamp_basic.inc
-
diff --git a/mysql-test/t/tmp_table_size_basic_64.test b/mysql-test/t/tmp_table_size_basic_64.test
deleted file mode 100644
index ddd865f6383..00000000000
--- a/mysql-test/t/tmp_table_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/tmp_table_size_basic.inc
-
diff --git a/mysql-test/t/transaction_alloc_block_size_basic_64.test b/mysql-test/t/transaction_alloc_block_size_basic_64.test
deleted file mode 100644
index b6ebe36c35f..00000000000
--- a/mysql-test/t/transaction_alloc_block_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/transaction_alloc_block_size_basic.inc
-
diff --git a/mysql-test/t/transaction_prealloc_size_basic_64.test b/mysql-test/t/transaction_prealloc_size_basic_64.test
deleted file mode 100644
index 5487d06f521..00000000000
--- a/mysql-test/t/transaction_prealloc_size_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/transaction_prealloc_size_basic.inc
-
diff --git a/mysql-test/t/wait_timeout_basic_64.test b/mysql-test/t/wait_timeout_basic_64.test
deleted file mode 100644
index 76dcd6fcc91..00000000000
--- a/mysql-test/t/wait_timeout_basic_64.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source include/wait_timeout_basic.inc
-

From ac73d3b48bd132e44e87d3296e9bfb19dc23df5e Mon Sep 17 00:00:00 2001
From: Horst Hunger <horst@mysql.com>
Date: Tue, 22 Jul 2008 18:45:55 +0200
Subject: [PATCH 03/33] Fix for bug#37708:The allocation of very large buffer
 must not be done in the pushbuild. hhunger.

---
 mysql-test/t/binlog_cache_size_basic_32.test            | 9 ---------
 mysql-test/t/bulk_insert_buffer_size_basic_32.test      | 9 ---------
 mysql-test/t/delayed_insert_limit_basic_32.test         | 9 ---------
 mysql-test/t/delayed_queue_size_basic_32.test           | 9 ---------
 mysql-test/t/innodb_concurrency_tickets_basic_32.test   | 9 ---------
 mysql-test/t/innodb_max_purge_lag_basic_32.test         | 9 ---------
 mysql-test/t/innodb_sync_spin_loops_basic_32.test       | 9 ---------
 mysql-test/t/join_buffer_size_basic_32.test             | 9 ---------
 mysql-test/t/key_buffer_size_basic_32.test              | 9 ---------
 mysql-test/t/key_cache_age_threshold_basic_32.test      | 9 ---------
 mysql-test/t/key_cache_block_size_basic_32.test         | 9 ---------
 mysql-test/t/key_cache_division_limit_basic_32.test     | 9 ---------
 mysql-test/t/log_warnings_basic_32.test                 | 9 ---------
 mysql-test/t/max_binlog_cache_size_basic_32.test        | 9 ---------
 mysql-test/t/max_connect_errors_basic_32.test           | 9 ---------
 mysql-test/t/max_heap_table_size_basic_32.test          | 9 ---------
 mysql-test/t/max_seeks_for_key_basic_32.test            | 9 ---------
 mysql-test/t/max_tmp_tables_basic_32.test               | 9 ---------
 mysql-test/t/max_write_lock_count_basic_32.test         | 9 ---------
 mysql-test/t/min_examined_row_limit_basic_32.test       | 9 ---------
 mysql-test/t/multi_range_count_basic_32.test            | 9 ---------
 mysql-test/t/myisam_max_sort_file_size_basic_32.test    | 9 ---------
 mysql-test/t/myisam_repair_threads_basic_32.test        | 9 ---------
 mysql-test/t/myisam_sort_buffer_size_basic_32.test      | 9 ---------
 mysql-test/t/net_retry_count_basic_32.test              | 9 ---------
 mysql-test/t/query_alloc_block_size_basic_32.test       | 9 ---------
 mysql-test/t/query_cache_limit_basic_32.test            | 9 ---------
 mysql-test/t/query_cache_min_res_unit_basic_32.test     | 9 ---------
 mysql-test/t/query_cache_size_basic_32.test             | 9 ---------
 mysql-test/t/query_prealloc_size_basic_32.test          | 9 ---------
 mysql-test/t/range_alloc_block_size_basic_32.test       | 9 ---------
 mysql-test/t/rpl_recovery_rank_basic_32.test            | 9 ---------
 mysql-test/t/server_id_basic_32.test                    | 9 ---------
 mysql-test/t/slave_transaction_retries_basic_32.test    | 9 ---------
 mysql-test/t/sort_buffer_size_basic_32.test             | 9 ---------
 mysql-test/t/sync_binlog_basic_32.test                  | 9 ---------
 mysql-test/t/timestamp_basic_32.test                    | 9 ---------
 mysql-test/t/tmp_table_size_basic_32.test               | 9 ---------
 mysql-test/t/transaction_alloc_block_size_basic_32.test | 9 ---------
 mysql-test/t/transaction_prealloc_size_basic_32.test    | 9 ---------
 mysql-test/t/wait_timeout_basic_32.test                 | 9 ---------
 41 files changed, 369 deletions(-)
 delete mode 100644 mysql-test/t/binlog_cache_size_basic_32.test
 delete mode 100644 mysql-test/t/bulk_insert_buffer_size_basic_32.test
 delete mode 100644 mysql-test/t/delayed_insert_limit_basic_32.test
 delete mode 100644 mysql-test/t/delayed_queue_size_basic_32.test
 delete mode 100644 mysql-test/t/innodb_concurrency_tickets_basic_32.test
 delete mode 100644 mysql-test/t/innodb_max_purge_lag_basic_32.test
 delete mode 100644 mysql-test/t/innodb_sync_spin_loops_basic_32.test
 delete mode 100644 mysql-test/t/join_buffer_size_basic_32.test
 delete mode 100644 mysql-test/t/key_buffer_size_basic_32.test
 delete mode 100644 mysql-test/t/key_cache_age_threshold_basic_32.test
 delete mode 100644 mysql-test/t/key_cache_block_size_basic_32.test
 delete mode 100644 mysql-test/t/key_cache_division_limit_basic_32.test
 delete mode 100644 mysql-test/t/log_warnings_basic_32.test
 delete mode 100644 mysql-test/t/max_binlog_cache_size_basic_32.test
 delete mode 100644 mysql-test/t/max_connect_errors_basic_32.test
 delete mode 100644 mysql-test/t/max_heap_table_size_basic_32.test
 delete mode 100644 mysql-test/t/max_seeks_for_key_basic_32.test
 delete mode 100644 mysql-test/t/max_tmp_tables_basic_32.test
 delete mode 100644 mysql-test/t/max_write_lock_count_basic_32.test
 delete mode 100644 mysql-test/t/min_examined_row_limit_basic_32.test
 delete mode 100644 mysql-test/t/multi_range_count_basic_32.test
 delete mode 100644 mysql-test/t/myisam_max_sort_file_size_basic_32.test
 delete mode 100644 mysql-test/t/myisam_repair_threads_basic_32.test
 delete mode 100644 mysql-test/t/myisam_sort_buffer_size_basic_32.test
 delete mode 100644 mysql-test/t/net_retry_count_basic_32.test
 delete mode 100644 mysql-test/t/query_alloc_block_size_basic_32.test
 delete mode 100644 mysql-test/t/query_cache_limit_basic_32.test
 delete mode 100644 mysql-test/t/query_cache_min_res_unit_basic_32.test
 delete mode 100644 mysql-test/t/query_cache_size_basic_32.test
 delete mode 100644 mysql-test/t/query_prealloc_size_basic_32.test
 delete mode 100644 mysql-test/t/range_alloc_block_size_basic_32.test
 delete mode 100644 mysql-test/t/rpl_recovery_rank_basic_32.test
 delete mode 100644 mysql-test/t/server_id_basic_32.test
 delete mode 100644 mysql-test/t/slave_transaction_retries_basic_32.test
 delete mode 100644 mysql-test/t/sort_buffer_size_basic_32.test
 delete mode 100644 mysql-test/t/sync_binlog_basic_32.test
 delete mode 100644 mysql-test/t/timestamp_basic_32.test
 delete mode 100644 mysql-test/t/tmp_table_size_basic_32.test
 delete mode 100644 mysql-test/t/transaction_alloc_block_size_basic_32.test
 delete mode 100644 mysql-test/t/transaction_prealloc_size_basic_32.test
 delete mode 100644 mysql-test/t/wait_timeout_basic_32.test

diff --git a/mysql-test/t/binlog_cache_size_basic_32.test b/mysql-test/t/binlog_cache_size_basic_32.test
deleted file mode 100644
index a809c00f987..00000000000
--- a/mysql-test/t/binlog_cache_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# created by Horst Hunger        2008-05-07                                    #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/binlog_cache_size_basic.inc
-
diff --git a/mysql-test/t/bulk_insert_buffer_size_basic_32.test b/mysql-test/t/bulk_insert_buffer_size_basic_32.test
deleted file mode 100644
index 76a418323bc..00000000000
--- a/mysql-test/t/bulk_insert_buffer_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/bulk_insert_buffer_size_basic.inc
-
diff --git a/mysql-test/t/delayed_insert_limit_basic_32.test b/mysql-test/t/delayed_insert_limit_basic_32.test
deleted file mode 100644
index d7a4a81542f..00000000000
--- a/mysql-test/t/delayed_insert_limit_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/delayed_insert_limit_basic.inc
-
diff --git a/mysql-test/t/delayed_queue_size_basic_32.test b/mysql-test/t/delayed_queue_size_basic_32.test
deleted file mode 100644
index 06e0cf48dac..00000000000
--- a/mysql-test/t/delayed_queue_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/delayed_queue_size_basic.inc
-
diff --git a/mysql-test/t/innodb_concurrency_tickets_basic_32.test b/mysql-test/t/innodb_concurrency_tickets_basic_32.test
deleted file mode 100644
index e587d1870bf..00000000000
--- a/mysql-test/t/innodb_concurrency_tickets_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/innodb_concurrency_tickets_basic.inc
-
diff --git a/mysql-test/t/innodb_max_purge_lag_basic_32.test b/mysql-test/t/innodb_max_purge_lag_basic_32.test
deleted file mode 100644
index 4e5b019b151..00000000000
--- a/mysql-test/t/innodb_max_purge_lag_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/innodb_max_purge_lag_basic.inc
-
diff --git a/mysql-test/t/innodb_sync_spin_loops_basic_32.test b/mysql-test/t/innodb_sync_spin_loops_basic_32.test
deleted file mode 100644
index ffb766b3ec8..00000000000
--- a/mysql-test/t/innodb_sync_spin_loops_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/innodb_sync_spin_loops_basic.inc
-
diff --git a/mysql-test/t/join_buffer_size_basic_32.test b/mysql-test/t/join_buffer_size_basic_32.test
deleted file mode 100644
index e904f2de426..00000000000
--- a/mysql-test/t/join_buffer_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/join_buffer_size_basic.inc
-
diff --git a/mysql-test/t/key_buffer_size_basic_32.test b/mysql-test/t/key_buffer_size_basic_32.test
deleted file mode 100644
index 78051382f73..00000000000
--- a/mysql-test/t/key_buffer_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/key_buffer_size_basic.inc
-
diff --git a/mysql-test/t/key_cache_age_threshold_basic_32.test b/mysql-test/t/key_cache_age_threshold_basic_32.test
deleted file mode 100644
index 13e7367f2ed..00000000000
--- a/mysql-test/t/key_cache_age_threshold_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/key_cache_age_threshold_basic.inc
-
diff --git a/mysql-test/t/key_cache_block_size_basic_32.test b/mysql-test/t/key_cache_block_size_basic_32.test
deleted file mode 100644
index 63d71016657..00000000000
--- a/mysql-test/t/key_cache_block_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/key_cache_block_size_basic.inc
-
diff --git a/mysql-test/t/key_cache_division_limit_basic_32.test b/mysql-test/t/key_cache_division_limit_basic_32.test
deleted file mode 100644
index c8ec6cca3a3..00000000000
--- a/mysql-test/t/key_cache_division_limit_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/key_cache_division_limit_basic.inc
-
diff --git a/mysql-test/t/log_warnings_basic_32.test b/mysql-test/t/log_warnings_basic_32.test
deleted file mode 100644
index b6d1d0d6382..00000000000
--- a/mysql-test/t/log_warnings_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/log_warnings_basic.inc
-
diff --git a/mysql-test/t/max_binlog_cache_size_basic_32.test b/mysql-test/t/max_binlog_cache_size_basic_32.test
deleted file mode 100644
index ba9c4d5136a..00000000000
--- a/mysql-test/t/max_binlog_cache_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/max_binlog_cache_size_basic.inc
-
diff --git a/mysql-test/t/max_connect_errors_basic_32.test b/mysql-test/t/max_connect_errors_basic_32.test
deleted file mode 100644
index 9f6e1dad6a8..00000000000
--- a/mysql-test/t/max_connect_errors_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/max_connect_errors_basic.inc
-
diff --git a/mysql-test/t/max_heap_table_size_basic_32.test b/mysql-test/t/max_heap_table_size_basic_32.test
deleted file mode 100644
index 38684f307c2..00000000000
--- a/mysql-test/t/max_heap_table_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/max_heap_table_size_basic.inc
-
diff --git a/mysql-test/t/max_seeks_for_key_basic_32.test b/mysql-test/t/max_seeks_for_key_basic_32.test
deleted file mode 100644
index d7b9ce7f834..00000000000
--- a/mysql-test/t/max_seeks_for_key_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/max_seeks_for_key_basic.inc
-
diff --git a/mysql-test/t/max_tmp_tables_basic_32.test b/mysql-test/t/max_tmp_tables_basic_32.test
deleted file mode 100644
index 98da87421b7..00000000000
--- a/mysql-test/t/max_tmp_tables_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/max_tmp_tables_basic.inc
-
diff --git a/mysql-test/t/max_write_lock_count_basic_32.test b/mysql-test/t/max_write_lock_count_basic_32.test
deleted file mode 100644
index c33ffc53d6c..00000000000
--- a/mysql-test/t/max_write_lock_count_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/max_write_lock_count_basic.inc
-
diff --git a/mysql-test/t/min_examined_row_limit_basic_32.test b/mysql-test/t/min_examined_row_limit_basic_32.test
deleted file mode 100644
index bbc3b6029d8..00000000000
--- a/mysql-test/t/min_examined_row_limit_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/min_examined_row_limit_basic.inc
-
diff --git a/mysql-test/t/multi_range_count_basic_32.test b/mysql-test/t/multi_range_count_basic_32.test
deleted file mode 100644
index a2487ebc154..00000000000
--- a/mysql-test/t/multi_range_count_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/multi_range_count_basic.inc
-
diff --git a/mysql-test/t/myisam_max_sort_file_size_basic_32.test b/mysql-test/t/myisam_max_sort_file_size_basic_32.test
deleted file mode 100644
index 5ff3a35a61f..00000000000
--- a/mysql-test/t/myisam_max_sort_file_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/myisam_max_sort_file_size_basic.inc
-
diff --git a/mysql-test/t/myisam_repair_threads_basic_32.test b/mysql-test/t/myisam_repair_threads_basic_32.test
deleted file mode 100644
index 7f0f0785f09..00000000000
--- a/mysql-test/t/myisam_repair_threads_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/myisam_repair_threads_basic.inc
-
diff --git a/mysql-test/t/myisam_sort_buffer_size_basic_32.test b/mysql-test/t/myisam_sort_buffer_size_basic_32.test
deleted file mode 100644
index d87a2015407..00000000000
--- a/mysql-test/t/myisam_sort_buffer_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/myisam_sort_buffer_size_basic.inc
-
diff --git a/mysql-test/t/net_retry_count_basic_32.test b/mysql-test/t/net_retry_count_basic_32.test
deleted file mode 100644
index 1f7a4f1cb80..00000000000
--- a/mysql-test/t/net_retry_count_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/net_retry_count_basic.inc
-
diff --git a/mysql-test/t/query_alloc_block_size_basic_32.test b/mysql-test/t/query_alloc_block_size_basic_32.test
deleted file mode 100644
index 281698c4179..00000000000
--- a/mysql-test/t/query_alloc_block_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/query_alloc_block_size_basic.inc
-
diff --git a/mysql-test/t/query_cache_limit_basic_32.test b/mysql-test/t/query_cache_limit_basic_32.test
deleted file mode 100644
index cd5f94112a0..00000000000
--- a/mysql-test/t/query_cache_limit_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/query_cache_limit_basic.inc
-
diff --git a/mysql-test/t/query_cache_min_res_unit_basic_32.test b/mysql-test/t/query_cache_min_res_unit_basic_32.test
deleted file mode 100644
index 4f3740ea872..00000000000
--- a/mysql-test/t/query_cache_min_res_unit_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/query_cache_min_res_unit_basic.inc
-
diff --git a/mysql-test/t/query_cache_size_basic_32.test b/mysql-test/t/query_cache_size_basic_32.test
deleted file mode 100644
index 500bdbda5dd..00000000000
--- a/mysql-test/t/query_cache_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/query_cache_size_basic.inc
-
diff --git a/mysql-test/t/query_prealloc_size_basic_32.test b/mysql-test/t/query_prealloc_size_basic_32.test
deleted file mode 100644
index ae919cd8d9e..00000000000
--- a/mysql-test/t/query_prealloc_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/query_prealloc_size_basic.inc
-
diff --git a/mysql-test/t/range_alloc_block_size_basic_32.test b/mysql-test/t/range_alloc_block_size_basic_32.test
deleted file mode 100644
index 247e92cd362..00000000000
--- a/mysql-test/t/range_alloc_block_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/range_alloc_block_size_basic.inc
-
diff --git a/mysql-test/t/rpl_recovery_rank_basic_32.test b/mysql-test/t/rpl_recovery_rank_basic_32.test
deleted file mode 100644
index d35878e153c..00000000000
--- a/mysql-test/t/rpl_recovery_rank_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/rpl_recovery_rank_basic.inc
-
diff --git a/mysql-test/t/server_id_basic_32.test b/mysql-test/t/server_id_basic_32.test
deleted file mode 100644
index b7c4c603803..00000000000
--- a/mysql-test/t/server_id_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/server_id_basic.inc
-
diff --git a/mysql-test/t/slave_transaction_retries_basic_32.test b/mysql-test/t/slave_transaction_retries_basic_32.test
deleted file mode 100644
index c19297ba72f..00000000000
--- a/mysql-test/t/slave_transaction_retries_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/slave_transaction_retries_basic.inc
-
diff --git a/mysql-test/t/sort_buffer_size_basic_32.test b/mysql-test/t/sort_buffer_size_basic_32.test
deleted file mode 100644
index 8c86fe7786a..00000000000
--- a/mysql-test/t/sort_buffer_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/sort_buffer_size_basic.inc
-
diff --git a/mysql-test/t/sync_binlog_basic_32.test b/mysql-test/t/sync_binlog_basic_32.test
deleted file mode 100644
index 3acd76b7e72..00000000000
--- a/mysql-test/t/sync_binlog_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/sync_binlog_basic.inc
-
diff --git a/mysql-test/t/timestamp_basic_32.test b/mysql-test/t/timestamp_basic_32.test
deleted file mode 100644
index 72371c154fc..00000000000
--- a/mysql-test/t/timestamp_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/timestamp_basic.inc
-
diff --git a/mysql-test/t/tmp_table_size_basic_32.test b/mysql-test/t/tmp_table_size_basic_32.test
deleted file mode 100644
index 19d54251c5e..00000000000
--- a/mysql-test/t/tmp_table_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/tmp_table_size_basic.inc
-
diff --git a/mysql-test/t/transaction_alloc_block_size_basic_32.test b/mysql-test/t/transaction_alloc_block_size_basic_32.test
deleted file mode 100644
index a714a4f5a30..00000000000
--- a/mysql-test/t/transaction_alloc_block_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/transaction_alloc_block_size_basic.inc
-
diff --git a/mysql-test/t/transaction_prealloc_size_basic_32.test b/mysql-test/t/transaction_prealloc_size_basic_32.test
deleted file mode 100644
index 868e281d30e..00000000000
--- a/mysql-test/t/transaction_prealloc_size_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/transaction_prealloc_size_basic.inc
-
diff --git a/mysql-test/t/wait_timeout_basic_32.test b/mysql-test/t/wait_timeout_basic_32.test
deleted file mode 100644
index 88d60333138..00000000000
--- a/mysql-test/t/wait_timeout_basic_32.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source include/wait_timeout_basic.inc
-

From cb7d9b27d404389d3b71f901c12923e7511de433 Mon Sep 17 00:00:00 2001
From: Horst Hunger <horst@mysql.com>
Date: Tue, 22 Jul 2008 18:48:47 +0200
Subject: [PATCH 04/33] Fix for bug#37708: Result files of removed 32 bit
 tests.

---
 .../r/binlog_cache_size_basic_32.result       | 102 ---------
 .../r/bulk_insert_buffer_size_basic_32.result | 154 -------------
 .../r/delayed_insert_limit_basic_32.result    | 112 ----------
 .../r/delayed_queue_size_basic_32.result      | 110 ----------
 ...innodb_concurrency_tickets_basic_32.result | 100 ---------
 .../r/innodb_max_purge_lag_basic_32.result    |  94 --------
 .../r/innodb_sync_spin_loops_basic_32.result  |  94 --------
 mysql-test/r/join_buffer_size_basic_32.result | 198 -----------------
 mysql-test/r/key_buffer_size_basic_32.result  | 111 ----------
 .../r/key_cache_age_threshold_basic_32.result | 126 -----------
 .../r/key_cache_block_size_basic_32.result    | 142 ------------
 .../key_cache_division_limit_basic_32.result  | 139 ------------
 mysql-test/r/log_warnings_basic_32.result     | 162 --------------
 .../r/max_binlog_cache_size_basic_32.result   | 145 -------------
 .../r/max_connect_errors_basic_32.result      | 137 ------------
 .../r/max_heap_table_size_basic_32.result     | 196 -----------------
 .../r/max_seeks_for_key_basic_32.result       | 180 ----------------
 mysql-test/r/max_tmp_tables_basic_32.result   | 197 -----------------
 .../r/max_write_lock_count_basic_32.result    | 108 ----------
 .../r/min_examined_row_limit_basic_32.result  | 180 ----------------
 .../r/multi_range_count_basic_32.result       | 192 -----------------
 .../myisam_max_sort_file_size_basic_32.result | 114 ----------
 .../r/myisam_repair_threads_basic_32.result   | 180 ----------------
 .../r/myisam_sort_buffer_size_basic_32.result | 184 ----------------
 mysql-test/r/net_retry_count_basic_32.result  | 192 -----------------
 .../r/query_alloc_block_size_basic_32.result  | 203 ------------------
 .../r/query_cache_limit_basic_32.result       | 126 -----------
 .../query_cache_min_res_unit_basic_32.result  | 134 ------------
 mysql-test/r/query_cache_size_basic_32.result | 138 ------------
 .../r/query_prealloc_size_basic_32.result     | 178 ---------------
 .../r/range_alloc_block_size_basic_32.result  | 182 ----------------
 .../r/rpl_recovery_rank_basic_32.result       | 110 ----------
 mysql-test/r/server_id_basic_32.result        | 117 ----------
 .../slave_transaction_retries_basic_32.result | 119 ----------
 mysql-test/r/sort_buffer_size_basic_32.result | 193 -----------------
 mysql-test/r/sync_binlog_basic_32.result      | 105 ---------
 mysql-test/r/timestamp_basic_32.result        |  73 -------
 mysql-test/r/tmp_table_size_basic_32.result   | 172 ---------------
 ...ansaction_alloc_block_size_basic_32.result | 180 ----------------
 .../transaction_prealloc_size_basic_32.result | 172 ---------------
 mysql-test/r/wait_timeout_basic_32.result     | 129 -----------
 41 files changed, 5980 deletions(-)
 delete mode 100644 mysql-test/r/binlog_cache_size_basic_32.result
 delete mode 100644 mysql-test/r/bulk_insert_buffer_size_basic_32.result
 delete mode 100644 mysql-test/r/delayed_insert_limit_basic_32.result
 delete mode 100644 mysql-test/r/delayed_queue_size_basic_32.result
 delete mode 100644 mysql-test/r/innodb_concurrency_tickets_basic_32.result
 delete mode 100644 mysql-test/r/innodb_max_purge_lag_basic_32.result
 delete mode 100644 mysql-test/r/innodb_sync_spin_loops_basic_32.result
 delete mode 100644 mysql-test/r/join_buffer_size_basic_32.result
 delete mode 100644 mysql-test/r/key_buffer_size_basic_32.result
 delete mode 100644 mysql-test/r/key_cache_age_threshold_basic_32.result
 delete mode 100644 mysql-test/r/key_cache_block_size_basic_32.result
 delete mode 100644 mysql-test/r/key_cache_division_limit_basic_32.result
 delete mode 100644 mysql-test/r/log_warnings_basic_32.result
 delete mode 100644 mysql-test/r/max_binlog_cache_size_basic_32.result
 delete mode 100644 mysql-test/r/max_connect_errors_basic_32.result
 delete mode 100644 mysql-test/r/max_heap_table_size_basic_32.result
 delete mode 100644 mysql-test/r/max_seeks_for_key_basic_32.result
 delete mode 100644 mysql-test/r/max_tmp_tables_basic_32.result
 delete mode 100644 mysql-test/r/max_write_lock_count_basic_32.result
 delete mode 100644 mysql-test/r/min_examined_row_limit_basic_32.result
 delete mode 100644 mysql-test/r/multi_range_count_basic_32.result
 delete mode 100644 mysql-test/r/myisam_max_sort_file_size_basic_32.result
 delete mode 100644 mysql-test/r/myisam_repair_threads_basic_32.result
 delete mode 100644 mysql-test/r/myisam_sort_buffer_size_basic_32.result
 delete mode 100644 mysql-test/r/net_retry_count_basic_32.result
 delete mode 100644 mysql-test/r/query_alloc_block_size_basic_32.result
 delete mode 100644 mysql-test/r/query_cache_limit_basic_32.result
 delete mode 100644 mysql-test/r/query_cache_min_res_unit_basic_32.result
 delete mode 100644 mysql-test/r/query_cache_size_basic_32.result
 delete mode 100644 mysql-test/r/query_prealloc_size_basic_32.result
 delete mode 100644 mysql-test/r/range_alloc_block_size_basic_32.result
 delete mode 100644 mysql-test/r/rpl_recovery_rank_basic_32.result
 delete mode 100644 mysql-test/r/server_id_basic_32.result
 delete mode 100644 mysql-test/r/slave_transaction_retries_basic_32.result
 delete mode 100644 mysql-test/r/sort_buffer_size_basic_32.result
 delete mode 100644 mysql-test/r/sync_binlog_basic_32.result
 delete mode 100644 mysql-test/r/timestamp_basic_32.result
 delete mode 100644 mysql-test/r/tmp_table_size_basic_32.result
 delete mode 100644 mysql-test/r/transaction_alloc_block_size_basic_32.result
 delete mode 100644 mysql-test/r/transaction_prealloc_size_basic_32.result
 delete mode 100644 mysql-test/r/wait_timeout_basic_32.result

diff --git a/mysql-test/r/binlog_cache_size_basic_32.result b/mysql-test/r/binlog_cache_size_basic_32.result
deleted file mode 100644
index 6267c5493da..00000000000
--- a/mysql-test/r/binlog_cache_size_basic_32.result
+++ /dev/null
@@ -1,102 +0,0 @@
-SET @start_value = @@global.binlog_cache_size;
-SELECT @start_value;
-@start_value
-32768
-'#--------------------FN_DYNVARS_006_01------------------------#'
-SET @@global.binlog_cache_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '100'
-SET @@global.binlog_cache_size = DEFAULT;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-32768
-'#---------------------FN_DYNVARS_006_02-------------------------#'
-SET @@global.binlog_cache_size = @start_value;
-SELECT @@global.binlog_cache_size = 32768;
-@@global.binlog_cache_size = 32768
-1
-'#--------------------FN_DYNVARS_006_03------------------------#'
-SET @@global.binlog_cache_size = 4096;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4096
-SET @@global.binlog_cache_size = 4294967295;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4294963200
-SET @@global.binlog_cache_size = 10000;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-8192
-SET @@global.binlog_cache_size = 21221204;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-21217280
-'Bug: Invalid values are coming in variable on assigning valid values'
-'#--------------------FN_DYNVARS_006_04-------------------------#'
-SET @@global.binlog_cache_size = 1024;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '1024'
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4096
-SET @@global.binlog_cache_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
-SET @@global.binlog_cache_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '0'
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4096
-SET @@global.binlog_cache_size = 42949672950;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '42949672950'
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4294963200
-'Bug: Errors are not coming on assigning invalid values to variable'
-SET @@global.binlog_cache_size = ON;
-ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
-SET @@global.binlog_cache_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
-'#-------------------FN_DYNVARS_006_05----------------------------#'
-SET @@session.binlog_cache_size = 0;
-ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-'#----------------------FN_DYNVARS_006_06------------------------#'
-SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size';
-@@global.binlog_cache_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_006_07----------------------#'
-SET @@global.binlog_cache_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '1'
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4096
-SET @@global.binlog_cache_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '0'
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4096
-'Bug: Errors are not coming on assigning TRUE/FALSE to variable'
-'#---------------------FN_DYNVARS_006_08----------------------#'
-SET @@global.binlog_cache_size = 1;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '1'
-SELECT @@binlog_cache_size = @@global.binlog_cache_size;
-@@binlog_cache_size = @@global.binlog_cache_size
-1
-'#---------------------FN_DYNVARS_006_09----------------------#'
-SET binlog_cache_size = 1;
-ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET global.binlog_cache_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_cache_size = 1' at line 1
-SELECT global.binlog_cache_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT binlog_cache_size = @@session.binlog_cache_size;
-ERROR 42S22: Unknown column 'binlog_cache_size' in 'field list'
-SET @@global.binlog_cache_size = @start_value;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-32768
diff --git a/mysql-test/r/bulk_insert_buffer_size_basic_32.result b/mysql-test/r/bulk_insert_buffer_size_basic_32.result
deleted file mode 100644
index 1194a0e7ce7..00000000000
--- a/mysql-test/r/bulk_insert_buffer_size_basic_32.result
+++ /dev/null
@@ -1,154 +0,0 @@
-SET @start_global_value = @@global.bulk_insert_buffer_size;
-SELECT @start_global_value;
-@start_global_value
-8388608
-SET @start_session_value = @@session.bulk_insert_buffer_size;
-SELECT @start_session_value;
-@start_session_value
-8388608
-'#--------------------FN_DYNVARS_007_01-------------------------#'
-SET @@global.bulk_insert_buffer_size = 100;
-SET @@global.bulk_insert_buffer_size = DEFAULT;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-8388608
-SET @@session.bulk_insert_buffer_size = 200;
-SET @@session.bulk_insert_buffer_size = DEFAULT;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-8388608
-'#--------------------FN_DYNVARS_007_02-------------------------#'
-SET @@global.bulk_insert_buffer_size = @start_global_value;
-SELECT @@global.bulk_insert_buffer_size = 8388608;
-@@global.bulk_insert_buffer_size = 8388608
-1
-SET @@session.bulk_insert_buffer_size = @start_session_value;
-SELECT @@session.bulk_insert_buffer_size = 8388608;
-@@session.bulk_insert_buffer_size = 8388608
-1
-'#--------------------FN_DYNVARS_007_03-------------------------#'
-SET @@global.bulk_insert_buffer_size = 0;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-0
-SET @@global.bulk_insert_buffer_size = 1;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-1
-SET @@global.bulk_insert_buffer_size = 4294967295;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-4294967295
-SET @@global.bulk_insert_buffer_size = 429496;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-429496
-'#--------------------FN_DYNVARS_007_04-------------------------#'
-SET @@session.bulk_insert_buffer_size = 0;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-0
-SET @@session.bulk_insert_buffer_size = 1;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-1
-SET @@session.bulk_insert_buffer_size = 4294967295;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-4294967295
-SET @@session.bulk_insert_buffer_size = 429496;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-429496
-'#------------------FN_DYNVARS_007_05-----------------------#'
-SET @@global.bulk_insert_buffer_size = 42949672950;
-Warnings:
-Warning	1292	Truncated incorrect bulk_insert_buffer_size value: '42949672950'
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-4294967295
-SET @@global.bulk_insert_buffer_size = -1024;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-0
-SET @@global.bulk_insert_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
-SET @@global.bulk_insert_buffer_size = ON;
-ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
-SET @@global.bulk_insert_buffer_size = 429496.10;
-ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
-SET @@session.bulk_insert_buffer_size = 42949672950;
-Warnings:
-Warning	1292	Truncated incorrect bulk_insert_buffer_size value: '42949672950'
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-4294967295
-SET @@session.bulk_insert_buffer_size = -2;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-0
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@session.bulk_insert_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
-SET @@session.bulk_insert_buffer_size = 429496.10;
-ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
-'#------------------FN_DYNVARS_007_06-----------------------#'
-SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='bulk_insert_buffer_size';
-@@global.bulk_insert_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_007_07-----------------------#'
-SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='bulk_insert_buffer_size';
-@@session.bulk_insert_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_007_08-----------------------#'
-SET @@global.bulk_insert_buffer_size = TRUE;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-1
-SET @@global.bulk_insert_buffer_size = FALSE;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-0
-SET @@session.bulk_insert_buffer_size = TRUE;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-1
-SET @@session.bulk_insert_buffer_size = FALSE;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-0
-'#---------------------FN_DYNVARS_007_09----------------------#'
-SET @@bulk_insert_buffer_size = 100;
-SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size;
-@@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size
-1
-SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
-@@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size
-1
-'#---------------------FN_DYNVARS_007_10----------------------#'
-SET bulk_insert_buffer_size = 1;
-SELECT @@bulk_insert_buffer_size;
-@@bulk_insert_buffer_size
-1
-SET local.bulk_insert_buffer_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1
-SELECT local.bulk_insert_buffer_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET session.bulk_insert_buffer_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1
-SELECT session.bulk_insert_buffer_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
-ERROR 42S22: Unknown column 'bulk_insert_buffer_size' in 'field list'
-SET @@global.bulk_insert_buffer_size = @start_global_value;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-8388608
-SET @@session.bulk_insert_buffer_size = @start_session_value;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-8388608
diff --git a/mysql-test/r/delayed_insert_limit_basic_32.result b/mysql-test/r/delayed_insert_limit_basic_32.result
deleted file mode 100644
index cb6820b2941..00000000000
--- a/mysql-test/r/delayed_insert_limit_basic_32.result
+++ /dev/null
@@ -1,112 +0,0 @@
-SET @start_value = @@global.delayed_insert_limit;
-SELECT @start_value;
-@start_value
-100
-'#--------------------FN_DYNVARS_024_01------------------------#'
-SET @@global.delayed_insert_limit = 100;
-SET @@global.delayed_insert_limit = DEFAULT;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-100
-'#---------------------FN_DYNVARS_024_02-------------------------#'
-SET @@global.delayed_insert_limit = @start_value;
-SELECT @@global.delayed_insert_limit = 100;
-@@global.delayed_insert_limit = 100
-1
-'#--------------------FN_DYNVARS_024_03------------------------#'
-SET @@global.delayed_insert_limit = 10000;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-10000
-SET @@global.delayed_insert_limit = 4294967295;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-4294967295
-SET @@global.delayed_insert_limit = 1;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-1
-'#--------------------FN_DYNVARS_024_04-------------------------#'
-SET @@global.delayed_insert_limit = 0;
-Warnings:
-Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-1
-SET @@global.delayed_insert_limit = -1024;
-Warnings:
-Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-1
-SET @@global.delayed_insert_limit = 42949672950;
-Warnings:
-Warning	1292	Truncated incorrect delayed_insert_limit value: '42949672950'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.delayed_insert_limit = 429496729.5;
-ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-4294967295
-SET @@global.delayed_insert_limit = ON;
-ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-4294967295
-'#-------------------FN_DYNVARS_024_05----------------------------#'
-SET @@session.delayed_insert_limit = 0;
-ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@Session.delayed_insert_limit;
-ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable
-'#----------------------FN_DYNVARS_024_06------------------------#'
-SELECT @@global.delayed_insert_limit =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='delayed_insert_limit';
-@@global.delayed_insert_limit =
-VARIABLE_VALUE
-1
-SELECT @@delayed_insert_limit =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='delayed_insert_limit';
-@@delayed_insert_limit =
-VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_024_07----------------------#'
-SET @@global.delayed_insert_limit = TRUE;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-1
-SET @@global.delayed_insert_limit = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-1
-'#---------------------FN_DYNVARS_024_08----------------------#'
-SET @@global.delayed_insert_limit = 1;
-SELECT @@delayed_insert_limit = @@global.delayed_insert_limit;
-@@delayed_insert_limit = @@global.delayed_insert_limit
-1
-'#---------------------FN_DYNVARS_024_09----------------------#'
-SET delayed_insert_limit = 1;
-ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@delayed_insert_limit;
-@@delayed_insert_limit
-1
-SET local.delayed_insert_limit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1
-SELECT local.delayed_insert_limit;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.delayed_insert_limit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1
-SELECT global.delayed_insert_limit;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT delayed_insert_limit = @@session.delayed_insert_limit;
-ERROR 42S22: Unknown column 'delayed_insert_limit' in 'field list'
-SET @@global.delayed_insert_limit = @start_value;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-100
diff --git a/mysql-test/r/delayed_queue_size_basic_32.result b/mysql-test/r/delayed_queue_size_basic_32.result
deleted file mode 100644
index 6bfa6f0de40..00000000000
--- a/mysql-test/r/delayed_queue_size_basic_32.result
+++ /dev/null
@@ -1,110 +0,0 @@
-SET @start_value = @@global.delayed_queue_size;
-SELECT @start_value;
-@start_value
-1000
-'#--------------------FN_DYNVARS_026_01------------------------#'
-SET @@global.delayed_queue_size = 100;
-SET @@global.delayed_queue_size = DEFAULT;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1000
-'#---------------------FN_DYNVARS_026_02-------------------------#'
-SET @@global.delayed_queue_size = @start_value;
-SELECT @@global.delayed_queue_size = 1000;
-@@global.delayed_queue_size = 1000
-1
-'#--------------------FN_DYNVARS_026_03------------------------#'
-SET @@global.delayed_queue_size = 10000;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-10000
-SET @@global.delayed_queue_size = 4294967295;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-4294967295
-SET @@global.delayed_queue_size = 1;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1
-'#--------------------FN_DYNVARS_026_04-------------------------#'
-SET @@global.delayed_queue_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect delayed_queue_size value: '0'
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1
-SET @@global.delayed_queue_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect delayed_queue_size value: '0'
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1
-SET @@global.delayed_queue_size = 42949672950;
-Warnings:
-Warning	1292	Truncated incorrect delayed_queue_size value: '42949672950'
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.delayed_queue_size = 429496729.5;
-ERROR 42000: Incorrect argument type to variable 'delayed_queue_size'
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-4294967295
-SET @@global.delayed_queue_size = ON;
-ERROR 42000: Incorrect argument type to variable 'delayed_queue_size'
-SELECT @@delayed_queue_size;
-@@delayed_queue_size
-4294967295
-'#-------------------FN_DYNVARS_026_05----------------------------#'
-SET @@session.delayed_queue_size = 0;
-ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.delayed_queue_size;
-ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable
-'#----------------------FN_DYNVARS_026_06------------------------#'
-SELECT @@global.delayed_queue_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='delayed_queue_size';
-@@global.delayed_queue_size = VARIABLE_VALUE
-1
-SELECT @@delayed_queue_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='delayed_queue_size';
-@@delayed_queue_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_026_07----------------------#'
-SET @@global.delayed_queue_size = TRUE;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1
-SET @@global.delayed_queue_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect delayed_queue_size value: '0'
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1
-'#---------------------FN_DYNVARS_026_08----------------------#'
-SET @@global.delayed_queue_size = 1;
-SELECT @@delayed_queue_size = @@global.delayed_queue_size;
-@@delayed_queue_size = @@global.delayed_queue_size
-1
-'#---------------------FN_DYNVARS_026_09----------------------#'
-SET delayed_queue_size = 1;
-ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@delayed_queue_size;
-@@delayed_queue_size
-1
-SET local.delayed_queue_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1
-SELECT local.delayed_queue_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.delayed_queue_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1
-SELECT global.delayed_queue_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT delayed_queue_size = @@session.delayed_queue_size;
-ERROR 42S22: Unknown column 'delayed_queue_size' in 'field list'
-SET @@global.delayed_queue_size = @start_value;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1000
diff --git a/mysql-test/r/innodb_concurrency_tickets_basic_32.result b/mysql-test/r/innodb_concurrency_tickets_basic_32.result
deleted file mode 100644
index 1d1317d0d5e..00000000000
--- a/mysql-test/r/innodb_concurrency_tickets_basic_32.result
+++ /dev/null
@@ -1,100 +0,0 @@
-SET @global_start_value = @@global.innodb_concurrency_tickets;
-SELECT @global_start_value;
-@global_start_value
-500
-'#--------------------FN_DYNVARS_046_01------------------------#'
-SET @@global.innodb_concurrency_tickets = 0;
-Warnings:
-Warning	1292	Truncated incorrect concurrency_tickets value: '0'
-SET @@global.innodb_concurrency_tickets = DEFAULT;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-500
-'#---------------------FN_DYNVARS_046_02-------------------------#'
-SET innodb_concurrency_tickets = 1;
-ERROR HY000: Variable 'innodb_concurrency_tickets' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@innodb_concurrency_tickets;
-@@innodb_concurrency_tickets
-500
-SELECT local.innodb_concurrency_tickets;
-ERROR 42S02: Unknown table 'local' in field list
-SET global innodb_concurrency_tickets = 0;
-Warnings:
-Warning	1292	Truncated incorrect concurrency_tickets value: '0'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-'#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@global.innodb_concurrency_tickets = 1;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-SET @@global.innodb_concurrency_tickets = 1000;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1000
-SET @@global.innodb_concurrency_tickets = 4294967295;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-4294967295
-'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@global.innodb_concurrency_tickets = -1;
-Warnings:
-Warning	1292	Truncated incorrect concurrency_tickets value: '18446744073709551615'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-4294967295
-SET @@global.innodb_concurrency_tickets = "T";
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-4294967295
-SET @@global.innodb_concurrency_tickets = "Y";
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-4294967295
-SET @@global.innodb_concurrency_tickets = 1001;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
-SELECT @@global.innodb_concurrency_tickets =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_concurrency_tickets';
-@@global.innodb_concurrency_tickets =
-VARIABLE_VALUE
-1
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_concurrency_tickets';
-VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
-SET @@global.innodb_concurrency_tickets = OFF;
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-SET @@global.innodb_concurrency_tickets = ON;
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
-SET @@global.innodb_concurrency_tickets = TRUE;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-SET @@global.innodb_concurrency_tickets = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect concurrency_tickets value: '0'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-SET @@global.innodb_concurrency_tickets = @global_start_value;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-500
diff --git a/mysql-test/r/innodb_max_purge_lag_basic_32.result b/mysql-test/r/innodb_max_purge_lag_basic_32.result
deleted file mode 100644
index ed960f12ff1..00000000000
--- a/mysql-test/r/innodb_max_purge_lag_basic_32.result
+++ /dev/null
@@ -1,94 +0,0 @@
-SET @global_start_value = @@global.innodb_max_purge_lag;
-SELECT @global_start_value;
-@global_start_value
-0
-'#--------------------FN_DYNVARS_046_01------------------------#'
-SET @@global.innodb_max_purge_lag = 0;
-SET @@global.innodb_max_purge_lag = DEFAULT;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-'#---------------------FN_DYNVARS_046_02-------------------------#'
-SET innodb_max_purge_lag = 1;
-ERROR HY000: Variable 'innodb_max_purge_lag' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@innodb_max_purge_lag;
-@@innodb_max_purge_lag
-0
-SELECT local.innodb_max_purge_lag;
-ERROR 42S02: Unknown table 'local' in field list
-SET global innodb_max_purge_lag = 0;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-'#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@global.innodb_max_purge_lag = 0;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-SET @@global.innodb_max_purge_lag = 1;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1
-SET @@global.innodb_max_purge_lag = 4294967295;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-4294967295
-'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@global.innodb_max_purge_lag = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_purge_lag value: '18446744073709551615'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-4294967295
-SET @@global.innodb_max_purge_lag = "T";
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-4294967295
-SET @@global.innodb_max_purge_lag = "Y";
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-4294967295
-SET @@global.innodb_max_purge_lag = 1001;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
-SELECT @@global.innodb_max_purge_lag =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_max_purge_lag';
-@@global.innodb_max_purge_lag =
-VARIABLE_VALUE
-1
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_max_purge_lag';
-VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
-SET @@global.innodb_max_purge_lag = OFF;
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-SET @@global.innodb_max_purge_lag = ON;
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
-SET @@global.innodb_max_purge_lag = TRUE;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1
-SET @@global.innodb_max_purge_lag = FALSE;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-SET @@global.innodb_max_purge_lag = @global_start_value;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
diff --git a/mysql-test/r/innodb_sync_spin_loops_basic_32.result b/mysql-test/r/innodb_sync_spin_loops_basic_32.result
deleted file mode 100644
index 2b976e65b14..00000000000
--- a/mysql-test/r/innodb_sync_spin_loops_basic_32.result
+++ /dev/null
@@ -1,94 +0,0 @@
-SET @global_start_value = @@global.innodb_sync_spin_loops;
-SELECT @global_start_value;
-@global_start_value
-20
-'#--------------------FN_DYNVARS_046_01------------------------#'
-SET @@global.innodb_sync_spin_loops = 0;
-SET @@global.innodb_sync_spin_loops = DEFAULT;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-20
-'#---------------------FN_DYNVARS_046_02-------------------------#'
-SET innodb_sync_spin_loops = 1;
-ERROR HY000: Variable 'innodb_sync_spin_loops' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@innodb_sync_spin_loops;
-@@innodb_sync_spin_loops
-20
-SELECT local.innodb_sync_spin_loops;
-ERROR 42S02: Unknown table 'local' in field list
-SET global innodb_sync_spin_loops = 0;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-0
-'#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@global.innodb_sync_spin_loops = 0;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-0
-SET @@global.innodb_sync_spin_loops = 1;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1
-SET @@global.innodb_sync_spin_loops = 1000;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1000
-'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@global.innodb_sync_spin_loops = -1;
-Warnings:
-Warning	1292	Truncated incorrect sync_spin_loops value: '18446744073709551615'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-4294967295
-SET @@global.innodb_sync_spin_loops = "T";
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-4294967295
-SET @@global.innodb_sync_spin_loops = "Y";
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-4294967295
-SET @@global.innodb_sync_spin_loops = 1001;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
-SELECT @@global.innodb_sync_spin_loops =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_sync_spin_loops';
-@@global.innodb_sync_spin_loops =
-VARIABLE_VALUE
-1
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_sync_spin_loops';
-VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
-SET @@global.innodb_sync_spin_loops = OFF;
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-SET @@global.innodb_sync_spin_loops = ON;
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
-SET @@global.innodb_sync_spin_loops = TRUE;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1
-SET @@global.innodb_sync_spin_loops = FALSE;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-0
-SET @@global.innodb_sync_spin_loops = @global_start_value;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-20
diff --git a/mysql-test/r/join_buffer_size_basic_32.result b/mysql-test/r/join_buffer_size_basic_32.result
deleted file mode 100644
index fc3061d2f59..00000000000
--- a/mysql-test/r/join_buffer_size_basic_32.result
+++ /dev/null
@@ -1,198 +0,0 @@
-SET @start_global_value = @@global.join_buffer_size;
-SELECT @start_global_value;
-@start_global_value
-131072
-SET @start_session_value = @@session.join_buffer_size;
-SELECT @start_session_value;
-@start_session_value
-131072
-'#--------------------FN_DYNVARS_053_01-------------------------#'
-SET @@global.join_buffer_size = 8200;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8200'
-SET @@global.join_buffer_size = DEFAULT;
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-131072
-SET @@session.join_buffer_size = 8200;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8200'
-SET @@session.join_buffer_size = DEFAULT;
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-131072
-'#--------------------FN_DYNVARS_053_02-------------------------#'
-SET @@global.join_buffer_size = DEFAULT;
-SELECT @@global.join_buffer_size = 131072;
-@@global.join_buffer_size = 131072
-1
-SET @@session.join_buffer_size = DEFAULT;
-SELECT @@session.join_buffer_size = 131072;
-@@session.join_buffer_size = 131072
-1
-'#--------------------FN_DYNVARS_053_03-------------------------#'
-SET @@global.join_buffer_size = 8200;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8200'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = 65536;
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-65536
-SET @@global.join_buffer_size = 4294967295;
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-4294963200
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-'#--------------------FN_DYNVARS_053_04-------------------------#'
-SET @@session.join_buffer_size = 8200;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8200'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = 65536;
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-65536
-SET @@session.join_buffer_size = 4294967295;
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-4294963200
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-'#------------------FN_DYNVARS_053_05-----------------------#'
-SET @@global.join_buffer_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = 8199;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8199'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = 42949672951;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '42949672951'
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-4294963200
-SET @@global.join_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-4294963200
-SET @@global.join_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-4294963200
-SET @@session.join_buffer_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = -2;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = 8199;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8199'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = 42949672951;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '42949672951'
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-4294963200
-SET @@session.join_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-4294963200
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@session.join_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-4294963200
-'#------------------FN_DYNVARS_053_06-----------------------#'
-SELECT @@global.join_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='join_buffer_size';
-@@global.join_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_053_07-----------------------#'
-SELECT @@session.join_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='join_buffer_size';
-@@session.join_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_053_08-----------------------#'
-SET @@global.join_buffer_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '1'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.join_buffer_size = 10;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '10'
-SELECT @@join_buffer_size = @@global.join_buffer_size;
-@@join_buffer_size = @@global.join_buffer_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@join_buffer_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '100'
-SELECT @@join_buffer_size = @@local.join_buffer_size;
-@@join_buffer_size = @@local.join_buffer_size
-1
-SELECT @@local.join_buffer_size = @@session.join_buffer_size;
-@@local.join_buffer_size = @@session.join_buffer_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET join_buffer_size = 1;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '1'
-SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
-@@join_buffer_size=8200 OR @@join_buffer_size= 8228
-1
-SELECT local.join_buffer_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.join_buffer_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT join_buffer_size = @@session.join_buffer_size;
-ERROR 42S22: Unknown column 'join_buffer_size' in 'field list'
-SET @@global.join_buffer_size = @start_global_value;
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-131072
-SET @@session.join_buffer_size = @start_session_value;
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-131072
diff --git a/mysql-test/r/key_buffer_size_basic_32.result b/mysql-test/r/key_buffer_size_basic_32.result
deleted file mode 100644
index 981988a1d4d..00000000000
--- a/mysql-test/r/key_buffer_size_basic_32.result
+++ /dev/null
@@ -1,111 +0,0 @@
-SET @start_value = @@global.key_buffer_size;
-SELECT @start_value;
-@start_value
-1048576
-'#--------------------FN_DYNVARS_055_01------------------------#'
-SET @@global.key_buffer_size = 99;
-SET @@global.key_buffer_size = DEFAULT;
-ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-'#---------------------FN_DYNVARS_055_02-------------------------#'
-SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size = @start_value;
-@@global.key_buffer_size = @start_value
-1
-'#--------------------FN_DYNVARS_055_03------------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@global.key_buffer_size= @min_key_buffer_size;
-@@global.key_buffer_size= @min_key_buffer_size
-1
-SET @@global.key_buffer_size = 1800;
-Warnings:
-Warning	1292	Truncated incorrect key_buffer_size value: '1800'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-SET @@global.key_buffer_size = 65535;
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-61440
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-'#--------------------FN_DYNVARS_055_04-------------------------#'
-SET @@global.key_buffer_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-61440
-SET @@global.key_buffer_size = 4;
-Warnings:
-Warning	1292	Truncated incorrect key_buffer_size value: '4'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.key_buffer_size = ON;
-ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-SET @@global.key_buffer_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-'#-------------------FN_DYNVARS_055_05----------------------------#'
-SET @@session.key_buffer_size = 0;
-ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
-1
-'#----------------------FN_DYNVARS_055_06------------------------#'
-SELECT @@global.key_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_buffer_size';
-@@global.key_buffer_size = VARIABLE_VALUE
-1
-SELECT @@key_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_buffer_size';
-@@key_buffer_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_055_07----------------------#'
-SET @@global.key_buffer_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect key_buffer_size value: '1'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-SET @@global.key_buffer_size = FALSE;
-Warnings:
-Warning	1438	Cannot drop default keycache
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-'#---------------------FN_DYNVARS_055_08----------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@key_buffer_size = @@global.key_buffer_size;
-@@key_buffer_size = @@global.key_buffer_size
-1
-'#---------------------FN_DYNVARS_055_09----------------------#'
-SET key_buffer_size = @min_key_buffer_size;
-ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
-1
-SET local.key_buffer_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
-SELECT local.key_buffer_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_buffer_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
-SELECT global.key_buffer_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_buffer_size = @@session.key_buffer_size;
-ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
-SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-1048576
diff --git a/mysql-test/r/key_cache_age_threshold_basic_32.result b/mysql-test/r/key_cache_age_threshold_basic_32.result
deleted file mode 100644
index 023b23ea425..00000000000
--- a/mysql-test/r/key_cache_age_threshold_basic_32.result
+++ /dev/null
@@ -1,126 +0,0 @@
-SET @start_value = @@global.key_cache_age_threshold;
-SELECT @start_value;
-@start_value
-300
-'#--------------------FN_DYNVARS_056_01------------------------#'
-SET @@global.key_cache_age_threshold = 99;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_age_threshold value: '99'
-SET @@global.key_cache_age_threshold = DEFAULT;
-ERROR 42000: Variable 'key_cache_age_threshold' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-'#---------------------FN_DYNVARS_056_02-------------------------#'
-SET @@global.key_cache_age_threshold = @start_value;
-SELECT @@global.key_cache_age_threshold = 300;
-@@global.key_cache_age_threshold = 300
-1
-'#--------------------FN_DYNVARS_056_03------------------------#'
-SET @@global.key_cache_age_threshold = 100;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-SET @@global.key_cache_age_threshold = 4294967295;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-4294967200
-SET @@global.key_cache_age_threshold = 1800;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-1800
-SET @@global.key_cache_age_threshold = 65535;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-65500
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-'#--------------------FN_DYNVARS_056_04-------------------------#'
-SET @@global.key_cache_age_threshold = -1;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-4294967200
-SET @@global.key_cache_age_threshold = 42949672951;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-4294967200
-SET @@global.key_cache_age_threshold = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-4294967200
-SET @@global.key_cache_age_threshold = -1024;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-4294966200
-SET @@global.key_cache_age_threshold = 99;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_age_threshold value: '99'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.key_cache_age_threshold = ON;
-ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-SET @@global.key_cache_age_threshold = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-'#-------------------FN_DYNVARS_056_05----------------------------#'
-SET @@session.key_cache_age_threshold = 0;
-ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.key_cache_age_threshold;
-ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable
-'#----------------------FN_DYNVARS_056_06------------------------#'
-SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_age_threshold';
-@@global.key_cache_age_threshold = VARIABLE_VALUE
-1
-SELECT @@key_cache_age_threshold = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_age_threshold';
-@@key_cache_age_threshold = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_056_07----------------------#'
-SET @@global.key_cache_age_threshold = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_age_threshold value: '1'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-SET @@global.key_cache_age_threshold = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_age_threshold value: '0'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-'#---------------------FN_DYNVARS_056_08----------------------#'
-SET @@global.key_cache_age_threshold = 101;
-SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold;
-@@key_cache_age_threshold = @@global.key_cache_age_threshold
-1
-'#---------------------FN_DYNVARS_056_09----------------------#'
-SET key_cache_age_threshold = 8000;
-ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_cache_age_threshold;
-@@key_cache_age_threshold
-100
-SET local.key_cache_age_threshold = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1
-SELECT local.key_cache_age_threshold;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_age_threshold = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1
-SELECT global.key_cache_age_threshold;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_cache_age_threshold = @@session.key_cache_age_threshold;
-ERROR 42S22: Unknown column 'key_cache_age_threshold' in 'field list'
-SET @@global.key_cache_age_threshold = @start_value;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-300
diff --git a/mysql-test/r/key_cache_block_size_basic_32.result b/mysql-test/r/key_cache_block_size_basic_32.result
deleted file mode 100644
index ac78acb8244..00000000000
--- a/mysql-test/r/key_cache_block_size_basic_32.result
+++ /dev/null
@@ -1,142 +0,0 @@
-SET @start_value = @@global.key_cache_block_size;
-SELECT @start_value;
-@start_value
-1024
-'#--------------------FN_DYNVARS_057_01------------------------#'
-SET @@global.key_cache_block_size = 600;
-SET @@global.key_cache_block_size = DEFAULT;
-ERROR 42000: Variable 'key_cache_block_size' doesn't have a default value
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-'#---------------------FN_DYNVARS_057_02-------------------------#'
-SET @@global.key_cache_block_size = @start_value;
-SELECT @@global.key_cache_block_size = 1024;
-@@global.key_cache_block_size = 1024
-1
-'#--------------------FN_DYNVARS_057_03------------------------#'
-SET @@global.key_cache_block_size = 1024;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-1024
-SET @@global.key_cache_block_size = 16384;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 1800;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-1536
-SET @@global.key_cache_block_size = 16383;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-15872
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-'#--------------------FN_DYNVARS_057_04-------------------------#'
-SET @@global.key_cache_block_size = -1;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '4294967295'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 42949672951;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '4294967287'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '4294966272'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 256;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '256'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-SET @@global.key_cache_block_size = 511;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '511'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-SET @@global.key_cache_block_size = 16385;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '16385'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.key_cache_block_size = ON;
-ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-'#-------------------FN_DYNVARS_057_05----------------------------#'
-SET @@session.key_cache_block_size = 0;
-ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.key_cache_block_size;
-ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable
-'#----------------------FN_DYNVARS_057_06------------------------#'
-SELECT @@global.key_cache_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_block_size';
-@@global.key_cache_block_size = VARIABLE_VALUE
-1
-SELECT @@key_cache_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_block_size';
-@@key_cache_block_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_057_07----------------------#'
-SET @@global.key_cache_block_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '1'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-SET @@global.key_cache_block_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '0'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-'#---------------------FN_DYNVARS_057_08----------------------#'
-SET @@global.key_cache_block_size = 1024;
-SELECT @@key_cache_block_size = @@global.key_cache_block_size;
-@@key_cache_block_size = @@global.key_cache_block_size
-1
-'#---------------------FN_DYNVARS_057_09----------------------#'
-SET key_cache_block_size = 8000;
-ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_cache_block_size;
-@@key_cache_block_size
-1024
-SET local.key_cache_block_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1
-SELECT local.key_cache_block_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_block_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1
-SELECT global.key_cache_block_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_cache_block_size = @@session.key_cache_block_size;
-ERROR 42S22: Unknown column 'key_cache_block_size' in 'field list'
-SET @@global.key_cache_block_size = @start_value;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-1024
diff --git a/mysql-test/r/key_cache_division_limit_basic_32.result b/mysql-test/r/key_cache_division_limit_basic_32.result
deleted file mode 100644
index 5902dbcdf89..00000000000
--- a/mysql-test/r/key_cache_division_limit_basic_32.result
+++ /dev/null
@@ -1,139 +0,0 @@
-SET @start_value = @@global.key_cache_division_limit;
-SELECT @start_value;
-@start_value
-100
-'#--------------------FN_DYNVARS_058_01------------------------#'
-SET @@global.key_cache_division_limit = 50;
-SET @@global.key_cache_division_limit = DEFAULT;
-ERROR 42000: Variable 'key_cache_division_limit' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-50
-'#---------------------FN_DYNVARS_058_02-------------------------#'
-SET @@global.key_cache_division_limit = @start_value;
-SELECT @@global.key_cache_division_limit = 100;
-@@global.key_cache_division_limit = 100
-1
-'#--------------------FN_DYNVARS_058_03------------------------#'
-SET @@global.key_cache_division_limit = 1;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-SET @@global.key_cache_division_limit = 50;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-50
-SET @@global.key_cache_division_limit = 99;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-99
-SET @@global.key_cache_division_limit = 2;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-2
-'#--------------------FN_DYNVARS_058_04-------------------------#'
-SET @@global.key_cache_division_limit = -1;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '4294967295'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 101;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '101'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = -1024;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '4294966272'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 0;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '0'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-SET @@global.key_cache_division_limit = 200;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '200'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 65535;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '65535'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.key_cache_division_limit = ON;
-ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-'#-------------------FN_DYNVARS_058_05----------------------------#'
-SET @@session.key_cache_division_limit = 0;
-ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.key_cache_division_limit;
-ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable
-'#----------------------FN_DYNVARS_058_06------------------------#'
-SELECT @@global.key_cache_division_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_division_limit';
-@@global.key_cache_division_limit = VARIABLE_VALUE
-1
-SELECT @@key_cache_division_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_division_limit';
-@@key_cache_division_limit = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_058_07----------------------#'
-SET @@global.key_cache_division_limit = TRUE;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-SET @@global.key_cache_division_limit = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '0'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-'#---------------------FN_DYNVARS_058_08----------------------#'
-SET @@global.key_cache_division_limit = 90;
-SELECT @@key_cache_division_limit = @@global.key_cache_division_limit;
-@@key_cache_division_limit = @@global.key_cache_division_limit
-1
-'#---------------------FN_DYNVARS_058_09----------------------#'
-SET key_cache_division_limit = 80;
-ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_cache_division_limit;
-@@key_cache_division_limit
-90
-SET local.key_cache_division_limit = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1
-SELECT local.key_cache_division_limit;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_division_limit = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1
-SELECT global.key_cache_division_limit;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_cache_division_limit = @@session.key_cache_division_limit;
-ERROR 42S22: Unknown column 'key_cache_division_limit' in 'field list'
-SET @@global.key_cache_division_limit = @start_value;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
diff --git a/mysql-test/r/log_warnings_basic_32.result b/mysql-test/r/log_warnings_basic_32.result
deleted file mode 100644
index 702e95b1383..00000000000
--- a/mysql-test/r/log_warnings_basic_32.result
+++ /dev/null
@@ -1,162 +0,0 @@
-SET @start_global_value = @@global.log_warnings;
-SELECT @start_global_value;
-@start_global_value
-1
-SET @start_session_value = @@session.log_warnings;
-SELECT @start_session_value;
-@start_session_value
-1
-'#--------------------FN_DYNVARS_067_01-------------------------#'
-SET @@global.log_warnings = 100;
-SET @@global.log_warnings = DEFAULT;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-1
-SET @@session.log_warnings = 200;
-SET @@session.log_warnings = DEFAULT;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-1
-'#--------------------FN_DYNVARS_067_02-------------------------#'
-SET @@global.log_warnings = DEFAULT;
-SELECT @@global.log_warnings = 1;
-@@global.log_warnings = 1
-1
-SET @@session.log_warnings = DEFAULT;
-SELECT @@session.log_warnings = 1;
-@@session.log_warnings = 1
-1
-'#--------------------FN_DYNVARS_067_03-------------------------#'
-SET @@global.log_warnings = 0;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-0
-SET @@global.log_warnings = 1;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-1
-SET @@global.log_warnings = 60020;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-60020
-SET @@global.log_warnings = 65535;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-65535
-SET @@global.log_warnings = 65536;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-65536
-'#--------------------FN_DYNVARS_067_04-------------------------#'
-SET @@session.log_warnings = 0;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-0
-SET @@session.log_warnings = 1;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-1
-SET @@session.log_warnings = 50050;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-50050
-SET @@session.log_warnings = 65535;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-65535
-SET @@session.log_warnings = 65550;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-65550
-'#------------------FN_DYNVARS_067_05-----------------------#'
-SET @@global.log_warnings = 100000000000;
-Warnings:
-Warning	1292	Truncated incorrect log-warnings value: '100000000000'
-SELECT @@global.log_warnings;
-@@global.log_warnings
-4294967295
-SET @@global.log_warnings = -1024;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-0
-SET @@global.log_warnings = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.log_warnings;
-@@global.log_warnings
-0
-SET @@global.log_warnings = test;
-ERROR 42000: Incorrect argument type to variable 'log_warnings'
-SELECT @@global.log_warnings;
-@@global.log_warnings
-0
-SET @@session.log_warnings = 100000000000;
-Warnings:
-Warning	1292	Truncated incorrect log-warnings value: '100000000000'
-SELECT @@session.log_warnings;
-@@session.log_warnings
-4294967295
-SET @@session.log_warnings = -2;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-0
-SET @@session.log_warnings = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.log_warnings = test;
-ERROR 42000: Incorrect argument type to variable 'log_warnings'
-SELECT @@session.log_warnings;
-@@session.log_warnings
-0
-'#------------------FN_DYNVARS_067_06-----------------------#'
-SELECT @@global.log_warnings = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='log_warnings';
-@@global.log_warnings = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_067_07-----------------------#'
-SELECT @@session.log_warnings = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='log_warnings';
-@@session.log_warnings = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_067_08-----------------------#'
-SET @@global.log_warnings = TRUE;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-1
-SET @@global.log_warnings = FALSE;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-0
-'#---------------------FN_DYNVARS_067_09----------------------#'
-SET @@global.log_warnings = 10;
-SELECT @@log_warnings = @@global.log_warnings;
-@@log_warnings = @@global.log_warnings
-0
-'#---------------------FN_DYNVARS_067_10----------------------#'
-SET @@log_warnings = 100;
-SELECT @@log_warnings = @@local.log_warnings;
-@@log_warnings = @@local.log_warnings
-1
-SELECT @@local.log_warnings = @@session.log_warnings;
-@@local.log_warnings = @@session.log_warnings
-1
-'#---------------------FN_DYNVARS_067_11----------------------#'
-SET log_warnings = 1;
-SELECT @@log_warnings;
-@@log_warnings
-1
-SELECT local.log_warnings;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.log_warnings;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT log_warnings = @@session.log_warnings;
-ERROR 42S22: Unknown column 'log_warnings' in 'field list'
-SET @@global.log_warnings = @start_global_value;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-1
-SET @@session.log_warnings = @start_session_value;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-1
diff --git a/mysql-test/r/max_binlog_cache_size_basic_32.result b/mysql-test/r/max_binlog_cache_size_basic_32.result
deleted file mode 100644
index 1dbeb50ff90..00000000000
--- a/mysql-test/r/max_binlog_cache_size_basic_32.result
+++ /dev/null
@@ -1,145 +0,0 @@
-SET @start_value = @@global.max_binlog_cache_size;
-SELECT @start_value;
-@start_value
-4294967295
-'#--------------------FN_DYNVARS_072_01------------------------#'
-SET @@global.max_binlog_cache_size = 5000;
-SET @@global.max_binlog_cache_size = DEFAULT;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
-'#---------------------FN_DYNVARS_072_02-------------------------#'
-SET @@global.max_binlog_cache_size = @start_value;
-SELECT @@global.max_binlog_cache_size = 4294967295;
-@@global.max_binlog_cache_size = 4294967295
-0
-'Bug# 34876: Incorrect Default Value is assigned to variable';
-'#--------------------FN_DYNVARS_072_03------------------------#'
-SET @@global.max_binlog_cache_size = 4096;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 4294967295;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
-SET @@global.max_binlog_cache_size = 4294967294;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
-SET @@global.max_binlog_cache_size = 4097;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 65535;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-61440
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_072_04-------------------------#'
-SET @@global.max_binlog_cache_size = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 100000000000;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '100000000000'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
-SET @@global.max_binlog_cache_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
-SET @@global.max_binlog_cache_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 1024;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '1024'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '4294967296'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
-SET @@global.max_binlog_cache_size = 4095;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '4095'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.max_binlog_cache_size = ON;
-ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-'#-------------------FN_DYNVARS_072_05----------------------------#'
-SET @@session.max_binlog_cache_size = 4096;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.max_binlog_cache_size;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable
-'#----------------------FN_DYNVARS_072_06------------------------#'
-SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_binlog_cache_size';
-@@global.max_binlog_cache_size = VARIABLE_VALUE
-1
-SELECT @@max_binlog_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_binlog_cache_size';
-@@max_binlog_cache_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_072_07----------------------#'
-SET @@global.max_binlog_cache_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '1'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-'#---------------------FN_DYNVARS_072_08----------------------#'
-SET @@global.max_binlog_cache_size = 5000;
-SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
-@@max_binlog_cache_size = @@global.max_binlog_cache_size
-1
-'#---------------------FN_DYNVARS_072_09----------------------#'
-SET max_binlog_cache_size = 6000;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@max_binlog_cache_size;
-@@max_binlog_cache_size
-4096
-SET local.max_binlog_cache_size = 7000;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 7000' at line 1
-SELECT local.max_binlog_cache_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.max_binlog_cache_size = 8000;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 8000' at line 1
-SELECT global.max_binlog_cache_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
-ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list'
-SET @@global.max_binlog_cache_size = @start_value;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
diff --git a/mysql-test/r/max_connect_errors_basic_32.result b/mysql-test/r/max_connect_errors_basic_32.result
deleted file mode 100644
index b786e0ce31a..00000000000
--- a/mysql-test/r/max_connect_errors_basic_32.result
+++ /dev/null
@@ -1,137 +0,0 @@
-SET @start_value = @@global.max_connect_errors;
-SELECT @start_value;
-@start_value
-10
-'#--------------------FN_DYNVARS_073_01------------------------#'
-SET @@global.max_connect_errors = 5000;
-SET @@global.max_connect_errors = DEFAULT;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-10
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#---------------------FN_DYNVARS_073_02-------------------------#'
-SET @@global.max_connect_errors = @start_value;
-SELECT @@global.max_connect_errors = 10;
-@@global.max_connect_errors = 10
-1
-'#--------------------FN_DYNVARS_073_03------------------------#'
-SET @@global.max_connect_errors = 4096;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4096
-SET @@global.max_connect_errors = 4294967294;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967294
-SET @@global.max_connect_errors = 4294967295;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967295
-SET @@global.max_connect_errors = 1;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-SET @@global.max_connect_errors = 2;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-2
-'Bug# 34877:  Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_073_04-------------------------#'
-SET @@global.max_connect_errors = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '0'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-SET @@global.max_connect_errors = 100000000000;
-Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '100000000000'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967295
-SET @@global.max_connect_errors = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967295
-SET @@global.max_connect_errors = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '0'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-SET @@global.max_connect_errors = 0;
-Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '0'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-SET @@global.max_connect_errors = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '4294967296'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.max_connect_errors = ON;
-ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967295
-SET @@global.max_connect_errors = 'test';
-ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967295
-'#-------------------FN_DYNVARS_073_05----------------------------#'
-SET @@session.max_connect_errors = 4096;
-ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.max_connect_errors;
-ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable
-'#----------------------FN_DYNVARS_073_06------------------------#'
-SELECT @@global.max_connect_errors = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_connect_errors';
-@@global.max_connect_errors = VARIABLE_VALUE
-1
-SELECT @@max_connect_errors = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_connect_errors';
-@@max_connect_errors = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_073_07----------------------#'
-SET @@global.max_connect_errors = TRUE;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-SET @@global.max_connect_errors = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '0'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-'#---------------------FN_DYNVARS_073_08----------------------#'
-SET @@global.max_connect_errors = 5000;
-SELECT @@max_connect_errors = @@global.max_connect_errors;
-@@max_connect_errors = @@global.max_connect_errors
-1
-'#---------------------FN_DYNVARS_073_09----------------------#'
-SET max_connect_errors = 6000;
-ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@max_connect_errors;
-@@max_connect_errors
-5000
-SET local.max_connect_errors = 7000;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 7000' at line 1
-SELECT local.max_connect_errors;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.max_connect_errors = 8000;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 8000' at line 1
-SELECT global.max_connect_errors;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT max_connect_errors = @@session.max_connect_errors;
-ERROR 42S22: Unknown column 'max_connect_errors' in 'field list'
-SET @@global.max_connect_errors = @start_value;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-10
diff --git a/mysql-test/r/max_heap_table_size_basic_32.result b/mysql-test/r/max_heap_table_size_basic_32.result
deleted file mode 100644
index 04eaa3ddd19..00000000000
--- a/mysql-test/r/max_heap_table_size_basic_32.result
+++ /dev/null
@@ -1,196 +0,0 @@
-SET @start_global_value = @@global.max_heap_table_size;
-SELECT @start_global_value;
-@start_global_value
-1048576
-SET @start_session_value = @@session.max_heap_table_size;
-SELECT @start_session_value;
-@start_session_value
-1048576
-'#--------------------FN_DYNVARS_077_01-------------------------#'
-SET @@global.max_heap_table_size = 1677721610;
-SET @@global.max_heap_table_size = DEFAULT;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16777216
-SET @@session.max_heap_table_size = 1677721610;
-SET @@session.max_heap_table_size = DEFAULT;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16777216
-'#--------------------FN_DYNVARS_077_02-------------------------#'
-SET @@global.max_heap_table_size = DEFAULT;
-SELECT @@global.max_heap_table_size = 16777216;
-@@global.max_heap_table_size = 16777216
-1
-SET @@session.max_heap_table_size = DEFAULT;
-SELECT @@session.max_heap_table_size = 16777216;
-@@session.max_heap_table_size = 16777216
-1
-'#--------------------FN_DYNVARS_077_03-------------------------#'
-SET @@global.max_heap_table_size = 16384;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 16385;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 65535;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-64512
-SET @@global.max_heap_table_size = 4294967294;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294966272
-SET @@global.max_heap_table_size = 4294967295;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_077_04-------------------------#'
-SET @@session.max_heap_table_size = 16384;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 16385;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 65535;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-64512
-SET @@session.max_heap_table_size = 4294967294;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294966272
-SET @@session.max_heap_table_size = 4294967295;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#------------------FN_DYNVARS_077_05-----------------------#'
-SET @@global.max_heap_table_size = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 1024;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '1024'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 16383;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '16383'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 4294967296;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294966272
-SET @@global.max_heap_table_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294966272
-SET @@global.max_heap_table_size = test;
-ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294966272
-SET @@session.max_heap_table_size = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 16383;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '16383'
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 4294967296;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294966272
-SET @@session.max_heap_table_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.max_heap_table_size = 10737418241;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294966272
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.max_heap_table_size = test;
-ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294966272
-'#------------------FN_DYNVARS_077_06-----------------------#'
-SELECT @@global.max_heap_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_heap_table_size';
-@@global.max_heap_table_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_077_07-----------------------#'
-SELECT @@session.max_heap_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_heap_table_size';
-@@session.max_heap_table_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_077_08-----------------------#'
-SET @@global.max_heap_table_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '1'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-'#---------------------FN_DYNVARS_077_09----------------------#'
-SET @@global.max_heap_table_size = 163845;
-SELECT @@max_heap_table_size = @@global.max_heap_table_size;
-@@max_heap_table_size = @@global.max_heap_table_size
-0
-'#---------------------FN_DYNVARS_077_10----------------------#'
-SET @@max_heap_table_size = 16777216;
-SELECT @@max_heap_table_size = @@local.max_heap_table_size;
-@@max_heap_table_size = @@local.max_heap_table_size
-1
-SELECT @@local.max_heap_table_size = @@session.max_heap_table_size;
-@@local.max_heap_table_size = @@session.max_heap_table_size
-1
-'#---------------------FN_DYNVARS_077_11----------------------#'
-SET max_heap_table_size = 316777216;
-SELECT @@max_heap_table_size;
-@@max_heap_table_size
-316776448
-SELECT local.max_heap_table_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.max_heap_table_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT max_heap_table_size = @@session.max_heap_table_size;
-ERROR 42S22: Unknown column 'max_heap_table_size' in 'field list'
-SET @@global.max_heap_table_size = @start_global_value;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-1048576
-SET @@session.max_heap_table_size = @start_session_value;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-1048576
diff --git a/mysql-test/r/max_seeks_for_key_basic_32.result b/mysql-test/r/max_seeks_for_key_basic_32.result
deleted file mode 100644
index 64828fbe619..00000000000
--- a/mysql-test/r/max_seeks_for_key_basic_32.result
+++ /dev/null
@@ -1,180 +0,0 @@
-SET @start_global_value = @@global.max_seeks_for_key;
-SELECT @start_global_value;
-@start_global_value
-4294967295
-SET @start_session_value = @@session.max_seeks_for_key;
-SELECT @start_session_value;
-@start_session_value
-4294967295
-'#--------------------FN_DYNVARS_083_01-------------------------#'
-SET @@global.max_seeks_for_key = 100;
-SET @@global.max_seeks_for_key = DEFAULT;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967295
-SET @@session.max_seeks_for_key = 200;
-SET @@session.max_seeks_for_key = DEFAULT;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-4294967295
-'#--------------------FN_DYNVARS_083_02-------------------------#'
-SET @@global.max_seeks_for_key = DEFAULT;
-SELECT @@global.max_seeks_for_key = 4294967295;
-@@global.max_seeks_for_key = 4294967295
-1
-SET @@session.max_seeks_for_key = DEFAULT;
-SELECT @@session.max_seeks_for_key = 4294967295;
-@@session.max_seeks_for_key = 4294967295
-1
-'#--------------------FN_DYNVARS_083_03-------------------------#'
-SET @@global.max_seeks_for_key = 1;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-1
-SET @@global.max_seeks_for_key = 2;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-2
-SET @@global.max_seeks_for_key = 65536;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-65536
-SET @@global.max_seeks_for_key = 4294967295;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967295
-SET @@global.max_seeks_for_key = 4294967294;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967294
-'#--------------------FN_DYNVARS_083_04-------------------------#'
-SET @@session.max_seeks_for_key = 1;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-1
-SET @@session.max_seeks_for_key = 2;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-2
-SET @@session.max_seeks_for_key = 4294967295;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-4294967295
-SET @@session.max_seeks_for_key = 4294967294;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-4294967294
-SET @@session.max_seeks_for_key = 65535;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-65535
-'#------------------FN_DYNVARS_083_05-----------------------#'
-SET @@global.max_seeks_for_key = 0;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-1
-SET @@global.max_seeks_for_key = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-1
-SET @@global.max_seeks_for_key = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '4294967296'
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967295
-SET @@global.max_seeks_for_key = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967295
-SET @@global.max_seeks_for_key = test;
-ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967295
-SET @@session.max_seeks_for_key = 0;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-1
-SET @@session.max_seeks_for_key = -2;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-1
-SET @@session.max_seeks_for_key = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.max_seeks_for_key = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '4294967296'
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.max_seeks_for_key = test;
-ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-4294967295
-'#------------------FN_DYNVARS_083_06-----------------------#'
-SELECT @@global.max_seeks_for_key = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_seeks_for_key';
-@@global.max_seeks_for_key = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_083_07-----------------------#'
-SELECT @@session.max_seeks_for_key = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_seeks_for_key';
-@@session.max_seeks_for_key = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_083_08-----------------------#'
-SET @@global.max_seeks_for_key = TRUE;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-1
-SET @@global.max_seeks_for_key = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-1
-'#---------------------FN_DYNVARS_083_09----------------------#'
-SET @@global.max_seeks_for_key = 10;
-SELECT @@max_seeks_for_key = @@global.max_seeks_for_key;
-@@max_seeks_for_key = @@global.max_seeks_for_key
-0
-'#---------------------FN_DYNVARS_083_10----------------------#'
-SET @@max_seeks_for_key = 100;
-SELECT @@max_seeks_for_key = @@local.max_seeks_for_key;
-@@max_seeks_for_key = @@local.max_seeks_for_key
-1
-SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key;
-@@local.max_seeks_for_key = @@session.max_seeks_for_key
-1
-'#---------------------FN_DYNVARS_083_11----------------------#'
-SET max_seeks_for_key = 1;
-SELECT @@max_seeks_for_key;
-@@max_seeks_for_key
-1
-SELECT local.max_seeks_for_key;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.max_seeks_for_key;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT max_seeks_for_key = @@session.max_seeks_for_key;
-ERROR 42S22: Unknown column 'max_seeks_for_key' in 'field list'
-SET @@global.max_seeks_for_key = @start_global_value;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967295
-SET @@session.max_seeks_for_key = @start_session_value;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-4294967295
diff --git a/mysql-test/r/max_tmp_tables_basic_32.result b/mysql-test/r/max_tmp_tables_basic_32.result
deleted file mode 100644
index 5f959069661..00000000000
--- a/mysql-test/r/max_tmp_tables_basic_32.result
+++ /dev/null
@@ -1,197 +0,0 @@
-SET @start_global_value = @@global.max_tmp_tables;
-SELECT @start_global_value;
-@start_global_value
-32
-SET @start_session_value = @@session.max_tmp_tables;
-SELECT @start_session_value;
-@start_session_value
-32
-'#--------------------FN_DYNVARS_086_01-------------------------#'
-SET @@global.max_tmp_tables = 1000;
-SET @@global.max_tmp_tables = DEFAULT;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-32
-SET @@session.max_tmp_tables = 1000;
-SET @@session.max_tmp_tables = DEFAULT;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-32
-'#--------------------FN_DYNVARS_086_02-------------------------#'
-SET @@global.max_tmp_tables = DEFAULT;
-SELECT @@global.max_tmp_tables = 32;
-@@global.max_tmp_tables = 32
-1
-SET @@session.max_tmp_tables = DEFAULT;
-SELECT @@session.max_tmp_tables = 32;
-@@session.max_tmp_tables = 32
-1
-'#--------------------FN_DYNVARS_086_03-------------------------#'
-SET @@global.max_tmp_tables = 1;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = 2;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-2
-SET @@global.max_tmp_tables = 65536;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-65536
-SET @@global.max_tmp_tables = 4294967295;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@global.max_tmp_tables = 4294967294;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967294
-'#--------------------FN_DYNVARS_086_04-------------------------#'
-SET @@session.max_tmp_tables = 1;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-1
-SET @@session.max_tmp_tables = 2;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-2
-SET @@session.max_tmp_tables = 65536;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-65536
-SET @@session.max_tmp_tables = 4294967295;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = 4294967294;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967294
-'#------------------FN_DYNVARS_086_05-----------------------#'
-SET @@global.max_tmp_tables = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '4294967296'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@global.max_tmp_tables = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = 429496729500;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '429496729500'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@global.max_tmp_tables = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@global.max_tmp_tables = test;
-ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '4294967296'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-1
-SET @@session.max_tmp_tables = 429496729500;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '429496729500'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = -001;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-1
-SET @@session.max_tmp_tables = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.max_tmp_tables = 10737418241;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '10737418241'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = test;
-ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-'#------------------FN_DYNVARS_086_06-----------------------#'
-SELECT @@global.max_tmp_tables = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_tmp_tables';
-@@global.max_tmp_tables = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_086_07-----------------------#'
-SELECT @@session.max_tmp_tables = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_tmp_tables';
-@@session.max_tmp_tables = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_086_08-----------------------#'
-SET @@global.max_tmp_tables = TRUE;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-'#---------------------FN_DYNVARS_086_09----------------------#'
-SET @@global.max_tmp_tables = 20;
-SELECT @@max_tmp_tables = @@global.max_tmp_tables;
-@@max_tmp_tables = @@global.max_tmp_tables
-0
-'#---------------------FN_DYNVARS_086_10----------------------#'
-SET @@max_tmp_tables = 255;
-SELECT @@max_tmp_tables = @@local.max_tmp_tables;
-@@max_tmp_tables = @@local.max_tmp_tables
-1
-SELECT @@local.max_tmp_tables = @@session.max_tmp_tables;
-@@local.max_tmp_tables = @@session.max_tmp_tables
-1
-'#---------------------FN_DYNVARS_086_11----------------------#'
-SET max_tmp_tables = 102;
-SELECT @@max_tmp_tables;
-@@max_tmp_tables
-102
-SELECT local.max_tmp_tables;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.max_tmp_tables;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT max_tmp_tables = @@session.max_tmp_tables;
-ERROR 42S22: Unknown column 'max_tmp_tables' in 'field list'
-SET @@global.max_tmp_tables = @start_global_value;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-32
-SET @@session.max_tmp_tables = @start_session_value;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-32
diff --git a/mysql-test/r/max_write_lock_count_basic_32.result b/mysql-test/r/max_write_lock_count_basic_32.result
deleted file mode 100644
index 0c9c3c00c1f..00000000000
--- a/mysql-test/r/max_write_lock_count_basic_32.result
+++ /dev/null
@@ -1,108 +0,0 @@
-SET @start_global_value = @@global.max_write_lock_count;
-SELECT @start_global_value;
-@start_global_value
-4294967295
-'#--------------------FN_DYNVARS_088_01-------------------------#'
-SET @@global.max_write_lock_count = 1000;
-SET @@global.max_write_lock_count = DEFAULT;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967295
-'#--------------------FN_DYNVARS_088_02-------------------------#'
-SET @@global.max_write_lock_count = DEFAULT;
-SELECT @@global.max_write_lock_count = 4294967295;
-@@global.max_write_lock_count = 4294967295
-1
-'#--------------------FN_DYNVARS_088_03-------------------------#'
-SET @@global.max_write_lock_count = 1;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-1
-SET @@global.max_write_lock_count = 2;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-2
-SET @@global.max_write_lock_count = 65536;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-65536
-SET @@global.max_write_lock_count = 4294967295;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967295
-SET @@global.max_write_lock_count = 4294967294;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967294
-'#------------------FN_DYNVARS_088_04-----------------------#'
-SET @@global.max_write_lock_count = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_write_lock_count value: '0'
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-1
-SET @@global.max_write_lock_count = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect max_write_lock_count value: '4294967296'
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967295
-SET @@global.max_write_lock_count = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_write_lock_count value: '0'
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-1
-SET @@global.max_write_lock_count = 429496729500;
-Warnings:
-Warning	1292	Truncated incorrect max_write_lock_count value: '429496729500'
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967295
-SET @@global.max_write_lock_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967295
-SET @@global.max_write_lock_count = test;
-ERROR 42000: Incorrect argument type to variable 'max_write_lock_count'
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967295
-'#------------------FN_DYNVARS_088_05-----------------------#'
-SELECT @@global.max_write_lock_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_write_lock_count';
-@@global.max_write_lock_count = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_088_06-----------------------#'
-SET @@global.max_write_lock_count = TRUE;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-1
-SET @@global.max_write_lock_count = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_write_lock_count value: '0'
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-1
-'#---------------------FN_DYNVARS_088_07----------------------#'
-SET @@global.max_write_lock_count = 20;
-SELECT @@max_write_lock_count = @@global.max_write_lock_count;
-@@max_write_lock_count = @@global.max_write_lock_count
-1
-'#---------------------FN_DYNVARS_088_08----------------------#'
-SET @@global.max_write_lock_count = 102;
-SELECT @@max_write_lock_count;
-@@max_write_lock_count
-102
-SELECT local.max_write_lock_count;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT global.max_write_lock_count;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT max_write_lock_count = @@global.max_write_lock_count;
-ERROR 42S22: Unknown column 'max_write_lock_count' in 'field list'
-SET @@global.max_write_lock_count = @start_global_value;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967295
diff --git a/mysql-test/r/min_examined_row_limit_basic_32.result b/mysql-test/r/min_examined_row_limit_basic_32.result
deleted file mode 100644
index c0315944a8a..00000000000
--- a/mysql-test/r/min_examined_row_limit_basic_32.result
+++ /dev/null
@@ -1,180 +0,0 @@
-SET @start_global_value = @@global.min_examined_row_limit;
-SELECT @start_global_value;
-@start_global_value
-0
-SET @start_session_value = @@session.min_examined_row_limit;
-SELECT @start_session_value;
-@start_session_value
-0
-'#--------------------FN_DYNVARS_089_01-------------------------#'
-SET @@global.min_examined_row_limit = 100;
-SET @@global.min_examined_row_limit = DEFAULT;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-0
-SET @@session.min_examined_row_limit = 200;
-SET @@session.min_examined_row_limit = DEFAULT;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-0
-'#--------------------FN_DYNVARS_089_02-------------------------#'
-SET @@global.min_examined_row_limit = DEFAULT;
-SELECT @@global.min_examined_row_limit = 0;
-@@global.min_examined_row_limit = 0
-1
-SET @@session.min_examined_row_limit = DEFAULT;
-SELECT @@session.min_examined_row_limit = 0;
-@@session.min_examined_row_limit = 0
-1
-'#--------------------FN_DYNVARS_089_03-------------------------#'
-SET @@global.min_examined_row_limit = 0;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-0
-SET @@global.min_examined_row_limit = 1;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-1
-SET @@global.min_examined_row_limit = 60020;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-60020
-SET @@global.min_examined_row_limit = 65535;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-65535
-SET @@global.min_examined_row_limit = 4294967295;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-4294967295
-SET @@global.min_examined_row_limit = 4294967294;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-4294967294
-'#--------------------FN_DYNVARS_089_04-------------------------#'
-SET @@session.min_examined_row_limit = 0;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-0
-SET @@session.min_examined_row_limit = 1;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-1
-SET @@session.min_examined_row_limit = 50050;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-50050
-SET @@session.min_examined_row_limit = 65535;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-65535
-SET @@session.min_examined_row_limit = 4294967295;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-4294967295
-SET @@session.min_examined_row_limit = 4294967294;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-4294967294
-'#------------------FN_DYNVARS_089_05-----------------------#'
-SET @@global.min_examined_row_limit = 429496726;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-429496726
-SET @@global.min_examined_row_limit = -1024;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-0
-SET @@global.min_examined_row_limit = 429496729500;
-Warnings:
-Warning	1292	Truncated incorrect min_examined_row_limit value: '429496729500'
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-4294967295
-SET @@global.min_examined_row_limit = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-4294967295
-SET @@global.min_examined_row_limit = test;
-ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-4294967295
-SET @@session.min_examined_row_limit = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect min_examined_row_limit value: '4294967296'
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-4294967295
-SET @@session.min_examined_row_limit = -1;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-0
-SET @@session.min_examined_row_limit = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.min_examined_row_limit = 4294967295021;
-Warnings:
-Warning	1292	Truncated incorrect min_examined_row_limit value: '4294967295021'
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.min_examined_row_limit = test;
-ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-4294967295
-'#------------------FN_DYNVARS_089_06-----------------------#'
-SELECT @@global.min_examined_row_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='min_examined_row_limit';
-@@global.min_examined_row_limit = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_089_07-----------------------#'
-SELECT @@session.min_examined_row_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='min_examined_row_limit';
-@@session.min_examined_row_limit = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_089_08-----------------------#'
-SET @@global.min_examined_row_limit = TRUE;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-1
-SET @@global.min_examined_row_limit = FALSE;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-0
-'#---------------------FN_DYNVARS_089_09----------------------#'
-SET @@global.min_examined_row_limit = 10;
-SELECT @@min_examined_row_limit = @@global.min_examined_row_limit;
-@@min_examined_row_limit = @@global.min_examined_row_limit
-0
-'#---------------------FN_DYNVARS_089_10----------------------#'
-SET @@min_examined_row_limit = 100;
-SELECT @@min_examined_row_limit = @@local.min_examined_row_limit;
-@@min_examined_row_limit = @@local.min_examined_row_limit
-1
-SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit;
-@@local.min_examined_row_limit = @@session.min_examined_row_limit
-1
-'#---------------------FN_DYNVARS_089_11----------------------#'
-SET min_examined_row_limit = 1;
-SELECT @@min_examined_row_limit;
-@@min_examined_row_limit
-1
-SELECT local.min_examined_row_limit;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.min_examined_row_limit;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT min_examined_row_limit = @@session.min_examined_row_limit;
-ERROR 42S22: Unknown column 'min_examined_row_limit' in 'field list'
-SET @@global.min_examined_row_limit = @start_global_value;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-0
-SET @@session.min_examined_row_limit = @start_session_value;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-0
diff --git a/mysql-test/r/multi_range_count_basic_32.result b/mysql-test/r/multi_range_count_basic_32.result
deleted file mode 100644
index f6ac6490479..00000000000
--- a/mysql-test/r/multi_range_count_basic_32.result
+++ /dev/null
@@ -1,192 +0,0 @@
-SET @start_global_value = @@global.multi_range_count;
-SELECT @start_global_value;
-@start_global_value
-256
-SET @start_session_value = @@session.multi_range_count;
-SELECT @start_session_value;
-@start_session_value
-256
-'#--------------------FN_DYNVARS_090_01-------------------------#'
-SET @@global.multi_range_count = 100;
-SET @@global.multi_range_count = DEFAULT;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-256
-SET @@session.multi_range_count = 200;
-SET @@session.multi_range_count = DEFAULT;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-256
-'#--------------------FN_DYNVARS_090_02-------------------------#'
-SET @@global.multi_range_count = DEFAULT;
-SELECT @@global.multi_range_count = 256;
-@@global.multi_range_count = 256
-1
-SET @@session.multi_range_count = DEFAULT;
-SELECT @@session.multi_range_count = 256;
-@@session.multi_range_count = 256
-1
-'#--------------------FN_DYNVARS_090_03-------------------------#'
-SET @@global.multi_range_count = 1;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-1
-SET @@global.multi_range_count = 60020;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-60020
-SET @@global.multi_range_count = 65535;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-65535
-SET @@global.multi_range_count = 4294967295;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-4294967295
-SET @@global.multi_range_count = 4294967294;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-4294967294
-'#--------------------FN_DYNVARS_090_04-------------------------#'
-SET @@session.multi_range_count = 1;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-1
-SET @@session.multi_range_count = 50050;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-50050
-SET @@session.multi_range_count = 65535;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-65535
-SET @@session.multi_range_count = 4294967295;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-4294967295
-SET @@session.multi_range_count = 4294967294;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-4294967294
-'#------------------FN_DYNVARS_090_05-----------------------#'
-SET @@global.multi_range_count = 0;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-1
-SET @@global.multi_range_count = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '4294967296'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-4294967295
-SET @@global.multi_range_count = -1024;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-1
-SET @@global.multi_range_count = 429496729500;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '429496729500'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-4294967295
-SET @@global.multi_range_count = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'multi_range_count'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-4294967295
-SET @@global.multi_range_count = test;
-ERROR 42000: Incorrect argument type to variable 'multi_range_count'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-4294967295
-SET @@session.multi_range_count = 0;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-1
-SET @@session.multi_range_count = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '4294967296'
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-4294967295
-SET @@session.multi_range_count = -1;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-1
-SET @@session.multi_range_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.multi_range_count = 4294967295021;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '4294967295021'
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.multi_range_count = test;
-ERROR 42000: Incorrect argument type to variable 'multi_range_count'
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-4294967295
-'#------------------FN_DYNVARS_090_06-----------------------#'
-SELECT @@global.multi_range_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='multi_range_count';
-@@global.multi_range_count = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_090_07-----------------------#'
-SELECT @@session.multi_range_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='multi_range_count';
-@@session.multi_range_count = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_090_08-----------------------#'
-SET @@global.multi_range_count = TRUE;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-1
-SET @@global.multi_range_count = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-1
-'#---------------------FN_DYNVARS_090_09----------------------#'
-SET @@global.multi_range_count = 10;
-SELECT @@multi_range_count = @@global.multi_range_count;
-@@multi_range_count = @@global.multi_range_count
-0
-'#---------------------FN_DYNVARS_090_10----------------------#'
-SET @@multi_range_count = 100;
-SELECT @@multi_range_count = @@local.multi_range_count;
-@@multi_range_count = @@local.multi_range_count
-1
-SELECT @@local.multi_range_count = @@session.multi_range_count;
-@@local.multi_range_count = @@session.multi_range_count
-1
-'#---------------------FN_DYNVARS_090_11----------------------#'
-SET multi_range_count = 1;
-SELECT @@multi_range_count;
-@@multi_range_count
-1
-SELECT local.multi_range_count;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.multi_range_count;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT multi_range_count = @@session.multi_range_count;
-ERROR 42S22: Unknown column 'multi_range_count' in 'field list'
-SET @@global.multi_range_count = @start_global_value;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-256
-SET @@session.multi_range_count = @start_session_value;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-256
diff --git a/mysql-test/r/myisam_max_sort_file_size_basic_32.result b/mysql-test/r/myisam_max_sort_file_size_basic_32.result
deleted file mode 100644
index 64d1168685c..00000000000
--- a/mysql-test/r/myisam_max_sort_file_size_basic_32.result
+++ /dev/null
@@ -1,114 +0,0 @@
-SET @start_global_value = @@global.myisam_max_sort_file_size;
-SELECT @start_global_value;
-@start_global_value
-2147483647
-'#--------------------FN_DYNVARS_094_01-------------------------#'
-SET @@global.myisam_max_sort_file_size = 500000;
-SET @@global.myisam_max_sort_file_size = DEFAULT;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-2146435072
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_094_02-------------------------#'
-SET @@global.myisam_max_sort_file_size = DEFAULT;
-SELECT @@global.myisam_max_sort_file_size = 2147483648;
-@@global.myisam_max_sort_file_size = 2147483648
-0
-'#--------------------FN_DYNVARS_094_03-------------------------#'
-SET @@global.myisam_max_sort_file_size = 0;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = 1024;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = 123456789;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-122683392
-SET @@global.myisam_max_sort_file_size = 2147483648*2;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-4294967296
-SET @@global.myisam_max_sort_file_size = 2147483648*1024;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-2199023255552
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-2199023255552
-SET @@global.myisam_max_sort_file_size = 2147483648*2147483648;
-'#--------------------FN_DYNVARS_094_04-------------------------#'
-SET @@myisam_max_sort_file_size = 2;
-ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.myisam_max_sort_file_size = 3;
-ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@local.myisam_max_sort_file_size = 4;
-ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
-'#------------------FN_DYNVARS_094_05-----------------------#'
-SET @@global.myisam_max_sort_file_size = -1;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = -2147483648;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = -2147483649;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = 2147483649.56;
-ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = 1G;
-ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-'#------------------FN_DYNVARS_094_06-----------------------#'
-SET @@global.myisam_max_sort_file_size = 3000;
-SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='myisam_max_sort_file_size';
-@@global.myisam_max_sort_file_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_094_07-----------------------#'
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='myisam_max_sort_file_size';
-count(VARIABLE_VALUE)
-1
-'#------------------FN_DYNVARS_094_08-----------------------#'
-SET @@global.myisam_max_sort_file_size = TRUE;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = FALSE;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.myisam_max_sort_file_size = 512;
-SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size;
-@@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET myisam_max_sort_file_size = 2048;
-ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT myisam_max_sort_file_size;
-ERROR 42S22: Unknown column 'myisam_max_sort_file_size' in 'field list'
-SELECT @@myisam_max_sort_file_size;
-@@myisam_max_sort_file_size
-0
-SET global myisam_max_sort_file_size = 64;
-SET @@global.myisam_max_sort_file_size = @start_global_value;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-2146435072
diff --git a/mysql-test/r/myisam_repair_threads_basic_32.result b/mysql-test/r/myisam_repair_threads_basic_32.result
deleted file mode 100644
index c91128e3f4c..00000000000
--- a/mysql-test/r/myisam_repair_threads_basic_32.result
+++ /dev/null
@@ -1,180 +0,0 @@
-SET @start_global_value = @@global.myisam_repair_threads;
-SELECT @start_global_value;
-@start_global_value
-1
-SET @start_session_value = @@session.myisam_repair_threads;
-SELECT @start_session_value;
-@start_session_value
-1
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.myisam_repair_threads  = 100;
-SET @@global.myisam_repair_threads  = DEFAULT;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = 200;
-SET @@session.myisam_repair_threads  = DEFAULT;
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.myisam_repair_threads  = DEFAULT;
-SELECT @@global.myisam_repair_threads  = 1;
-@@global.myisam_repair_threads  = 1
-1
-SET @@session.myisam_repair_threads  = DEFAULT;
-SELECT @@session.myisam_repair_threads  = 1;
-@@session.myisam_repair_threads  = 1
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.myisam_repair_threads  = 1;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@global.myisam_repair_threads  = 4294967295;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-4294967295
-SET @@global.myisam_repair_threads  = 655354;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-655354
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.myisam_repair_threads  = 1;
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = 4294967295;
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-4294967295
-SET @@session.myisam_repair_threads  = 655345;
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-655345
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.myisam_repair_threads  = 0;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@global.myisam_repair_threads  = -1024;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@global.myisam_repair_threads  = 429496729533;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '429496729533'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-4294967295
-SET @@global.myisam_repair_threads  = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-4294967295
-SET @@global.myisam_repair_threads  = test;
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-4294967295
-SET @@global.myisam_repair_threads  = "test";
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-4294967295
-SET @@global.myisam_repair_threads  = 'test';
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-4294967295
-SET @@global.myisam_repair_threads  = ON;
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-4294967295
-SET @@session.myisam_repair_threads  = 0;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = -2;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = test;
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = "test";
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.myisam_repair_threads  = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='myisam_repair_threads ';
-@@global.myisam_repair_threads  = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.myisam_repair_threads  = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='myisam_repair_threads ';
-@@session.myisam_repair_threads  = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_08-----------------------#'
-SET @@global.myisam_repair_threads  = TRUE;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@global.myisam_repair_threads  = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.myisam_repair_threads  = 10;
-SELECT @@myisam_repair_threads  = @@global.myisam_repair_threads ;
-@@myisam_repair_threads  = @@global.myisam_repair_threads
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@myisam_repair_threads  = 100;
-SELECT @@myisam_repair_threads  = @@local.myisam_repair_threads ;
-@@myisam_repair_threads  = @@local.myisam_repair_threads
-1
-SELECT @@local.myisam_repair_threads  = @@session.myisam_repair_threads ;
-@@local.myisam_repair_threads  = @@session.myisam_repair_threads
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET myisam_repair_threads  = 1;
-SELECT @@myisam_repair_threads ;
-@@myisam_repair_threads
-1
-SELECT local.myisam_repair_threads ;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.myisam_repair_threads ;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT myisam_repair_threads  = @@session.myisam_repair_threads ;
-ERROR 42S22: Unknown column 'myisam_repair_threads' in 'field list'
-SET @@global.myisam_repair_threads  = @start_global_value;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = @start_session_value;
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
diff --git a/mysql-test/r/myisam_sort_buffer_size_basic_32.result b/mysql-test/r/myisam_sort_buffer_size_basic_32.result
deleted file mode 100644
index 74d2fb3ec86..00000000000
--- a/mysql-test/r/myisam_sort_buffer_size_basic_32.result
+++ /dev/null
@@ -1,184 +0,0 @@
-SET @start_global_value = @@global.myisam_sort_buffer_size ;
-SELECT @start_global_value;
-@start_global_value
-8388608
-SET @start_session_value = @@session.myisam_sort_buffer_size ;
-SELECT @start_session_value;
-@start_session_value
-8388608
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.myisam_sort_buffer_size   = 100;
-SET @@global.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-8388608
-SET @@session.myisam_sort_buffer_size   = 200;
-SET @@session.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-8388608
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size   = 8388608;
-@@global.myisam_sort_buffer_size   = 8388608
-1
-SET @@session.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size   = 8388608;
-@@session.myisam_sort_buffer_size   = 8388608
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.myisam_sort_buffer_size   = 4;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size   = 4294967295;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size   = 655354;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-655354
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.myisam_sort_buffer_size   = 4;
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size   = 4294967295;
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4294967295
-SET @@session.myisam_sort_buffer_size   = 655345;
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-655345
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.myisam_sort_buffer_size   = 0;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size   = -1024;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size   = 429496729533;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '429496729533'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size   = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size   = test;
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size   = "test";
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size   = 'test';
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size   = ON;
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@session.myisam_sort_buffer_size   = 0;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size   = -2;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size   = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size   = test;
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size   = "test";
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.myisam_sort_buffer_size   = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
-@@global.myisam_sort_buffer_size   = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.myisam_sort_buffer_size   = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
-@@session.myisam_sort_buffer_size   = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_08-----------------------#'
-SET @@global.myisam_sort_buffer_size   = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '1'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size   = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.myisam_sort_buffer_size   = 10;
-SELECT @@myisam_sort_buffer_size   = @@global.myisam_sort_buffer_size  ;
-@@myisam_sort_buffer_size   = @@global.myisam_sort_buffer_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@myisam_sort_buffer_size   = 100;
-SELECT @@myisam_sort_buffer_size   = @@local.myisam_sort_buffer_size  ;
-@@myisam_sort_buffer_size   = @@local.myisam_sort_buffer_size
-1
-SELECT @@local.myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
-@@local.myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET myisam_sort_buffer_size   = 1;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '1'
-SELECT @@myisam_sort_buffer_size  ;
-@@myisam_sort_buffer_size
-4
-SELECT local.myisam_sort_buffer_size  ;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.myisam_sort_buffer_size  ;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
-ERROR 42S22: Unknown column 'myisam_sort_buffer_size' in 'field list'
-SET @@global.myisam_sort_buffer_size   = @start_global_value;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-8388608
-SET @@session.myisam_sort_buffer_size   = @start_session_value;
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-8388608
diff --git a/mysql-test/r/net_retry_count_basic_32.result b/mysql-test/r/net_retry_count_basic_32.result
deleted file mode 100644
index 3923df539e7..00000000000
--- a/mysql-test/r/net_retry_count_basic_32.result
+++ /dev/null
@@ -1,192 +0,0 @@
-SET @start_global_value = @@global.net_retry_count;
-SELECT @start_global_value;
-@start_global_value
-10
-SET @start_session_value = @@session.net_retry_count;
-SELECT @start_session_value;
-@start_session_value
-10
-'#--------------------FN_DYNVARS_111_01-------------------------#'
-SET @@global.net_retry_count = 100;
-SET @@global.net_retry_count = DEFAULT;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-10
-SET @@session.net_retry_count = 200;
-SET @@session.net_retry_count = DEFAULT;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-10
-'#--------------------FN_DYNVARS_111_02-------------------------#'
-SET @@global.net_retry_count = DEFAULT;
-SELECT @@global.net_retry_count = 10;
-@@global.net_retry_count = 10
-1
-SET @@session.net_retry_count = DEFAULT;
-SELECT @@session.net_retry_count = 10;
-@@session.net_retry_count = 10
-1
-'#--------------------FN_DYNVARS_111_03-------------------------#'
-SET @@global.net_retry_count = 1;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-1
-SET @@global.net_retry_count = 2;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-2
-SET @@global.net_retry_count = 4294967295;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-4294967295
-SET @@global.net_retry_count = 4294967294;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-4294967294
-SET @@global.net_retry_count = 65536;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-65536
-'#--------------------FN_DYNVARS_111_04-------------------------#'
-SET @@session.net_retry_count = 1;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-1
-SET @@session.net_retry_count = 2;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-2
-SET @@session.net_retry_count = 65535;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-65535
-SET @@session.net_retry_count = 4294967295;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-4294967295
-SET @@session.net_retry_count = 4294967294;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-4294967294
-'#------------------FN_DYNVARS_111_05-----------------------#'
-SET @@global.net_retry_count = 0;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-1
-SET @@global.net_retry_count = -1024;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-1
-SET @@global.net_retry_count = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '4294967296'
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-4294967295
-SET @@global.net_retry_count = 429496729500;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '429496729500'
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-4294967295
-SET @@global.net_retry_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-4294967295
-SET @@global.net_retry_count = test;
-ERROR 42000: Incorrect argument type to variable 'net_retry_count'
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-4294967295
-SET @@session.net_retry_count = 0;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-1
-SET @@session.net_retry_count = -2;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-1
-SET @@session.net_retry_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.net_retry_count = 6555015425;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '6555015425'
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-4294967295
-SET @@session.net_retry_count = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '4294967296'
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.net_retry_count = test;
-ERROR 42000: Incorrect argument type to variable 'net_retry_count'
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-4294967295
-'#------------------FN_DYNVARS_111_06-----------------------#'
-SELECT @@global.net_retry_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='net_retry_count';
-@@global.net_retry_count = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_111_07-----------------------#'
-SELECT @@session.net_retry_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='net_retry_count';
-@@session.net_retry_count = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_111_08-----------------------#'
-SET @@global.net_retry_count = TRUE;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-1
-SET @@global.net_retry_count = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-1
-'#---------------------FN_DYNVARS_111_09----------------------#'
-SET @@global.net_retry_count = 10;
-SELECT @@net_retry_count = @@global.net_retry_count;
-@@net_retry_count = @@global.net_retry_count
-0
-'#---------------------FN_DYNVARS_111_10----------------------#'
-SET @@net_retry_count = 100;
-SELECT @@net_retry_count = @@local.net_retry_count;
-@@net_retry_count = @@local.net_retry_count
-1
-SELECT @@local.net_retry_count = @@session.net_retry_count;
-@@local.net_retry_count = @@session.net_retry_count
-1
-'#---------------------FN_DYNVARS_111_11----------------------#'
-SET net_retry_count = 1;
-SELECT @@net_retry_count;
-@@net_retry_count
-1
-SELECT local.net_retry_count;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.net_retry_count;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT net_retry_count = @@session.net_retry_count;
-ERROR 42S22: Unknown column 'net_retry_count' in 'field list'
-SET @@global.net_retry_count = @start_global_value;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-10
-SET @@session.net_retry_count = @start_session_value;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-10
diff --git a/mysql-test/r/query_alloc_block_size_basic_32.result b/mysql-test/r/query_alloc_block_size_basic_32.result
deleted file mode 100644
index 3b7f06c8f81..00000000000
--- a/mysql-test/r/query_alloc_block_size_basic_32.result
+++ /dev/null
@@ -1,203 +0,0 @@
-SET @start_global_value = @@global.query_alloc_block_size;
-SELECT @start_global_value;
-@start_global_value
-8192
-SET @start_session_value = @@session.query_alloc_block_size;
-SELECT @start_session_value;
-@start_session_value
-8192
-'#--------------------FN_DYNVARS_130_01-------------------------#'
-SET @@global.query_alloc_block_size = 10000;
-SET @@global.query_alloc_block_size = DEFAULT;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-8192
-SET @@session.query_alloc_block_size = 20000;
-SET @@session.query_alloc_block_size = DEFAULT;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-8192
-'#--------------------FN_DYNVARS_130_02-------------------------#'
-SET @@global.query_alloc_block_size = DEFAULT;
-SELECT @@global.query_alloc_block_size = 8192;
-@@global.query_alloc_block_size = 8192
-1
-SET @@session.query_alloc_block_size = DEFAULT;
-SELECT @@session.query_alloc_block_size = 8192;
-@@session.query_alloc_block_size = 8192
-1
-'#--------------------FN_DYNVARS_130_03-------------------------#'
-SET @@global.query_alloc_block_size = 1024;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = 1025;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = 4294967295;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-4294966272
-SET @@global.query_alloc_block_size = 4294967294;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-4294966272
-SET @@global.query_alloc_block_size = 65536;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-65536
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_130_04-------------------------#'
-SET @@session.query_alloc_block_size = 1024;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-1024
-SET @@session.query_alloc_block_size = 1025;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-1024
-SET @@session.query_alloc_block_size = 4294967295;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-4294966272
-SET @@session.query_alloc_block_size = 4294967294;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-4294966272
-SET @@session.query_alloc_block_size = 655536;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-655360
-'#------------------FN_DYNVARS_130_05-----------------------#'
-SET @@global.query_alloc_block_size = 64;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '64'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = -1;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = 1023;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '1023'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '4294967296'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-4294966272
-SET @@global.query_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-4294966272
-SET @@global.query_alloc_block_size = test;
-ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-4294966272
-SET @@session.query_alloc_block_size = 64;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '64'
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-1024
-SET @@session.query_alloc_block_size = -2;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-1024
-SET @@session.query_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.query_alloc_block_size = 1023;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '1023'
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-1024
-SET @@session.query_alloc_block_size = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '4294967296'
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-4294966272
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.query_alloc_block_size = test;
-ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-4294966272
-'#------------------FN_DYNVARS_130_06-----------------------#'
-'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement';
-SET @@global.query_alloc_block_size = 1;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '1'
-SET @@session.query_alloc_block_size = 12;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '12'
-SELECT @@global.query_alloc_block_size = 
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_alloc_block_size';
-@@global.query_alloc_block_size = 
-VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_130_07-----------------------#'
-SELECT @@session.query_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='query_alloc_block_size';
-@@session.query_alloc_block_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_130_08-----------------------#'
-SET @@global.query_alloc_block_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '1'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-'#---------------------FN_DYNVARS_130_09----------------------#'
-SET @@global.query_alloc_block_size = 2048;
-SELECT @@query_alloc_block_size = @@global.query_alloc_block_size;
-@@query_alloc_block_size = @@global.query_alloc_block_size
-0
-'#---------------------FN_DYNVARS_130_10----------------------#'
-SET @@query_alloc_block_size = 5000;
-SELECT @@query_alloc_block_size = @@local.query_alloc_block_size;
-@@query_alloc_block_size = @@local.query_alloc_block_size
-1
-SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size;
-@@local.query_alloc_block_size = @@session.query_alloc_block_size
-1
-'#---------------------FN_DYNVARS_130_11----------------------#'
-SET query_alloc_block_size = 1024;
-SELECT @@query_alloc_block_size;
-@@query_alloc_block_size
-1024
-SELECT local.query_alloc_block_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.query_alloc_block_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT query_alloc_block_size = @@session.query_alloc_block_size;
-ERROR 42S22: Unknown column 'query_alloc_block_size' in 'field list'
-SET @@global.query_alloc_block_size = @start_global_value;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-8192
-SET @@session.query_alloc_block_size = @start_session_value;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-8192
diff --git a/mysql-test/r/query_cache_limit_basic_32.result b/mysql-test/r/query_cache_limit_basic_32.result
deleted file mode 100644
index bb66233732d..00000000000
--- a/mysql-test/r/query_cache_limit_basic_32.result
+++ /dev/null
@@ -1,126 +0,0 @@
-SET @start_value = @@global.query_cache_limit;
-SELECT @start_value;
-@start_value
-1048576
-'#--------------------FN_DYNVARS_131_01------------------------#'
-SET @@global.query_cache_limit = 99;
-SET @@global.query_cache_limit = DEFAULT;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1048576
-'#---------------------FN_DYNVARS_131_02-------------------------#'
-SET @@global.query_cache_limit = @start_value;
-SELECT @@global.query_cache_limit = 1048576;
-@@global.query_cache_limit = 1048576
-1
-'#--------------------FN_DYNVARS_131_03------------------------#'
-SET @@global.query_cache_limit = 0;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-0
-SET @@global.query_cache_limit = 1;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1
-SET @@global.query_cache_limit = 1048576;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1048576
-SET @@global.query_cache_limit = 1048575;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1048575
-'#--------------------FN_DYNVARS_131_04-------------------------#'
-SET @@global.query_cache_limit = -1;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-0
-SET @@global.query_cache_limit = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect query_cache_limit value: '4294967296'
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-4294967295
-SET @@global.query_cache_limit = 10240022115;
-Warnings:
-Warning	1292	Truncated incorrect query_cache_limit value: '10240022115'
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-4294967295
-SET @@global.query_cache_limit = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-4294967295
-SET @@global.query_cache_limit = -1024;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-0
-SET @@global.query_cache_limit = 42949672950;
-Warnings:
-Warning	1292	Truncated incorrect query_cache_limit value: '42949672950'
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.query_cache_limit = ON;
-ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-4294967295
-SET @@global.query_cache_limit = 'test';
-ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-4294967295
-'#-------------------FN_DYNVARS_131_05----------------------------#'
-SET @@session.query_cache_limit = 0;
-ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_limit;
-@@query_cache_limit
-4294967295
-'#----------------------FN_DYNVARS_131_06------------------------#'
-SELECT @@global.query_cache_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_limit';
-@@global.query_cache_limit = VARIABLE_VALUE
-1
-SELECT @@query_cache_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_limit';
-@@query_cache_limit = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_131_07----------------------#'
-SET @@global.query_cache_limit = TRUE;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1
-SET @@global.query_cache_limit = FALSE;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-0
-'#---------------------FN_DYNVARS_131_08----------------------#'
-SET @@global.query_cache_limit = 1;
-SELECT @@query_cache_limit = @@global.query_cache_limit;
-@@query_cache_limit = @@global.query_cache_limit
-1
-'#---------------------FN_DYNVARS_131_09----------------------#'
-SET query_cache_limit = 1;
-ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_limit;
-@@query_cache_limit
-1
-SET local.query_cache_limit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1
-SELECT local.query_cache_limit;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.query_cache_limit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1
-SELECT global.query_cache_limit;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT query_cache_limit = @@session.query_cache_limit;
-ERROR 42S22: Unknown column 'query_cache_limit' in 'field list'
-SET @@global.query_cache_limit = @start_value;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1048576
diff --git a/mysql-test/r/query_cache_min_res_unit_basic_32.result b/mysql-test/r/query_cache_min_res_unit_basic_32.result
deleted file mode 100644
index e0d8a0d2a30..00000000000
--- a/mysql-test/r/query_cache_min_res_unit_basic_32.result
+++ /dev/null
@@ -1,134 +0,0 @@
-SET @start_value = @@global.query_cache_min_res_unit;
-SELECT @start_value;
-@start_value
-4096
-'#--------------------FN_DYNVARS_132_01------------------------#'
-SET @@global.query_cache_min_res_unit = 99;
-SET @@global.query_cache_min_res_unit = DEFAULT;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-4096
-'#---------------------FN_DYNVARS_132_02-------------------------#'
-SET @@global.query_cache_min_res_unit = @start_value;
-SELECT @@global.query_cache_min_res_unit = 4096;
-@@global.query_cache_min_res_unit = 4096
-1
-'#--------------------FN_DYNVARS_132_03------------------------#'
-SET @@global.query_cache_min_res_unit = 0;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = 1;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512';
-SET @@global.query_cache_min_res_unit = 512;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = 513;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-520
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.query_cache_min_res_unit = 1048576;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-1048576
-SET @@global.query_cache_min_res_unit = 1048575;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-1048576
-'#--------------------FN_DYNVARS_132_04-------------------------#'
-SET @@global.query_cache_min_res_unit = -1;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect query_cache_min_res_unit value: '4294967296'
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-0
-SET @@global.query_cache_min_res_unit = 511;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = -1024;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = 42949672950;
-Warnings:
-Warning	1292	Truncated incorrect query_cache_min_res_unit value: '42949672950'
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-0
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.query_cache_min_res_unit = ON;
-ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-0
-SET @@global.query_cache_min_res_unit = 'test';
-ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-0
-'#-------------------FN_DYNVARS_132_05----------------------------#'
-SET @@session.query_cache_min_res_unit = 0;
-ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_min_res_unit;
-@@query_cache_min_res_unit
-0
-'#----------------------FN_DYNVARS_132_06------------------------#'
-SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_min_res_unit';
-@@global.query_cache_min_res_unit = VARIABLE_VALUE
-1
-SELECT @@query_cache_min_res_unit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_min_res_unit';
-@@query_cache_min_res_unit = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_132_07----------------------#'
-SET @@global.query_cache_min_res_unit = TRUE;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = FALSE;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-'#---------------------FN_DYNVARS_132_08----------------------#'
-SET @@global.query_cache_min_res_unit = 1;
-SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit;
-@@query_cache_min_res_unit = @@global.query_cache_min_res_unit
-1
-'#---------------------FN_DYNVARS_132_09----------------------#'
-SET query_cache_min_res_unit = 1;
-ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_min_res_unit;
-@@query_cache_min_res_unit
-512
-SET local.query_cache_min_res_unit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1
-SELECT local.query_cache_min_res_unit;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.query_cache_min_res_unit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1
-SELECT global.query_cache_min_res_unit;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit;
-ERROR 42S22: Unknown column 'query_cache_min_res_unit' in 'field list'
-SET @@global.query_cache_min_res_unit = @start_value;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-4096
diff --git a/mysql-test/r/query_cache_size_basic_32.result b/mysql-test/r/query_cache_size_basic_32.result
deleted file mode 100644
index 1af70b3af84..00000000000
--- a/mysql-test/r/query_cache_size_basic_32.result
+++ /dev/null
@@ -1,138 +0,0 @@
-SET @start_value = @@global.query_cache_size;
-SELECT @start_value;
-@start_value
-0
-'#--------------------FN_DYNVARS_133_01------------------------#'
-SET @@global.query_cache_size = 99;
-SET @@global.query_cache_size = DEFAULT;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-'#---------------------FN_DYNVARS_133_02-------------------------#'
-SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size = 0;
-@@global.query_cache_size = 0
-1
-'#--------------------FN_DYNVARS_133_03------------------------#'
-SET @@global.query_cache_size = 0;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 1;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 512;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 1024;
-Warnings:
-Warning	1282	Query cache failed to set size 1024; new query cache size is 0
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-: 'Bug#34880: Warnings are coming on assinging valid values to variable
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.query_cache_size = 1048576;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-1048576
-SET @@global.query_cache_size = 1048575;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-1047552
-'#--------------------FN_DYNVARS_133_04-------------------------#'
-SET @@global.query_cache_size = -1;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect query_cache_size value: '4294967296'
-Warning	1282	Query cache failed to set size 4294966272; new query cache size is 0
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 511;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'query_cache_size'
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = -1024;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 42949672950;
-Warnings:
-Warning	1292	Truncated incorrect query_cache_size value: '42949672950'
-Warning	1282	Query cache failed to set size 4294966272; new query cache size is 0
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.query_cache_size = ON;
-ERROR 42000: Incorrect argument type to variable 'query_cache_size'
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'query_cache_size'
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-'#-------------------FN_DYNVARS_133_05----------------------------#'
-SET @@session.query_cache_size = 0;
-ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_size;
-@@query_cache_size
-0
-'#----------------------FN_DYNVARS_133_06------------------------#'
-SELECT @@global.query_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_size';
-@@global.query_cache_size = VARIABLE_VALUE
-1
-SELECT @@query_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='query_cache_size';
-@@query_cache_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_133_07----------------------#'
-SET @@global.query_cache_size = TRUE;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = FALSE;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-'#---------------------FN_DYNVARS_133_08----------------------#'
-SET @@global.query_cache_size = 1;
-SELECT @@query_cache_size = @@global.query_cache_size;
-@@query_cache_size = @@global.query_cache_size
-1
-'#---------------------FN_DYNVARS_133_09----------------------#'
-SET query_cache_size = 1;
-ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_size;
-@@query_cache_size
-0
-SET local.query_cache_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1
-SELECT local.query_cache_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.query_cache_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1
-SELECT global.query_cache_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT query_cache_size = @@session.query_cache_size;
-ERROR 42S22: Unknown column 'query_cache_size' in 'field list'
-SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
diff --git a/mysql-test/r/query_prealloc_size_basic_32.result b/mysql-test/r/query_prealloc_size_basic_32.result
deleted file mode 100644
index fe8aba990a7..00000000000
--- a/mysql-test/r/query_prealloc_size_basic_32.result
+++ /dev/null
@@ -1,178 +0,0 @@
-SET @start_global_value = @@global.query_prealloc_size ;
-SELECT @start_global_value;
-@start_global_value
-8192
-SET @start_session_value = @@session.query_prealloc_size ;
-SELECT @start_session_value;
-@start_session_value
-8192
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.query_prealloc_size   = 100;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '100'
-SET @@global.query_prealloc_size   = DEFAULT;
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = 200;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '200'
-SET @@session.query_prealloc_size   = DEFAULT;
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.query_prealloc_size   = DEFAULT;
-SELECT @@global.query_prealloc_size   = 8192;
-@@global.query_prealloc_size   = 8192
-1
-SET @@session.query_prealloc_size   = DEFAULT;
-SELECT @@session.query_prealloc_size   = 8192;
-@@session.query_prealloc_size   = 8192
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.query_prealloc_size   = 8192;
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = 655354;
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-654336
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.query_prealloc_size   = 8192;
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = 655345;
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-654336
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.query_prealloc_size   = 0;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '0'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = -1024;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '0'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = test;
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = "test";
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = 'test';
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = ON;
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = 0;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '0'
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = -2;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '0'
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = test;
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = "test";
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.query_prealloc_size   = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='query_prealloc_size  ';
-@@global.query_prealloc_size   = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.query_prealloc_size   = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='query_prealloc_size  ';
-@@session.query_prealloc_size   = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_08-----------------------#'
-SET @@global.query_prealloc_size   = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '1'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '0'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.query_prealloc_size   = 10;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '10'
-SELECT @@query_prealloc_size   = @@global.query_prealloc_size  ;
-@@query_prealloc_size   = @@global.query_prealloc_size
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@query_prealloc_size   = 100;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '100'
-SELECT @@query_prealloc_size   = @@local.query_prealloc_size  ;
-@@query_prealloc_size   = @@local.query_prealloc_size
-1
-SELECT @@local.query_prealloc_size   = @@session.query_prealloc_size  ;
-@@local.query_prealloc_size   = @@session.query_prealloc_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET query_prealloc_size   = 1;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '1'
-SELECT @@query_prealloc_size  ;
-@@query_prealloc_size
-8192
-SELECT local.query_prealloc_size  ;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.query_prealloc_size  ;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT query_prealloc_size   = @@session.query_prealloc_size  ;
-ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list'
-SET @@global.query_prealloc_size   = @start_global_value;
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = @start_session_value;
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
diff --git a/mysql-test/r/range_alloc_block_size_basic_32.result b/mysql-test/r/range_alloc_block_size_basic_32.result
deleted file mode 100644
index 93441448d90..00000000000
--- a/mysql-test/r/range_alloc_block_size_basic_32.result
+++ /dev/null
@@ -1,182 +0,0 @@
-SET @start_global_value = @@global.range_alloc_block_size;
-SELECT @start_global_value;
-@start_global_value
-4096
-SET @start_session_value = @@session.range_alloc_block_size;
-SELECT @start_session_value;
-@start_session_value
-4096
-'#--------------------FN_DYNVARS_137_01-------------------------#'
-SET @@global.range_alloc_block_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '100'
-SET @@global.range_alloc_block_size = DEFAULT;
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-SET @@session.range_alloc_block_size = 200;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '200'
-SET @@session.range_alloc_block_size = DEFAULT;
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4096
-'#--------------------FN_DYNVARS_137_02-------------------------#'
-SET @@global.range_alloc_block_size = DEFAULT;
-SELECT @@global.range_alloc_block_size = 2048;
-@@global.range_alloc_block_size = 2048
-0
-SET @@session.range_alloc_block_size = DEFAULT;
-SELECT @@session.range_alloc_block_size = 2048;
-@@session.range_alloc_block_size = 2048
-0
-'#--------------------FN_DYNVARS_137_03-------------------------#'
-SET @@global.range_alloc_block_size = 2048;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '2048'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.range_alloc_block_size = 4294967295;
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4294966272
-SET @@global.range_alloc_block_size = 4294967294;
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_137_04-------------------------#'
-SET @@session.range_alloc_block_size = 2048;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '2048'
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4096
-SET @@session.range_alloc_block_size = 4294967295;
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4294966272
-SET @@session.range_alloc_block_size = 4294967294;
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4294966272
-'#------------------FN_DYNVARS_137_05-----------------------#'
-SET @@global.range_alloc_block_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-SET @@global.range_alloc_block_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-SET @@global.range_alloc_block_size = 42949672951;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '42949672951'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4294966272
-SET @@global.range_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4294966272
-SET @@global.range_alloc_block_size = test;
-ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4294966272
-SET @@session.range_alloc_block_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4096
-SET @@session.range_alloc_block_size = -2;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4096
-SET @@session.range_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.range_alloc_block_size = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '4294967296'
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4294966272
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.range_alloc_block_size = test;
-ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4294966272
-'#------------------FN_DYNVARS_137_06-----------------------#'
-SELECT @@global.range_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='range_alloc_block_size';
-@@global.range_alloc_block_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_137_07-----------------------#'
-SELECT @@session.range_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='range_alloc_block_size';
-@@session.range_alloc_block_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_137_08-----------------------#'
-SET @@global.range_alloc_block_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '1'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-SET @@global.range_alloc_block_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-'#---------------------FN_DYNVARS_137_09----------------------#'
-SET @@global.range_alloc_block_size = 10;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '10'
-SELECT @@range_alloc_block_size = @@global.range_alloc_block_size;
-@@range_alloc_block_size = @@global.range_alloc_block_size
-0
-'#---------------------FN_DYNVARS_137_10----------------------#'
-SET @@range_alloc_block_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '100'
-SELECT @@range_alloc_block_size = @@local.range_alloc_block_size;
-@@range_alloc_block_size = @@local.range_alloc_block_size
-1
-SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size;
-@@local.range_alloc_block_size = @@session.range_alloc_block_size
-1
-'#---------------------FN_DYNVARS_137_11----------------------#'
-SET range_alloc_block_size = 1;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '1'
-SELECT @@range_alloc_block_size;
-@@range_alloc_block_size
-4096
-SELECT local.range_alloc_block_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.range_alloc_block_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT range_alloc_block_size = @@session.range_alloc_block_size;
-ERROR 42S22: Unknown column 'range_alloc_block_size' in 'field list'
-SET @@global.range_alloc_block_size = @start_global_value;
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-SET @@session.range_alloc_block_size = @start_session_value;
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4096
diff --git a/mysql-test/r/rpl_recovery_rank_basic_32.result b/mysql-test/r/rpl_recovery_rank_basic_32.result
deleted file mode 100644
index d4dd46eba71..00000000000
--- a/mysql-test/r/rpl_recovery_rank_basic_32.result
+++ /dev/null
@@ -1,110 +0,0 @@
-SET @start_global_value = @@global.rpl_recovery_rank;
-SELECT @start_global_value;
-@start_global_value
-0
-'#--------------------FN_DYNVARS_142_01-------------------------#'
-SET @@global.rpl_recovery_rank = 500000;
-SET @@global.rpl_recovery_rank = DEFAULT;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-'#--------------------FN_DYNVARS_142_02-------------------------#'
-SET @@global.rpl_recovery_rank = 0;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = 1024;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-1024
-SET @@global.rpl_recovery_rank = 123456789;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-123456789
-SET @@global.rpl_recovery_rank = 2147483648*2;
-Warnings:
-Warning	1292	Truncated incorrect rpl-recovery-rank value: '4294967296'
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-SET @@global.rpl_recovery_rank = 2147483648*1024;
-Warnings:
-Warning	1292	Truncated incorrect rpl-recovery-rank value: '2199023255552'
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-SET @@global.rpl_recovery_rank = 2147483648*2147483648;
-Warnings:
-Warning	1292	Truncated incorrect rpl-recovery-rank value: '4611686018427387904'
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-'#--------------------FN_DYNVARS_142_03-------------------------#'
-SET @@rpl_recovery_rank = 2;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.rpl_recovery_rank = 3;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@local.rpl_recovery_rank = 4;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-'#------------------FN_DYNVARS_142_04-----------------------#'
-SET @@global.rpl_recovery_rank = -1;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = -2147483648;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = -2147483649;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@global.rpl_recovery_rank = 2147483649.56;
-ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
-SET @@global.rpl_recovery_rank = 1G;
-ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
-'#------------------FN_DYNVARS_142_05-----------------------#'
-SET @@global.rpl_recovery_rank = 3000;
-SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-@@global.rpl_recovery_rank = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_142_06-----------------------#'
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-count(VARIABLE_VALUE)
-1
-'#------------------FN_DYNVARS_142_07-----------------------#'
-SET @@global.rpl_recovery_rank = TRUE;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-1
-SET @@global.rpl_recovery_rank = FALSE;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-'#---------------------FN_DYNVARS_001_08----------------------#'
-SET @@global.rpl_recovery_rank = 512;
-SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
-@@rpl_recovery_rank = @@global.rpl_recovery_rank
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET rpl_recovery_rank = 2048;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT rpl_recovery_rank;
-ERROR 42S22: Unknown column 'rpl_recovery_rank' in 'field list'
-SELECT @@rpl_recovery_rank;
-@@rpl_recovery_rank
-512
-SET global rpl_recovery_rank = 64;
-SET @@global.rpl_recovery_rank = @start_global_value;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
diff --git a/mysql-test/r/server_id_basic_32.result b/mysql-test/r/server_id_basic_32.result
deleted file mode 100644
index 6f801fc627b..00000000000
--- a/mysql-test/r/server_id_basic_32.result
+++ /dev/null
@@ -1,117 +0,0 @@
-SET @@global.general_log= 0;
-SET @start_global_value = @@global.server_id;
-SELECT @start_global_value;
-@start_global_value
-1
-'#--------------------FN_DYNVARS_144_01-------------------------#'
-SET @@global.server_id = 500000;
-SET @@global.server_id = DEFAULT;
-SELECT @@global.server_id;
-@@global.server_id
-0
-'#--------------------FN_DYNVARS_144_02-------------------------#'
-SET @@global.server_id = DEFAULT;
-SELECT @@global.server_id = 0;
-@@global.server_id = 0
-1
-'#--------------------FN_DYNVARS_144_03-------------------------#'
-SET @@global.server_id = 0;
-SELECT @@global.server_id;
-@@global.server_id
-0
-SET @@global.server_id = 1;
-SELECT @@global.server_id;
-@@global.server_id
-1
-SET @@global.server_id = 15;
-SELECT @@global.server_id;
-@@global.server_id
-15
-SET @@global.server_id = 1024;
-SELECT @@global.server_id;
-@@global.server_id
-1024
-SET @@global.server_id = 123456789;
-SELECT @@global.server_id;
-@@global.server_id
-123456789
-SET @@global.server_id = 2147483648;
-SELECT @@global.server_id;
-@@global.server_id
-2147483648
-SET @@global.server_id = 2147483648*2-1;
-SELECT @@global.server_id;
-@@global.server_id
-4294967295
-'#--------------------FN_DYNVARS_144_04-------------------------#'
-SET @@server_id = 2;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.server_id = 3;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@local.server_id = 4;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-'#------------------FN_DYNVARS_144_05-----------------------#'
-SET @@global.server_id = -1;
-SELECT @@global.server_id;
-@@global.server_id
-0
-SET @@global.server_id = -2147483648;
-SELECT @@global.server_id;
-@@global.server_id
-0
-SET @@global.server_id = 2147483649*2;
-Warnings:
-Warning	1292	Truncated incorrect server-id value: '4294967298'
-SELECT @@global.server_id;
-@@global.server_id
-4294967295
-SET @@global.server_id = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@global.server_id = '125';
-ERROR 42000: Incorrect argument type to variable 'server_id'
-SET @@global.server_id = 7483649.56;
-ERROR 42000: Incorrect argument type to variable 'server_id'
-SET @@global.server_id = 1G;
-ERROR 42000: Incorrect argument type to variable 'server_id'
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#------------------FN_DYNVARS_144_06-----------------------#'
-SET @@global.server_id = 3000;
-SELECT @@global.server_id = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='server_id';
-@@global.server_id = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_144_07-----------------------#'
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='server_id';
-count(VARIABLE_VALUE)
-1
-'#------------------FN_DYNVARS_144_08-----------------------#'
-SET @@global.server_id = TRUE;
-SELECT @@global.server_id;
-@@global.server_id
-1
-SET @@global.server_id = FALSE;
-SELECT @@global.server_id;
-@@global.server_id
-0
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.server_id = 512;
-SELECT @@server_id = @@global.server_id;
-@@server_id = @@global.server_id
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET server_id = 2048;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT server_id;
-ERROR 42S22: Unknown column 'server_id' in 'field list'
-SELECT @@server_id;
-@@server_id
-512
-SET global server_id = 99;
-SET @@global.server_id = @start_global_value;
-SELECT @@global.server_id;
-@@global.server_id
-1
-SET @@global.general_log= 1;
diff --git a/mysql-test/r/slave_transaction_retries_basic_32.result b/mysql-test/r/slave_transaction_retries_basic_32.result
deleted file mode 100644
index 5b77c500aa0..00000000000
--- a/mysql-test/r/slave_transaction_retries_basic_32.result
+++ /dev/null
@@ -1,119 +0,0 @@
-SET @start_global_value = @@global.slave_transaction_retries;
-SELECT @start_global_value;
-@start_global_value
-10
-'#--------------------FN_DYNVARS_149_01-------------------------#'
-SET @@global.slave_transaction_retries = 50;
-SET @@global.slave_transaction_retries = DEFAULT;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-10
-'#--------------------FN_DYNVARS_149_02-------------------------#'
-SET @@global.slave_transaction_retries = DEFAULT;
-SELECT @@global.slave_transaction_retries = 10;
-@@global.slave_transaction_retries = 10
-1
-'#--------------------FN_DYNVARS_149_03-------------------------#'
-SET @@global.slave_transaction_retries = 0;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-0
-SET @@global.slave_transaction_retries = 1;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-1
-SET @@global.slave_transaction_retries = 15;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-15
-SET @@global.slave_transaction_retries = 1024;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-1024
-SET @@global.slave_transaction_retries = 2147483648;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-2147483648
-SET @@global.slave_transaction_retries = 2147483648*2-1;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-4294967295
-SET @@global.slave_transaction_retries = 2147483649*2;
-Warnings:
-Warning	1292	Truncated incorrect slave_transaction_retries value: '4294967298'
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-4294967295
-SET @@global.slave_transaction_retries = 4294967295;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-4294967295
-'#--------------------FN_DYNVARS_149_04-------------------------#'
-SET @@slave_transaction_retries = 2;
-ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.slave_transaction_retries = 3;
-ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@local.slave_transaction_retries = 4;
-ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
-'#------------------FN_DYNVARS_149_05-----------------------#'
-SET @@global.slave_transaction_retries = -1;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-0
-SET @@global.slave_transaction_retries = 2147483649*2147483649;
-Warnings:
-Warning	1292	Truncated incorrect slave_transaction_retries value: '4611686022722355201'
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-4294967295
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.slave_transaction_retries = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@global.slave_transaction_retries = '100';
-ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
-SET @@global.slave_transaction_retries = 7483649.56;
-ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
-SET @@global.slave_transaction_retries = ON;
-ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
-SET @@global.slave_transaction_retries = OFF;
-ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
-'#------------------FN_DYNVARS_149_06-----------------------#'
-SET @@global.slave_transaction_retries = 3000;
-SELECT @@global.slave_transaction_retries = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='slave_transaction_retries';
-@@global.slave_transaction_retries = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_149_07-----------------------#'
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='slave_transaction_retries';
-count(VARIABLE_VALUE)
-1
-'#------------------FN_DYNVARS_149_08-----------------------#'
-SET @@global.slave_transaction_retries = TRUE;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-1
-SET @@global.slave_transaction_retries = FALSE;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-0
-'#---------------------FN_DYNVARS_149_09----------------------#'
-SET @@global.slave_transaction_retries = 60*60;
-SELECT @@slave_transaction_retries = @@global.slave_transaction_retries;
-@@slave_transaction_retries = @@global.slave_transaction_retries
-1
-'#---------------------FN_DYNVARS_149_10----------------------#'
-SET slave_transaction_retries = 2048;
-ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT slave_transaction_retries;
-ERROR 42S22: Unknown column 'slave_transaction_retries' in 'field list'
-SELECT @@slave_transaction_retries;
-@@slave_transaction_retries
-3600
-SET global slave_transaction_retries = 99;
-SET @@global.slave_transaction_retries = @start_global_value;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-10
diff --git a/mysql-test/r/sort_buffer_size_basic_32.result b/mysql-test/r/sort_buffer_size_basic_32.result
deleted file mode 100644
index 09a1fe59046..00000000000
--- a/mysql-test/r/sort_buffer_size_basic_32.result
+++ /dev/null
@@ -1,193 +0,0 @@
-SET @start_global_value = @@global.sort_buffer_size;
-SELECT @start_global_value;
-@start_global_value
-262144
-SET @start_session_value = @@session.sort_buffer_size;
-SELECT @start_session_value;
-@start_session_value
-262144
-'#--------------------FN_DYNVARS_151_01-------------------------#'
-SET @@global.sort_buffer_size = 1000;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '1000'
-SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116
-1
-SET @@session.sort_buffer_size = 2000;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '2000'
-SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116
-1
-'#--------------------FN_DYNVARS_151_02-------------------------#'
-SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116
-1
-SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116
-1
-'#--------------------FN_DYNVARS_151_03-------------------------#'
-SET @@global.sort_buffer_size = 32776;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
-1
-SET @@global.sort_buffer_size = 32777;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804
-1
-SET @@global.sort_buffer_size = 4294967295;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-4294967295
-SET @@global.sort_buffer_size = 4294967294;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-4294967294
-'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
-'#--------------------FN_DYNVARS_151_04-------------------------#'
-SET @@session.sort_buffer_size = 32776;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
-1
-SET @@session.sort_buffer_size = 32777;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804
-1
-SET @@session.sort_buffer_size = 4294967295;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967295
-SET @@session.sort_buffer_size = 4294967294;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967294
-'#------------------FN_DYNVARS_151_05-----------------------#'
-SET @@global.sort_buffer_size = 32775;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
-1
-SET @@global.sort_buffer_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
-1
-SET @@global.sort_buffer_size = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '4294967296'
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-4294967295
-SET @@global.sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-4294967295
-SET @@global.sort_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-4294967295
-SET @@session.sort_buffer_size = 32775;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
-1
-SET @@session.sort_buffer_size = -2;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '0'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
-1
-SET @@session.sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.sort_buffer_size = 4294967296;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '4294967296'
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967295
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.sort_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967295
-'#------------------FN_DYNVARS_151_06-----------------------#'
-SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
-@@global.sort_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_151_07-----------------------#'
-SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
-@@session.sort_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_151_08-----------------------#'
-SET @@global.sort_buffer_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '1'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
-1
-SET @@global.sort_buffer_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
-1
-'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'
-'#---------------------FN_DYNVARS_151_09----------------------#'
-SET @@global.sort_buffer_size = 9000;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '9000'
-SELECT @@sort_buffer_size = @@global.sort_buffer_size;
-@@sort_buffer_size = @@global.sort_buffer_size
-0
-'#---------------------FN_DYNVARS_151_10----------------------#'
-SET @@sort_buffer_size = 9000;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '9000'
-SELECT @@sort_buffer_size = @@local.sort_buffer_size;
-@@sort_buffer_size = @@local.sort_buffer_size
-1
-SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
-@@local.sort_buffer_size = @@session.sort_buffer_size
-1
-'#---------------------FN_DYNVARS_151_11----------------------#'
-SET sort_buffer_size = 9100;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '9100'
-SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
-@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804
-1
-SELECT @@sort_buffer_size;
-@@sort_buffer_size
-32804
-SELECT local.sort_buffer_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.sort_buffer_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT sort_buffer_size = @@session.sort_buffer_size;
-ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list'
-SET @@global.sort_buffer_size = @start_global_value;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-262144
-SET @@session.sort_buffer_size = @start_session_value;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-262144
diff --git a/mysql-test/r/sync_binlog_basic_32.result b/mysql-test/r/sync_binlog_basic_32.result
deleted file mode 100644
index 3d9bfb6d218..00000000000
--- a/mysql-test/r/sync_binlog_basic_32.result
+++ /dev/null
@@ -1,105 +0,0 @@
-SET @start_value = @@global.sync_binlog;
-SELECT @start_value;
-@start_value
-0
-'#--------------------FN_DYNVARS_168_01------------------------#'
-SET @@global.sync_binlog = 99;
-SET @@global.sync_binlog = DEFAULT;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-'#---------------------FN_DYNVARS_168_02-------------------------#'
-SET @@global.sync_binlog = @start_value;
-SELECT @@global.sync_binlog = 0;
-@@global.sync_binlog = 0
-1
-'#--------------------FN_DYNVARS_168_03------------------------#'
-SET @@global.sync_binlog = 0;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-SET @@global.sync_binlog = 1;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-1
-SET @@global.sync_binlog = 4294967295;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967295
-SET @@global.sync_binlog = 4294967294;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967294
-SET @@global.sync_binlog = 65536;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-65536
-'#--------------------FN_DYNVARS_168_04-------------------------#'
-SET @@global.sync_binlog = -1;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-SET @@global.sync_binlog = 4294967296;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-SET @@global.sync_binlog = 10240022115;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-1650087523
-SET @@global.sync_binlog = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'sync_binlog'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-1650087523
-SET @@global.sync_binlog = -1024;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-SET @@global.sync_binlog = 42949672950;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967286
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.sync_binlog = ON;
-ERROR 42000: Incorrect argument type to variable 'sync_binlog'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967286
-SET @@global.sync_binlog = 'test';
-ERROR 42000: Incorrect argument type to variable 'sync_binlog'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967286
-'#-------------------FN_DYNVARS_168_05----------------------------#'
-SET @@session.sync_binlog = 0;
-ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@sync_binlog;
-@@sync_binlog
-4294967286
-'#----------------------FN_DYNVARS_168_06------------------------#'
-SELECT @@global.sync_binlog = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='sync_binlog';
-@@global.sync_binlog = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_168_07----------------------#'
-SET sync_binlog = 1;
-ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@sync_binlog;
-@@sync_binlog
-4294967286
-SET local.sync_binlog = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
-SELECT local.sync_binlog;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.sync_binlog = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
-SELECT global.sync_binlog;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT sync_binlog = @@session.sync_binlog;
-ERROR 42S22: Unknown column 'sync_binlog' in 'field list'
-SET @@global.sync_binlog = @start_value;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
diff --git a/mysql-test/r/timestamp_basic_32.result b/mysql-test/r/timestamp_basic_32.result
deleted file mode 100644
index cc4f0324c0f..00000000000
--- a/mysql-test/r/timestamp_basic_32.result
+++ /dev/null
@@ -1,73 +0,0 @@
-SET @session_start_value = @@session.timestamp;
-'#--------------------FN_DYNVARS_001_01------------------------#'
-SET @@timestamp = DEFAULT;
-'timestamp does not have any DEFAULT value'
-'#---------------------FN_DYNVARS_001_02-------------------------#'
-SET @@global.timestamp = "1000";
-ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL
-'#--------------------FN_DYNVARS_001_03------------------------#'
-SET @@timestamp = 0;
-'Setting 0 resets timestamp to session default timestamp'
-SET @@timestamp = 123456789123456;
-SELECT @@timestamp;
-@@timestamp
-2249167232
-SET @@timestamp = 60*60*60*60*365;
-SELECT @@timestamp;
-@@timestamp
-435432704
-SET @@timestamp = -1000000000;
-SELECT @@timestamp;
-@@timestamp
-3294967296
-SET @temp_ts = @@timestamp - @@timestamp;
-SELECT @temp_ts;
-@temp_ts
-0
-'#--------------------FN_DYNVARS_001_04-------------------------#'
-SET @@timestamp = "100";
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-'Bug# 34836: Documentation says its a string variable but infact its numeric'
-SET @@timestamp = " ";
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = 1.1;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = 9999999999999999999999;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-'#----------------------FN_DYNVARS_001_06------------------------#'
-SELECT @@timestamp = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='timestamp';
-@@timestamp = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_08-------------------------#'
-SET @@timestamp = OFF;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = ON;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = TRUE;
-SELECT @@timestamp;
-@@timestamp
-1
-SET @@timestamp = FALSE;
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@timestamp = 123456;
-SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
-@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
-1
-SET @@timestamp = 654321;
-SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
-@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET timestamp = 1;
-SELECT @@timestamp;
-@@timestamp
-1
-SELECT local.timestamp;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.timestamp;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT timestamp = @@session.timestamp;
-ERROR 42S22: Unknown column 'timestamp' in 'field list'
-SET @@timestamp = @session_start_value;
diff --git a/mysql-test/r/tmp_table_size_basic_32.result b/mysql-test/r/tmp_table_size_basic_32.result
deleted file mode 100644
index aeafd95ed55..00000000000
--- a/mysql-test/r/tmp_table_size_basic_32.result
+++ /dev/null
@@ -1,172 +0,0 @@
-SET @start_global_value = @@global.tmp_table_size;
-SELECT @start_global_value;
-@start_global_value
-16777216
-SET @start_session_value = @@session.tmp_table_size;
-SELECT @start_session_value;
-@start_session_value
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.tmp_table_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '100'
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-SET @@session.tmp_table_size = 200;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '200'
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size = 33554432;
-@@global.tmp_table_size = 33554432
-0
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size = 33554432;
-@@session.tmp_table_size = 33554432
-0
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.tmp_table_size = 1024;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = 60020;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-60020
-SET @@global.tmp_table_size = 4294967295;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-4294967295
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.tmp_table_size = 1024;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size =4294967295;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-4294967295
-SET @@session.tmp_table_size = 65535;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-65535
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.tmp_table_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = 1000;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '1000'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.tmp_table_size = ON;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size = True;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '1'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = False;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
-SET @@global.tmp_table_size = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size ="Test";
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = ON;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = True;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '1'
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size = False;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '0'
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size = "Test";
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = 12345678901;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-4294967295
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.tmp_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='tmp_table_size';
-@@global.tmp_table_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.tmp_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='tmp_table_size';
-@@session.tmp_table_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.tmp_table_size = 1024;
-SET @@tmp_table_size = 4294967295;
-SELECT @@tmp_table_size = @@global.tmp_table_size;
-@@tmp_table_size = @@global.tmp_table_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@tmp_table_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '100'
-SELECT @@tmp_table_size = @@local.tmp_table_size;
-@@tmp_table_size = @@local.tmp_table_size
-1
-SELECT @@local.tmp_table_size = @@session.tmp_table_size;
-@@local.tmp_table_size = @@session.tmp_table_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET tmp_table_size = 1027;
-SELECT @@tmp_table_size;
-@@tmp_table_size
-1027
-SELECT local.tmp_table_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT global.tmp_table_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT tmp_table_size = @@session.tmp_table_size;
-ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
-SET @@global.tmp_table_size = @start_global_value;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
-SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
diff --git a/mysql-test/r/transaction_alloc_block_size_basic_32.result b/mysql-test/r/transaction_alloc_block_size_basic_32.result
deleted file mode 100644
index 706d7802ed3..00000000000
--- a/mysql-test/r/transaction_alloc_block_size_basic_32.result
+++ /dev/null
@@ -1,180 +0,0 @@
-SET @start_global_value = @@global.transaction_alloc_block_size;
-SELECT @start_global_value;
-@start_global_value
-8192
-SET @start_session_value = @@session.transaction_alloc_block_size;
-SELECT @start_session_value;
-@start_session_value
-8192
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.transaction_alloc_block_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '100'
-SET @@global.transaction_alloc_block_size = DEFAULT;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-8192
-SET @@session.transaction_alloc_block_size = 200;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '200'
-SET @@session.transaction_alloc_block_size = DEFAULT;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-8192
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.transaction_alloc_block_size = DEFAULT;
-SELECT @@global.transaction_alloc_block_size = 8192;
-@@global.transaction_alloc_block_size = 8192
-1
-SET @@session.transaction_alloc_block_size = DEFAULT;
-SELECT @@session.transaction_alloc_block_size = 8192;
-@@session.transaction_alloc_block_size = 8192
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.transaction_alloc_block_size = 1024;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = 60020;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-59392
-SET @@global.transaction_alloc_block_size = 4294967295;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.transaction_alloc_block_size = 1024;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size =4294967295;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-4294966272
-SET @@session.transaction_alloc_block_size = 65535;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-64512
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.transaction_alloc_block_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = 123456789201;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '123456789201'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-4294966272
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.transaction_alloc_block_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size = True;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = False;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size ="Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size = 1000;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1000'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size = 12345678901;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '12345678901'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-4294966272
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.transaction_alloc_block_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@session.transaction_alloc_block_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@session.transaction_alloc_block_size = True;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size = False;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size = "Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@session.transaction_alloc_block_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='transaction_alloc_block_size';
-@@global.transaction_alloc_block_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='transaction_alloc_block_size';
-@@session.transaction_alloc_block_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_08----------------------#'
-SET @@transaction_alloc_block_size = 1024;
-SET @@global.transaction_alloc_block_size = 4294967295;
-SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
-@@transaction_alloc_block_size = @@global.transaction_alloc_block_size
-0
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@transaction_alloc_block_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '100'
-SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size;
-@@transaction_alloc_block_size = @@local.transaction_alloc_block_size
-1
-SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size;
-@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET transaction_alloc_block_size = 1027;
-SELECT @@transaction_alloc_block_size;
-@@transaction_alloc_block_size
-1024
-SELECT local.transaction_alloc_block_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.transaction_alloc_block_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size;
-ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list'
-SET @@global.transaction_alloc_block_size = @start_global_value;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-8192
-SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
diff --git a/mysql-test/r/transaction_prealloc_size_basic_32.result b/mysql-test/r/transaction_prealloc_size_basic_32.result
deleted file mode 100644
index 3df7a55595e..00000000000
--- a/mysql-test/r/transaction_prealloc_size_basic_32.result
+++ /dev/null
@@ -1,172 +0,0 @@
-SET @start_global_value = @@global.transaction_prealloc_size;
-SELECT @start_global_value;
-@start_global_value
-4096
-SET @start_session_value = @@session.transaction_prealloc_size;
-SELECT @start_session_value;
-@start_session_value
-4096
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.transaction_prealloc_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '100'
-SET @@global.transaction_prealloc_size = DEFAULT;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-4096
-SET @@session.transaction_prealloc_size = 200;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '200'
-SET @@session.transaction_prealloc_size = DEFAULT;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4096
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.transaction_prealloc_size = DEFAULT;
-SELECT @@global.transaction_prealloc_size = 4096;
-@@global.transaction_prealloc_size = 4096
-1
-SET @@session.transaction_prealloc_size = DEFAULT;
-SELECT @@session.transaction_prealloc_size = 4096;
-@@session.transaction_prealloc_size = 4096
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.transaction_prealloc_size = 1024;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = 60020;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-59392
-SET @@global.transaction_prealloc_size = 4294966272;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-4294966272
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.transaction_prealloc_size = 1024;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size =4294966272;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4294966272
-SET @@session.transaction_prealloc_size = 65535;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-64512
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.transaction_prealloc_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.transaction_prealloc_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size = True;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '1'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = False;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size ="Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size = 1000;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '1000'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@session.transaction_prealloc_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@session.transaction_prealloc_size = True;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '1'
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size = False;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size = "Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@session.transaction_prealloc_size = 123456789031;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '123456789031'
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4294966272
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='transaction_prealloc_size';
-@@global.transaction_prealloc_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='transaction_prealloc_size';
-@@session.transaction_prealloc_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.transaction_prealloc_size = 1024;
-SET @@global.transaction_prealloc_size = 10;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '10'
-SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
-@@transaction_prealloc_size = @@global.transaction_prealloc_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@transaction_prealloc_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '100'
-SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size;
-@@transaction_prealloc_size = @@local.transaction_prealloc_size
-1
-SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size;
-@@local.transaction_prealloc_size = @@session.transaction_prealloc_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET transaction_prealloc_size = 1027;
-SELECT @@transaction_prealloc_size;
-@@transaction_prealloc_size
-1024
-SELECT local.transaction_prealloc_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.transaction_prealloc_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT transaction_prealloc_size = @@session.transaction_prealloc_size;
-ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list'
-SET @@global.transaction_prealloc_size = @start_global_value;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-4096
-SET @@session.transaction_prealloc_size = @start_session_value;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4096
diff --git a/mysql-test/r/wait_timeout_basic_32.result b/mysql-test/r/wait_timeout_basic_32.result
deleted file mode 100644
index ae03e677e56..00000000000
--- a/mysql-test/r/wait_timeout_basic_32.result
+++ /dev/null
@@ -1,129 +0,0 @@
-SET @start_global_value = @@global.wait_timeout;
-SET @start_session_value = @@session.wait_timeout;
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.wait_timeout = 100;
-SET @@global.wait_timeout = DEFAULT;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-28800
-SET @@session.wait_timeout = 200;
-SET @@session.wait_timeout = DEFAULT;
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-28800
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.wait_timeout = DEFAULT;
-SELECT @@global.wait_timeout = @default_wait_timeout;
-@@global.wait_timeout = @default_wait_timeout
-1
-SET @@session.wait_timeout = DEFAULT;
-SELECT @@session.wait_timeout = @default_wait_timeout;
-@@session.wait_timeout = @default_wait_timeout
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.wait_timeout= 1;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-1
-SET @@global.wait_timeout = 60020;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-60020
-SET @@global.wait_timeout = 31536000;
-SELECT @@global.wait_timeout = @max_wait_timeout;
-@@global.wait_timeout = @max_wait_timeout
-1
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.wait_timeout =6000;
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-6000
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.wait_timeout = 0;
-Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '0'
-SET @@global.wait_timeout = -1024;
-Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '0'
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.wait_timeout = ON;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@global.wait_timeout = OFF;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@global.wait_timeout = True;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-1
-SET @@global.wait_timeout = False;
-Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '0'
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-1
-SET @@global.wait_timeout = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@global.wait_timeout ="Test";
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = ON;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = OFF;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = True;
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-1
-SET @@session.wait_timeout = False;
-Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '0'
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-1
-SET @@session.wait_timeout = "Test";
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = 'test';
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = 123456789031;
-Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '123456789031'
-SELECT @@session.wait_timeout = @max_wait_timeout;
-@@session.wait_timeout = @max_wait_timeout
-1
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.wait_timeout = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='wait_timeout';
-@@global.wait_timeout = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.wait_timeout = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='wait_timeout';
-@@session.wait_timeout = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.wait_timeout = 30000;
-SET @@global.wait_timeout = 40000;
-SELECT @@wait_timeout = @@global.wait_timeout;
-@@wait_timeout = @@global.wait_timeout
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@wait_timeout = 100;
-SELECT @@wait_timeout = @@local.wait_timeout;
-@@wait_timeout = @@local.wait_timeout
-1
-SELECT @@local.wait_timeout = @@session.wait_timeout;
-@@local.wait_timeout = @@session.wait_timeout
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET wait_timeout = 1027;
-SELECT @@wait_timeout;
-@@wait_timeout
-1027
-SELECT local.wait_timeout;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.wait_timeout;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT wait_timeout = @@session.wait_timeout;
-ERROR 42S22: Unknown column 'wait_timeout' in 'field list'
-SET @@global.wait_timeout = @start_global_value;
-SET @@session.wait_timeout = @start_session_value;

From d9fc253c47f922890e144b62aa818f77b2cce7af Mon Sep 17 00:00:00 2001
From: Horst Hunger <horst@mysql.com>
Date: Tue, 22 Jul 2008 18:50:36 +0200
Subject: [PATCH 05/33] Fix for bug#37708:The result files of the removed 64
 bit tests.

---
 .../r/binlog_cache_size_basic_64.result       | 100 ---------
 .../r/bulk_insert_buffer_size_basic_64.result | 150 -------------
 .../r/delayed_insert_limit_basic_64.result    | 110 ----------
 .../r/delayed_queue_size_basic_64.result      | 108 ----------
 ...innodb_concurrency_tickets_basic_64.result |  98 ---------
 .../r/innodb_max_purge_lag_basic_64.result    |  92 --------
 .../r/innodb_sync_spin_loops_basic_64.result  |  92 --------
 mysql-test/r/join_buffer_size_basic_64.result | 194 -----------------
 mysql-test/r/key_buffer_size_basic_64.result  | 111 ----------
 .../r/key_cache_age_threshold_basic_64.result | 126 -----------
 .../r/key_cache_block_size_basic_64.result    | 142 -------------
 .../key_cache_division_limit_basic_64.result  | 139 ------------
 mysql-test/r/log_warnings_basic_64.result     | 158 --------------
 .../r/max_binlog_cache_size_basic_64.result   | 141 -------------
 .../r/max_connect_errors_basic_64.result      | 133 ------------
 .../r/max_heap_table_size_basic_64.result     | 196 -----------------
 .../r/max_seeks_for_key_basic_64.result       | 176 ----------------
 mysql-test/r/max_tmp_tables_basic_64.result   | 187 ----------------
 .../r/max_write_lock_count_basic_64.result    | 104 ---------
 .../r/min_examined_row_limit_basic_64.result  | 174 ---------------
 .../r/multi_range_count_basic_64.result       | 184 ----------------
 .../myisam_max_sort_file_size_basic_64.result | 114 ----------
 .../r/myisam_repair_threads_basic_64.result   | 178 ----------------
 .../r/myisam_sort_buffer_size_basic_64.result | 182 ----------------
 mysql-test/r/net_retry_count_basic_64.result  | 184 ----------------
 .../r/query_alloc_block_size_basic_64.result  | 199 ------------------
 .../r/query_cache_limit_basic_64.result       | 120 -----------
 .../query_cache_min_res_unit_basic_64.result  | 130 ------------
 mysql-test/r/query_cache_size_basic_64.result | 134 ------------
 .../r/query_prealloc_size_basic_64.result     | 178 ----------------
 .../r/range_alloc_block_size_basic_64.result  | 178 ----------------
 .../r/rpl_recovery_rank_basic_64.result       | 110 ----------
 mysql-test/r/server_id_basic_64.result        | 115 ----------
 .../slave_transaction_retries_basic_64.result | 115 ----------
 mysql-test/r/sort_buffer_size_basic_64.result | 189 -----------------
 mysql-test/r/sync_binlog_basic_64.result      | 105 ---------
 mysql-test/r/timestamp_basic_64.result        |  73 -------
 mysql-test/r/tmp_table_size_basic_64.result   | 172 ---------------
 ...ansaction_alloc_block_size_basic_64.result | 176 ----------------
 .../transaction_prealloc_size_basic_64.result | 170 ---------------
 mysql-test/r/wait_timeout_basic_64.result     | 129 ------------
 41 files changed, 5866 deletions(-)
 delete mode 100644 mysql-test/r/binlog_cache_size_basic_64.result
 delete mode 100644 mysql-test/r/bulk_insert_buffer_size_basic_64.result
 delete mode 100644 mysql-test/r/delayed_insert_limit_basic_64.result
 delete mode 100644 mysql-test/r/delayed_queue_size_basic_64.result
 delete mode 100644 mysql-test/r/innodb_concurrency_tickets_basic_64.result
 delete mode 100644 mysql-test/r/innodb_max_purge_lag_basic_64.result
 delete mode 100644 mysql-test/r/innodb_sync_spin_loops_basic_64.result
 delete mode 100644 mysql-test/r/join_buffer_size_basic_64.result
 delete mode 100644 mysql-test/r/key_buffer_size_basic_64.result
 delete mode 100644 mysql-test/r/key_cache_age_threshold_basic_64.result
 delete mode 100644 mysql-test/r/key_cache_block_size_basic_64.result
 delete mode 100644 mysql-test/r/key_cache_division_limit_basic_64.result
 delete mode 100644 mysql-test/r/log_warnings_basic_64.result
 delete mode 100644 mysql-test/r/max_binlog_cache_size_basic_64.result
 delete mode 100644 mysql-test/r/max_connect_errors_basic_64.result
 delete mode 100644 mysql-test/r/max_heap_table_size_basic_64.result
 delete mode 100644 mysql-test/r/max_seeks_for_key_basic_64.result
 delete mode 100644 mysql-test/r/max_tmp_tables_basic_64.result
 delete mode 100644 mysql-test/r/max_write_lock_count_basic_64.result
 delete mode 100644 mysql-test/r/min_examined_row_limit_basic_64.result
 delete mode 100644 mysql-test/r/multi_range_count_basic_64.result
 delete mode 100644 mysql-test/r/myisam_max_sort_file_size_basic_64.result
 delete mode 100644 mysql-test/r/myisam_repair_threads_basic_64.result
 delete mode 100644 mysql-test/r/myisam_sort_buffer_size_basic_64.result
 delete mode 100644 mysql-test/r/net_retry_count_basic_64.result
 delete mode 100644 mysql-test/r/query_alloc_block_size_basic_64.result
 delete mode 100644 mysql-test/r/query_cache_limit_basic_64.result
 delete mode 100644 mysql-test/r/query_cache_min_res_unit_basic_64.result
 delete mode 100644 mysql-test/r/query_cache_size_basic_64.result
 delete mode 100644 mysql-test/r/query_prealloc_size_basic_64.result
 delete mode 100644 mysql-test/r/range_alloc_block_size_basic_64.result
 delete mode 100644 mysql-test/r/rpl_recovery_rank_basic_64.result
 delete mode 100644 mysql-test/r/server_id_basic_64.result
 delete mode 100644 mysql-test/r/slave_transaction_retries_basic_64.result
 delete mode 100644 mysql-test/r/sort_buffer_size_basic_64.result
 delete mode 100644 mysql-test/r/sync_binlog_basic_64.result
 delete mode 100644 mysql-test/r/timestamp_basic_64.result
 delete mode 100644 mysql-test/r/tmp_table_size_basic_64.result
 delete mode 100644 mysql-test/r/transaction_alloc_block_size_basic_64.result
 delete mode 100644 mysql-test/r/transaction_prealloc_size_basic_64.result
 delete mode 100644 mysql-test/r/wait_timeout_basic_64.result

diff --git a/mysql-test/r/binlog_cache_size_basic_64.result b/mysql-test/r/binlog_cache_size_basic_64.result
deleted file mode 100644
index 45ed43589a3..00000000000
--- a/mysql-test/r/binlog_cache_size_basic_64.result
+++ /dev/null
@@ -1,100 +0,0 @@
-SET @start_value = @@global.binlog_cache_size;
-SELECT @start_value;
-@start_value
-32768
-'#--------------------FN_DYNVARS_006_01------------------------#'
-SET @@global.binlog_cache_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '100'
-SET @@global.binlog_cache_size = DEFAULT;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-32768
-'#---------------------FN_DYNVARS_006_02-------------------------#'
-SET @@global.binlog_cache_size = @start_value;
-SELECT @@global.binlog_cache_size = 32768;
-@@global.binlog_cache_size = 32768
-1
-'#--------------------FN_DYNVARS_006_03------------------------#'
-SET @@global.binlog_cache_size = 4096;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4096
-SET @@global.binlog_cache_size = 4294967295;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4294963200
-SET @@global.binlog_cache_size = 10000;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-8192
-SET @@global.binlog_cache_size = 21221204;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-21217280
-'Bug: Invalid values are coming in variable on assigning valid values'
-'#--------------------FN_DYNVARS_006_04-------------------------#'
-SET @@global.binlog_cache_size = 1024;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '1024'
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4096
-SET @@global.binlog_cache_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
-SET @@global.binlog_cache_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '0'
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4096
-SET @@global.binlog_cache_size = 42949672950;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-42949668864
-'Bug: Errors are not coming on assigning invalid values to variable'
-SET @@global.binlog_cache_size = ON;
-ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
-SET @@global.binlog_cache_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
-'#-------------------FN_DYNVARS_006_05----------------------------#'
-SET @@session.binlog_cache_size = 0;
-ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-'#----------------------FN_DYNVARS_006_06------------------------#'
-SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size';
-@@global.binlog_cache_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_006_07----------------------#'
-SET @@global.binlog_cache_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '1'
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4096
-SET @@global.binlog_cache_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '0'
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-4096
-'Bug: Errors are not coming on assigning TRUE/FALSE to variable'
-'#---------------------FN_DYNVARS_006_08----------------------#'
-SET @@global.binlog_cache_size = 1;
-Warnings:
-Warning	1292	Truncated incorrect binlog_cache_size value: '1'
-SELECT @@binlog_cache_size = @@global.binlog_cache_size;
-@@binlog_cache_size = @@global.binlog_cache_size
-1
-'#---------------------FN_DYNVARS_006_09----------------------#'
-SET binlog_cache_size = 1;
-ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET global.binlog_cache_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_cache_size = 1' at line 1
-SELECT global.binlog_cache_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT binlog_cache_size = @@session.binlog_cache_size;
-ERROR 42S22: Unknown column 'binlog_cache_size' in 'field list'
-SET @@global.binlog_cache_size = @start_value;
-SELECT @@global.binlog_cache_size;
-@@global.binlog_cache_size
-32768
diff --git a/mysql-test/r/bulk_insert_buffer_size_basic_64.result b/mysql-test/r/bulk_insert_buffer_size_basic_64.result
deleted file mode 100644
index 9e0e8e07470..00000000000
--- a/mysql-test/r/bulk_insert_buffer_size_basic_64.result
+++ /dev/null
@@ -1,150 +0,0 @@
-SET @start_global_value = @@global.bulk_insert_buffer_size;
-SELECT @start_global_value;
-@start_global_value
-8388608
-SET @start_session_value = @@session.bulk_insert_buffer_size;
-SELECT @start_session_value;
-@start_session_value
-8388608
-'#--------------------FN_DYNVARS_007_01-------------------------#'
-SET @@global.bulk_insert_buffer_size = 100;
-SET @@global.bulk_insert_buffer_size = DEFAULT;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-8388608
-SET @@session.bulk_insert_buffer_size = 200;
-SET @@session.bulk_insert_buffer_size = DEFAULT;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-8388608
-'#--------------------FN_DYNVARS_007_02-------------------------#'
-SET @@global.bulk_insert_buffer_size = @start_global_value;
-SELECT @@global.bulk_insert_buffer_size = 8388608;
-@@global.bulk_insert_buffer_size = 8388608
-1
-SET @@session.bulk_insert_buffer_size = @start_session_value;
-SELECT @@session.bulk_insert_buffer_size = 8388608;
-@@session.bulk_insert_buffer_size = 8388608
-1
-'#--------------------FN_DYNVARS_007_03-------------------------#'
-SET @@global.bulk_insert_buffer_size = 0;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-0
-SET @@global.bulk_insert_buffer_size = 1;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-1
-SET @@global.bulk_insert_buffer_size = 4294967295;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-4294967295
-SET @@global.bulk_insert_buffer_size = 429496;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-429496
-'#--------------------FN_DYNVARS_007_04-------------------------#'
-SET @@session.bulk_insert_buffer_size = 0;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-0
-SET @@session.bulk_insert_buffer_size = 1;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-1
-SET @@session.bulk_insert_buffer_size = 4294967295;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-4294967295
-SET @@session.bulk_insert_buffer_size = 429496;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-429496
-'#------------------FN_DYNVARS_007_05-----------------------#'
-SET @@global.bulk_insert_buffer_size = 42949672950;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-42949672950
-SET @@global.bulk_insert_buffer_size = -1024;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-0
-SET @@global.bulk_insert_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
-SET @@global.bulk_insert_buffer_size = ON;
-ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
-SET @@global.bulk_insert_buffer_size = 429496.10;
-ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
-SET @@session.bulk_insert_buffer_size = 42949672950;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-42949672950
-SET @@session.bulk_insert_buffer_size = -2;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-0
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@session.bulk_insert_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
-SET @@session.bulk_insert_buffer_size = 429496.10;
-ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
-'#------------------FN_DYNVARS_007_06-----------------------#'
-SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='bulk_insert_buffer_size';
-@@global.bulk_insert_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_007_07-----------------------#'
-SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='bulk_insert_buffer_size';
-@@session.bulk_insert_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_007_08-----------------------#'
-SET @@global.bulk_insert_buffer_size = TRUE;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-1
-SET @@global.bulk_insert_buffer_size = FALSE;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-0
-SET @@session.bulk_insert_buffer_size = TRUE;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-1
-SET @@session.bulk_insert_buffer_size = FALSE;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-0
-'#---------------------FN_DYNVARS_007_09----------------------#'
-SET @@bulk_insert_buffer_size = 100;
-SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size;
-@@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size
-1
-SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
-@@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size
-1
-'#---------------------FN_DYNVARS_007_10----------------------#'
-SET bulk_insert_buffer_size = 1;
-SELECT @@bulk_insert_buffer_size;
-@@bulk_insert_buffer_size
-1
-SET local.bulk_insert_buffer_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1
-SELECT local.bulk_insert_buffer_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET session.bulk_insert_buffer_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1
-SELECT session.bulk_insert_buffer_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
-ERROR 42S22: Unknown column 'bulk_insert_buffer_size' in 'field list'
-SET @@global.bulk_insert_buffer_size = @start_global_value;
-SELECT @@global.bulk_insert_buffer_size;
-@@global.bulk_insert_buffer_size
-8388608
-SET @@session.bulk_insert_buffer_size = @start_session_value;
-SELECT @@session.bulk_insert_buffer_size;
-@@session.bulk_insert_buffer_size
-8388608
diff --git a/mysql-test/r/delayed_insert_limit_basic_64.result b/mysql-test/r/delayed_insert_limit_basic_64.result
deleted file mode 100644
index 246bf0e8734..00000000000
--- a/mysql-test/r/delayed_insert_limit_basic_64.result
+++ /dev/null
@@ -1,110 +0,0 @@
-SET @start_value = @@global.delayed_insert_limit;
-SELECT @start_value;
-@start_value
-100
-'#--------------------FN_DYNVARS_024_01------------------------#'
-SET @@global.delayed_insert_limit = 100;
-SET @@global.delayed_insert_limit = DEFAULT;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-100
-'#---------------------FN_DYNVARS_024_02-------------------------#'
-SET @@global.delayed_insert_limit = @start_value;
-SELECT @@global.delayed_insert_limit = 100;
-@@global.delayed_insert_limit = 100
-1
-'#--------------------FN_DYNVARS_024_03------------------------#'
-SET @@global.delayed_insert_limit = 10000;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-10000
-SET @@global.delayed_insert_limit = 4294967295;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-4294967295
-SET @@global.delayed_insert_limit = 1;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-1
-'#--------------------FN_DYNVARS_024_04-------------------------#'
-SET @@global.delayed_insert_limit = 0;
-Warnings:
-Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-1
-SET @@global.delayed_insert_limit = -1024;
-Warnings:
-Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-1
-SET @@global.delayed_insert_limit = 42949672950;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-42949672950
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.delayed_insert_limit = 429496729.5;
-ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-42949672950
-SET @@global.delayed_insert_limit = ON;
-ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-42949672950
-'#-------------------FN_DYNVARS_024_05----------------------------#'
-SET @@session.delayed_insert_limit = 0;
-ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@Session.delayed_insert_limit;
-ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable
-'#----------------------FN_DYNVARS_024_06------------------------#'
-SELECT @@global.delayed_insert_limit =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='delayed_insert_limit';
-@@global.delayed_insert_limit =
-VARIABLE_VALUE
-1
-SELECT @@delayed_insert_limit =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='delayed_insert_limit';
-@@delayed_insert_limit =
-VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_024_07----------------------#'
-SET @@global.delayed_insert_limit = TRUE;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-1
-SET @@global.delayed_insert_limit = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-1
-'#---------------------FN_DYNVARS_024_08----------------------#'
-SET @@global.delayed_insert_limit = 1;
-SELECT @@delayed_insert_limit = @@global.delayed_insert_limit;
-@@delayed_insert_limit = @@global.delayed_insert_limit
-1
-'#---------------------FN_DYNVARS_024_09----------------------#'
-SET delayed_insert_limit = 1;
-ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@delayed_insert_limit;
-@@delayed_insert_limit
-1
-SET local.delayed_insert_limit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1
-SELECT local.delayed_insert_limit;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.delayed_insert_limit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1
-SELECT global.delayed_insert_limit;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT delayed_insert_limit = @@session.delayed_insert_limit;
-ERROR 42S22: Unknown column 'delayed_insert_limit' in 'field list'
-SET @@global.delayed_insert_limit = @start_value;
-SELECT @@global.delayed_insert_limit;
-@@global.delayed_insert_limit
-100
diff --git a/mysql-test/r/delayed_queue_size_basic_64.result b/mysql-test/r/delayed_queue_size_basic_64.result
deleted file mode 100644
index d575626b0a1..00000000000
--- a/mysql-test/r/delayed_queue_size_basic_64.result
+++ /dev/null
@@ -1,108 +0,0 @@
-SET @start_value = @@global.delayed_queue_size;
-SELECT @start_value;
-@start_value
-1000
-'#--------------------FN_DYNVARS_026_01------------------------#'
-SET @@global.delayed_queue_size = 100;
-SET @@global.delayed_queue_size = DEFAULT;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1000
-'#---------------------FN_DYNVARS_026_02-------------------------#'
-SET @@global.delayed_queue_size = @start_value;
-SELECT @@global.delayed_queue_size = 1000;
-@@global.delayed_queue_size = 1000
-1
-'#--------------------FN_DYNVARS_026_03------------------------#'
-SET @@global.delayed_queue_size = 10000;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-10000
-SET @@global.delayed_queue_size = 4294967295;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-4294967295
-SET @@global.delayed_queue_size = 1;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1
-'#--------------------FN_DYNVARS_026_04-------------------------#'
-SET @@global.delayed_queue_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect delayed_queue_size value: '0'
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1
-SET @@global.delayed_queue_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect delayed_queue_size value: '0'
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1
-SET @@global.delayed_queue_size = 42949672950;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-42949672950
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.delayed_queue_size = 429496729.5;
-ERROR 42000: Incorrect argument type to variable 'delayed_queue_size'
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-42949672950
-SET @@global.delayed_queue_size = ON;
-ERROR 42000: Incorrect argument type to variable 'delayed_queue_size'
-SELECT @@delayed_queue_size;
-@@delayed_queue_size
-42949672950
-'#-------------------FN_DYNVARS_026_05----------------------------#'
-SET @@session.delayed_queue_size = 0;
-ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.delayed_queue_size;
-ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable
-'#----------------------FN_DYNVARS_026_06------------------------#'
-SELECT @@global.delayed_queue_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='delayed_queue_size';
-@@global.delayed_queue_size = VARIABLE_VALUE
-1
-SELECT @@delayed_queue_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='delayed_queue_size';
-@@delayed_queue_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_026_07----------------------#'
-SET @@global.delayed_queue_size = TRUE;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1
-SET @@global.delayed_queue_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect delayed_queue_size value: '0'
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1
-'#---------------------FN_DYNVARS_026_08----------------------#'
-SET @@global.delayed_queue_size = 1;
-SELECT @@delayed_queue_size = @@global.delayed_queue_size;
-@@delayed_queue_size = @@global.delayed_queue_size
-1
-'#---------------------FN_DYNVARS_026_09----------------------#'
-SET delayed_queue_size = 1;
-ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@delayed_queue_size;
-@@delayed_queue_size
-1
-SET local.delayed_queue_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1
-SELECT local.delayed_queue_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.delayed_queue_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1
-SELECT global.delayed_queue_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT delayed_queue_size = @@session.delayed_queue_size;
-ERROR 42S22: Unknown column 'delayed_queue_size' in 'field list'
-SET @@global.delayed_queue_size = @start_value;
-SELECT @@global.delayed_queue_size;
-@@global.delayed_queue_size
-1000
diff --git a/mysql-test/r/innodb_concurrency_tickets_basic_64.result b/mysql-test/r/innodb_concurrency_tickets_basic_64.result
deleted file mode 100644
index 40d307d8733..00000000000
--- a/mysql-test/r/innodb_concurrency_tickets_basic_64.result
+++ /dev/null
@@ -1,98 +0,0 @@
-SET @global_start_value = @@global.innodb_concurrency_tickets;
-SELECT @global_start_value;
-@global_start_value
-500
-'#--------------------FN_DYNVARS_046_01------------------------#'
-SET @@global.innodb_concurrency_tickets = 0;
-Warnings:
-Warning	1292	Truncated incorrect concurrency_tickets value: '0'
-SET @@global.innodb_concurrency_tickets = DEFAULT;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-500
-'#---------------------FN_DYNVARS_046_02-------------------------#'
-SET innodb_concurrency_tickets = 1;
-ERROR HY000: Variable 'innodb_concurrency_tickets' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@innodb_concurrency_tickets;
-@@innodb_concurrency_tickets
-500
-SELECT local.innodb_concurrency_tickets;
-ERROR 42S02: Unknown table 'local' in field list
-SET global innodb_concurrency_tickets = 0;
-Warnings:
-Warning	1292	Truncated incorrect concurrency_tickets value: '0'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-'#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@global.innodb_concurrency_tickets = 1;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-SET @@global.innodb_concurrency_tickets = 1000;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1000
-SET @@global.innodb_concurrency_tickets = 4294967295;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-4294967295
-'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@global.innodb_concurrency_tickets = -1;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-18446744073709551615
-SET @@global.innodb_concurrency_tickets = "T";
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-18446744073709551615
-SET @@global.innodb_concurrency_tickets = "Y";
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-18446744073709551615
-SET @@global.innodb_concurrency_tickets = 1001;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
-SELECT @@global.innodb_concurrency_tickets =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_concurrency_tickets';
-@@global.innodb_concurrency_tickets =
-VARIABLE_VALUE
-1
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_concurrency_tickets';
-VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
-SET @@global.innodb_concurrency_tickets = OFF;
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-SET @@global.innodb_concurrency_tickets = ON;
-ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
-SET @@global.innodb_concurrency_tickets = TRUE;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-SET @@global.innodb_concurrency_tickets = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect concurrency_tickets value: '0'
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-1
-SET @@global.innodb_concurrency_tickets = @global_start_value;
-SELECT @@global.innodb_concurrency_tickets;
-@@global.innodb_concurrency_tickets
-500
diff --git a/mysql-test/r/innodb_max_purge_lag_basic_64.result b/mysql-test/r/innodb_max_purge_lag_basic_64.result
deleted file mode 100644
index a6b669dde83..00000000000
--- a/mysql-test/r/innodb_max_purge_lag_basic_64.result
+++ /dev/null
@@ -1,92 +0,0 @@
-SET @global_start_value = @@global.innodb_max_purge_lag;
-SELECT @global_start_value;
-@global_start_value
-0
-'#--------------------FN_DYNVARS_046_01------------------------#'
-SET @@global.innodb_max_purge_lag = 0;
-SET @@global.innodb_max_purge_lag = DEFAULT;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-'#---------------------FN_DYNVARS_046_02-------------------------#'
-SET innodb_max_purge_lag = 1;
-ERROR HY000: Variable 'innodb_max_purge_lag' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@innodb_max_purge_lag;
-@@innodb_max_purge_lag
-0
-SELECT local.innodb_max_purge_lag;
-ERROR 42S02: Unknown table 'local' in field list
-SET global innodb_max_purge_lag = 0;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-'#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@global.innodb_max_purge_lag = 0;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-SET @@global.innodb_max_purge_lag = 1;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1
-SET @@global.innodb_max_purge_lag = 4294967295;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-4294967295
-'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@global.innodb_max_purge_lag = -1;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-18446744073709551615
-SET @@global.innodb_max_purge_lag = "T";
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-18446744073709551615
-SET @@global.innodb_max_purge_lag = "Y";
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-18446744073709551615
-SET @@global.innodb_max_purge_lag = 1001;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
-SELECT @@global.innodb_max_purge_lag =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_max_purge_lag';
-@@global.innodb_max_purge_lag =
-VARIABLE_VALUE
-1
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_max_purge_lag';
-VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
-SET @@global.innodb_max_purge_lag = OFF;
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-SET @@global.innodb_max_purge_lag = ON;
-ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
-SET @@global.innodb_max_purge_lag = TRUE;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-1
-SET @@global.innodb_max_purge_lag = FALSE;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
-SET @@global.innodb_max_purge_lag = @global_start_value;
-SELECT @@global.innodb_max_purge_lag;
-@@global.innodb_max_purge_lag
-0
diff --git a/mysql-test/r/innodb_sync_spin_loops_basic_64.result b/mysql-test/r/innodb_sync_spin_loops_basic_64.result
deleted file mode 100644
index 1b99ad8e3db..00000000000
--- a/mysql-test/r/innodb_sync_spin_loops_basic_64.result
+++ /dev/null
@@ -1,92 +0,0 @@
-SET @global_start_value = @@global.innodb_sync_spin_loops;
-SELECT @global_start_value;
-@global_start_value
-20
-'#--------------------FN_DYNVARS_046_01------------------------#'
-SET @@global.innodb_sync_spin_loops = 0;
-SET @@global.innodb_sync_spin_loops = DEFAULT;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-20
-'#---------------------FN_DYNVARS_046_02-------------------------#'
-SET innodb_sync_spin_loops = 1;
-ERROR HY000: Variable 'innodb_sync_spin_loops' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@innodb_sync_spin_loops;
-@@innodb_sync_spin_loops
-20
-SELECT local.innodb_sync_spin_loops;
-ERROR 42S02: Unknown table 'local' in field list
-SET global innodb_sync_spin_loops = 0;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-0
-'#--------------------FN_DYNVARS_046_03------------------------#'
-SET @@global.innodb_sync_spin_loops = 0;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-0
-SET @@global.innodb_sync_spin_loops = 1;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1
-SET @@global.innodb_sync_spin_loops = 1000;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1000
-'#--------------------FN_DYNVARS_046_04-------------------------#'
-SET @@global.innodb_sync_spin_loops = -1;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-18446744073709551615
-SET @@global.innodb_sync_spin_loops = "T";
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-18446744073709551615
-SET @@global.innodb_sync_spin_loops = "Y";
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-18446744073709551615
-SET @@global.innodb_sync_spin_loops = 1001;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-'#----------------------FN_DYNVARS_046_05------------------------#'
-SELECT @@global.innodb_sync_spin_loops =
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_sync_spin_loops';
-@@global.innodb_sync_spin_loops =
-VARIABLE_VALUE
-1
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_sync_spin_loops';
-VARIABLE_VALUE
-1001
-'#---------------------FN_DYNVARS_046_06-------------------------#'
-SET @@global.innodb_sync_spin_loops = OFF;
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-SET @@global.innodb_sync_spin_loops = ON;
-ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1001
-'#---------------------FN_DYNVARS_046_07----------------------#'
-SET @@global.innodb_sync_spin_loops = TRUE;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-1
-SET @@global.innodb_sync_spin_loops = FALSE;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-0
-SET @@global.innodb_sync_spin_loops = @global_start_value;
-SELECT @@global.innodb_sync_spin_loops;
-@@global.innodb_sync_spin_loops
-20
diff --git a/mysql-test/r/join_buffer_size_basic_64.result b/mysql-test/r/join_buffer_size_basic_64.result
deleted file mode 100644
index ed652af67d2..00000000000
--- a/mysql-test/r/join_buffer_size_basic_64.result
+++ /dev/null
@@ -1,194 +0,0 @@
-SET @start_global_value = @@global.join_buffer_size;
-SELECT @start_global_value;
-@start_global_value
-131072
-SET @start_session_value = @@session.join_buffer_size;
-SELECT @start_session_value;
-@start_session_value
-131072
-'#--------------------FN_DYNVARS_053_01-------------------------#'
-SET @@global.join_buffer_size = 8200;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8200'
-SET @@global.join_buffer_size = DEFAULT;
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-131072
-SET @@session.join_buffer_size = 8200;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8200'
-SET @@session.join_buffer_size = DEFAULT;
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-131072
-'#--------------------FN_DYNVARS_053_02-------------------------#'
-SET @@global.join_buffer_size = DEFAULT;
-SELECT @@global.join_buffer_size = 131072;
-@@global.join_buffer_size = 131072
-1
-SET @@session.join_buffer_size = DEFAULT;
-SELECT @@session.join_buffer_size = 131072;
-@@session.join_buffer_size = 131072
-1
-'#--------------------FN_DYNVARS_053_03-------------------------#'
-SET @@global.join_buffer_size = 8200;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8200'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = 65536;
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-65536
-SET @@global.join_buffer_size = 4294967295;
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-4294963200
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-'#--------------------FN_DYNVARS_053_04-------------------------#'
-SET @@session.join_buffer_size = 8200;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8200'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = 65536;
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-65536
-SET @@session.join_buffer_size = 4294967295;
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-4294963200
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-'#------------------FN_DYNVARS_053_05-----------------------#'
-SET @@global.join_buffer_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = 8199;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8199'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = 42949672951;
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-42949668864
-SET @@global.join_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-42949668864
-SET @@global.join_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-42949668864
-SET @@session.join_buffer_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = -2;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = 8199;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '8199'
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
-1
-SET @@session.join_buffer_size = 42949672951;
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-42949668864
-SET @@session.join_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-42949668864
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@session.join_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-42949668864
-'#------------------FN_DYNVARS_053_06-----------------------#'
-SELECT @@global.join_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='join_buffer_size';
-@@global.join_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_053_07-----------------------#'
-SELECT @@session.join_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='join_buffer_size';
-@@session.join_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_053_08-----------------------#'
-SET @@global.join_buffer_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '1'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-SET @@global.join_buffer_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '0'
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
-1
-'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.join_buffer_size = 10;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '10'
-SELECT @@join_buffer_size = @@global.join_buffer_size;
-@@join_buffer_size = @@global.join_buffer_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@join_buffer_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '100'
-SELECT @@join_buffer_size = @@local.join_buffer_size;
-@@join_buffer_size = @@local.join_buffer_size
-1
-SELECT @@local.join_buffer_size = @@session.join_buffer_size;
-@@local.join_buffer_size = @@session.join_buffer_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET join_buffer_size = 1;
-Warnings:
-Warning	1292	Truncated incorrect join_buffer_size value: '1'
-SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
-@@join_buffer_size=8200 OR @@join_buffer_size= 8228
-1
-SELECT local.join_buffer_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.join_buffer_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT join_buffer_size = @@session.join_buffer_size;
-ERROR 42S22: Unknown column 'join_buffer_size' in 'field list'
-SET @@global.join_buffer_size = @start_global_value;
-SELECT @@global.join_buffer_size;
-@@global.join_buffer_size
-131072
-SET @@session.join_buffer_size = @start_session_value;
-SELECT @@session.join_buffer_size;
-@@session.join_buffer_size
-131072
diff --git a/mysql-test/r/key_buffer_size_basic_64.result b/mysql-test/r/key_buffer_size_basic_64.result
deleted file mode 100644
index 981988a1d4d..00000000000
--- a/mysql-test/r/key_buffer_size_basic_64.result
+++ /dev/null
@@ -1,111 +0,0 @@
-SET @start_value = @@global.key_buffer_size;
-SELECT @start_value;
-@start_value
-1048576
-'#--------------------FN_DYNVARS_055_01------------------------#'
-SET @@global.key_buffer_size = 99;
-SET @@global.key_buffer_size = DEFAULT;
-ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-'#---------------------FN_DYNVARS_055_02-------------------------#'
-SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size = @start_value;
-@@global.key_buffer_size = @start_value
-1
-'#--------------------FN_DYNVARS_055_03------------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@global.key_buffer_size= @min_key_buffer_size;
-@@global.key_buffer_size= @min_key_buffer_size
-1
-SET @@global.key_buffer_size = 1800;
-Warnings:
-Warning	1292	Truncated incorrect key_buffer_size value: '1800'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-SET @@global.key_buffer_size = 65535;
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-61440
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-'#--------------------FN_DYNVARS_055_04-------------------------#'
-SET @@global.key_buffer_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-61440
-SET @@global.key_buffer_size = 4;
-Warnings:
-Warning	1292	Truncated incorrect key_buffer_size value: '4'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.key_buffer_size = ON;
-ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-SET @@global.key_buffer_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-'#-------------------FN_DYNVARS_055_05----------------------------#'
-SET @@session.key_buffer_size = 0;
-ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
-1
-'#----------------------FN_DYNVARS_055_06------------------------#'
-SELECT @@global.key_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_buffer_size';
-@@global.key_buffer_size = VARIABLE_VALUE
-1
-SELECT @@key_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_buffer_size';
-@@key_buffer_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_055_07----------------------#'
-SET @@global.key_buffer_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect key_buffer_size value: '1'
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-SET @@global.key_buffer_size = FALSE;
-Warnings:
-Warning	1438	Cannot drop default keycache
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-@@global.key_buffer_size = @min_key_buffer_size
-1
-'#---------------------FN_DYNVARS_055_08----------------------#'
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@key_buffer_size = @@global.key_buffer_size;
-@@key_buffer_size = @@global.key_buffer_size
-1
-'#---------------------FN_DYNVARS_055_09----------------------#'
-SET key_buffer_size = @min_key_buffer_size;
-ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_buffer_size = @min_key_buffer_size;
-@@key_buffer_size = @min_key_buffer_size
-1
-SET local.key_buffer_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
-SELECT local.key_buffer_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_buffer_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
-SELECT global.key_buffer_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_buffer_size = @@session.key_buffer_size;
-ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
-SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size;
-@@global.key_buffer_size
-1048576
diff --git a/mysql-test/r/key_cache_age_threshold_basic_64.result b/mysql-test/r/key_cache_age_threshold_basic_64.result
deleted file mode 100644
index 5e05dd7bacf..00000000000
--- a/mysql-test/r/key_cache_age_threshold_basic_64.result
+++ /dev/null
@@ -1,126 +0,0 @@
-SET @start_value = @@global.key_cache_age_threshold;
-SELECT @start_value;
-@start_value
-300
-'#--------------------FN_DYNVARS_056_01------------------------#'
-SET @@global.key_cache_age_threshold = 99;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_age_threshold value: '99'
-SET @@global.key_cache_age_threshold = DEFAULT;
-ERROR 42000: Variable 'key_cache_age_threshold' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-'#---------------------FN_DYNVARS_056_02-------------------------#'
-SET @@global.key_cache_age_threshold = @start_value;
-SELECT @@global.key_cache_age_threshold = 300;
-@@global.key_cache_age_threshold = 300
-1
-'#--------------------FN_DYNVARS_056_03------------------------#'
-SET @@global.key_cache_age_threshold = 100;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-SET @@global.key_cache_age_threshold = 4294967295;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-4294967200
-SET @@global.key_cache_age_threshold = 1800;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-1800
-SET @@global.key_cache_age_threshold = 65535;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-65500
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-'#--------------------FN_DYNVARS_056_04-------------------------#'
-SET @@global.key_cache_age_threshold = -1;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-18446744073709551600
-SET @@global.key_cache_age_threshold = 42949672951;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-42949672900
-SET @@global.key_cache_age_threshold = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-42949672900
-SET @@global.key_cache_age_threshold = -1024;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-18446744073709550500
-SET @@global.key_cache_age_threshold = 99;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_age_threshold value: '99'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.key_cache_age_threshold = ON;
-ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-SET @@global.key_cache_age_threshold = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-'#-------------------FN_DYNVARS_056_05----------------------------#'
-SET @@session.key_cache_age_threshold = 0;
-ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.key_cache_age_threshold;
-ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable
-'#----------------------FN_DYNVARS_056_06------------------------#'
-SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_age_threshold';
-@@global.key_cache_age_threshold = VARIABLE_VALUE
-1
-SELECT @@key_cache_age_threshold = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_age_threshold';
-@@key_cache_age_threshold = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_056_07----------------------#'
-SET @@global.key_cache_age_threshold = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_age_threshold value: '1'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-SET @@global.key_cache_age_threshold = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_age_threshold value: '0'
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-100
-'#---------------------FN_DYNVARS_056_08----------------------#'
-SET @@global.key_cache_age_threshold = 101;
-SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold;
-@@key_cache_age_threshold = @@global.key_cache_age_threshold
-1
-'#---------------------FN_DYNVARS_056_09----------------------#'
-SET key_cache_age_threshold = 8000;
-ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_cache_age_threshold;
-@@key_cache_age_threshold
-100
-SET local.key_cache_age_threshold = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1
-SELECT local.key_cache_age_threshold;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_age_threshold = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1
-SELECT global.key_cache_age_threshold;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_cache_age_threshold = @@session.key_cache_age_threshold;
-ERROR 42S22: Unknown column 'key_cache_age_threshold' in 'field list'
-SET @@global.key_cache_age_threshold = @start_value;
-SELECT @@global.key_cache_age_threshold;
-@@global.key_cache_age_threshold
-300
diff --git a/mysql-test/r/key_cache_block_size_basic_64.result b/mysql-test/r/key_cache_block_size_basic_64.result
deleted file mode 100644
index 46ce1f26b29..00000000000
--- a/mysql-test/r/key_cache_block_size_basic_64.result
+++ /dev/null
@@ -1,142 +0,0 @@
-SET @start_value = @@global.key_cache_block_size;
-SELECT @start_value;
-@start_value
-1024
-'#--------------------FN_DYNVARS_057_01------------------------#'
-SET @@global.key_cache_block_size = 600;
-SET @@global.key_cache_block_size = DEFAULT;
-ERROR 42000: Variable 'key_cache_block_size' doesn't have a default value
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-'#---------------------FN_DYNVARS_057_02-------------------------#'
-SET @@global.key_cache_block_size = @start_value;
-SELECT @@global.key_cache_block_size = 1024;
-@@global.key_cache_block_size = 1024
-1
-'#--------------------FN_DYNVARS_057_03------------------------#'
-SET @@global.key_cache_block_size = 1024;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-1024
-SET @@global.key_cache_block_size = 16384;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 1800;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-1536
-SET @@global.key_cache_block_size = 16383;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-15872
-'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-'#--------------------FN_DYNVARS_057_04-------------------------#'
-SET @@global.key_cache_block_size = -1;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '18446744073709551615'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 42949672951;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '42949672951'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '18446744073709550592'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 256;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '256'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-SET @@global.key_cache_block_size = 511;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '511'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-SET @@global.key_cache_block_size = 16385;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '16385'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.key_cache_block_size = ON;
-ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-SET @@global.key_cache_block_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-16384
-'#-------------------FN_DYNVARS_057_05----------------------------#'
-SET @@session.key_cache_block_size = 0;
-ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.key_cache_block_size;
-ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable
-'#----------------------FN_DYNVARS_057_06------------------------#'
-SELECT @@global.key_cache_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_block_size';
-@@global.key_cache_block_size = VARIABLE_VALUE
-1
-SELECT @@key_cache_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_block_size';
-@@key_cache_block_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_057_07----------------------#'
-SET @@global.key_cache_block_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '1'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-SET @@global.key_cache_block_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_block_size value: '0'
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-512
-'#---------------------FN_DYNVARS_057_08----------------------#'
-SET @@global.key_cache_block_size = 1024;
-SELECT @@key_cache_block_size = @@global.key_cache_block_size;
-@@key_cache_block_size = @@global.key_cache_block_size
-1
-'#---------------------FN_DYNVARS_057_09----------------------#'
-SET key_cache_block_size = 8000;
-ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_cache_block_size;
-@@key_cache_block_size
-1024
-SET local.key_cache_block_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1
-SELECT local.key_cache_block_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_block_size = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1
-SELECT global.key_cache_block_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_cache_block_size = @@session.key_cache_block_size;
-ERROR 42S22: Unknown column 'key_cache_block_size' in 'field list'
-SET @@global.key_cache_block_size = @start_value;
-SELECT @@global.key_cache_block_size;
-@@global.key_cache_block_size
-1024
diff --git a/mysql-test/r/key_cache_division_limit_basic_64.result b/mysql-test/r/key_cache_division_limit_basic_64.result
deleted file mode 100644
index cd0cdcbca05..00000000000
--- a/mysql-test/r/key_cache_division_limit_basic_64.result
+++ /dev/null
@@ -1,139 +0,0 @@
-SET @start_value = @@global.key_cache_division_limit;
-SELECT @start_value;
-@start_value
-100
-'#--------------------FN_DYNVARS_058_01------------------------#'
-SET @@global.key_cache_division_limit = 50;
-SET @@global.key_cache_division_limit = DEFAULT;
-ERROR 42000: Variable 'key_cache_division_limit' doesn't have a default value
-'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-50
-'#---------------------FN_DYNVARS_058_02-------------------------#'
-SET @@global.key_cache_division_limit = @start_value;
-SELECT @@global.key_cache_division_limit = 100;
-@@global.key_cache_division_limit = 100
-1
-'#--------------------FN_DYNVARS_058_03------------------------#'
-SET @@global.key_cache_division_limit = 1;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-SET @@global.key_cache_division_limit = 50;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-50
-SET @@global.key_cache_division_limit = 99;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-99
-SET @@global.key_cache_division_limit = 2;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-2
-'#--------------------FN_DYNVARS_058_04-------------------------#'
-SET @@global.key_cache_division_limit = -1;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '18446744073709551615'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 101;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '101'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = -1024;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '18446744073709550592'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 0;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '0'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-SET @@global.key_cache_division_limit = 200;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '200'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 65535;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '65535'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-'Bug # 34837: Errors are not coming on assigning invalid values to variable'
-SET @@global.key_cache_division_limit = ON;
-ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-SET @@global.key_cache_division_limit = 'test';
-ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
-'#-------------------FN_DYNVARS_058_05----------------------------#'
-SET @@session.key_cache_division_limit = 0;
-ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.key_cache_division_limit;
-ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable
-'#----------------------FN_DYNVARS_058_06------------------------#'
-SELECT @@global.key_cache_division_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_division_limit';
-@@global.key_cache_division_limit = VARIABLE_VALUE
-1
-SELECT @@key_cache_division_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_division_limit';
-@@key_cache_division_limit = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_058_07----------------------#'
-SET @@global.key_cache_division_limit = TRUE;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-SET @@global.key_cache_division_limit = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect key_cache_division_limit value: '0'
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-1
-'#---------------------FN_DYNVARS_058_08----------------------#'
-SET @@global.key_cache_division_limit = 90;
-SELECT @@key_cache_division_limit = @@global.key_cache_division_limit;
-@@key_cache_division_limit = @@global.key_cache_division_limit
-1
-'#---------------------FN_DYNVARS_058_09----------------------#'
-SET key_cache_division_limit = 80;
-ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@key_cache_division_limit;
-@@key_cache_division_limit
-90
-SET local.key_cache_division_limit = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1
-SELECT local.key_cache_division_limit;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.key_cache_division_limit = 10;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1
-SELECT global.key_cache_division_limit;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT key_cache_division_limit = @@session.key_cache_division_limit;
-ERROR 42S22: Unknown column 'key_cache_division_limit' in 'field list'
-SET @@global.key_cache_division_limit = @start_value;
-SELECT @@global.key_cache_division_limit;
-@@global.key_cache_division_limit
-100
diff --git a/mysql-test/r/log_warnings_basic_64.result b/mysql-test/r/log_warnings_basic_64.result
deleted file mode 100644
index ba6671c87a4..00000000000
--- a/mysql-test/r/log_warnings_basic_64.result
+++ /dev/null
@@ -1,158 +0,0 @@
-SET @start_global_value = @@global.log_warnings;
-SELECT @start_global_value;
-@start_global_value
-1
-SET @start_session_value = @@session.log_warnings;
-SELECT @start_session_value;
-@start_session_value
-1
-'#--------------------FN_DYNVARS_067_01-------------------------#'
-SET @@global.log_warnings = 100;
-SET @@global.log_warnings = DEFAULT;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-1
-SET @@session.log_warnings = 200;
-SET @@session.log_warnings = DEFAULT;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-1
-'#--------------------FN_DYNVARS_067_02-------------------------#'
-SET @@global.log_warnings = DEFAULT;
-SELECT @@global.log_warnings = 1;
-@@global.log_warnings = 1
-1
-SET @@session.log_warnings = DEFAULT;
-SELECT @@session.log_warnings = 1;
-@@session.log_warnings = 1
-1
-'#--------------------FN_DYNVARS_067_03-------------------------#'
-SET @@global.log_warnings = 0;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-0
-SET @@global.log_warnings = 1;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-1
-SET @@global.log_warnings = 60020;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-60020
-SET @@global.log_warnings = 65535;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-65535
-SET @@global.log_warnings = 65536;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-65536
-'#--------------------FN_DYNVARS_067_04-------------------------#'
-SET @@session.log_warnings = 0;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-0
-SET @@session.log_warnings = 1;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-1
-SET @@session.log_warnings = 50050;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-50050
-SET @@session.log_warnings = 65535;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-65535
-SET @@session.log_warnings = 65550;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-65550
-'#------------------FN_DYNVARS_067_05-----------------------#'
-SET @@global.log_warnings = 100000000000;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-100000000000
-SET @@global.log_warnings = -1024;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-0
-SET @@global.log_warnings = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.log_warnings;
-@@global.log_warnings
-0
-SET @@global.log_warnings = test;
-ERROR 42000: Incorrect argument type to variable 'log_warnings'
-SELECT @@global.log_warnings;
-@@global.log_warnings
-0
-SET @@session.log_warnings = 100000000000;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-100000000000
-SET @@session.log_warnings = -2;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-0
-SET @@session.log_warnings = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.log_warnings = test;
-ERROR 42000: Incorrect argument type to variable 'log_warnings'
-SELECT @@session.log_warnings;
-@@session.log_warnings
-0
-'#------------------FN_DYNVARS_067_06-----------------------#'
-SELECT @@global.log_warnings = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='log_warnings';
-@@global.log_warnings = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_067_07-----------------------#'
-SELECT @@session.log_warnings = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='log_warnings';
-@@session.log_warnings = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_067_08-----------------------#'
-SET @@global.log_warnings = TRUE;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-1
-SET @@global.log_warnings = FALSE;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-0
-'#---------------------FN_DYNVARS_067_09----------------------#'
-SET @@global.log_warnings = 10;
-SELECT @@log_warnings = @@global.log_warnings;
-@@log_warnings = @@global.log_warnings
-0
-'#---------------------FN_DYNVARS_067_10----------------------#'
-SET @@log_warnings = 100;
-SELECT @@log_warnings = @@local.log_warnings;
-@@log_warnings = @@local.log_warnings
-1
-SELECT @@local.log_warnings = @@session.log_warnings;
-@@local.log_warnings = @@session.log_warnings
-1
-'#---------------------FN_DYNVARS_067_11----------------------#'
-SET log_warnings = 1;
-SELECT @@log_warnings;
-@@log_warnings
-1
-SELECT local.log_warnings;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.log_warnings;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT log_warnings = @@session.log_warnings;
-ERROR 42S22: Unknown column 'log_warnings' in 'field list'
-SET @@global.log_warnings = @start_global_value;
-SELECT @@global.log_warnings;
-@@global.log_warnings
-1
-SET @@session.log_warnings = @start_session_value;
-SELECT @@session.log_warnings;
-@@session.log_warnings
-1
diff --git a/mysql-test/r/max_binlog_cache_size_basic_64.result b/mysql-test/r/max_binlog_cache_size_basic_64.result
deleted file mode 100644
index 30db3f14dd4..00000000000
--- a/mysql-test/r/max_binlog_cache_size_basic_64.result
+++ /dev/null
@@ -1,141 +0,0 @@
-SET @start_value = @@global.max_binlog_cache_size;
-SELECT @start_value;
-@start_value
-18446744073709551615
-'#--------------------FN_DYNVARS_072_01------------------------#'
-SET @@global.max_binlog_cache_size = 5000;
-SET @@global.max_binlog_cache_size = DEFAULT;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-18446744073709547520
-'#---------------------FN_DYNVARS_072_02-------------------------#'
-SET @@global.max_binlog_cache_size = @start_value;
-SELECT @@global.max_binlog_cache_size = 4294967295;
-@@global.max_binlog_cache_size = 4294967295
-0
-'Bug# 34876: Incorrect Default Value is assigned to variable';
-'#--------------------FN_DYNVARS_072_03------------------------#'
-SET @@global.max_binlog_cache_size = 4096;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 4294967295;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
-SET @@global.max_binlog_cache_size = 4294967294;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294963200
-SET @@global.max_binlog_cache_size = 4097;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 65535;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-61440
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_072_04-------------------------#'
-SET @@global.max_binlog_cache_size = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 100000000000;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-99999997952
-SET @@global.max_binlog_cache_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-99999997952
-SET @@global.max_binlog_cache_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 1024;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '1024'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 4294967296;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4294967296
-SET @@global.max_binlog_cache_size = 4095;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '4095'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.max_binlog_cache_size = ON;
-ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-'#-------------------FN_DYNVARS_072_05----------------------------#'
-SET @@session.max_binlog_cache_size = 4096;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.max_binlog_cache_size;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable
-'#----------------------FN_DYNVARS_072_06------------------------#'
-SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_binlog_cache_size';
-@@global.max_binlog_cache_size = VARIABLE_VALUE
-1
-SELECT @@max_binlog_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_binlog_cache_size';
-@@max_binlog_cache_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_072_07----------------------#'
-SET @@global.max_binlog_cache_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '1'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-SET @@global.max_binlog_cache_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-4096
-'#---------------------FN_DYNVARS_072_08----------------------#'
-SET @@global.max_binlog_cache_size = 5000;
-SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
-@@max_binlog_cache_size = @@global.max_binlog_cache_size
-1
-'#---------------------FN_DYNVARS_072_09----------------------#'
-SET max_binlog_cache_size = 6000;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@max_binlog_cache_size;
-@@max_binlog_cache_size
-4096
-SET local.max_binlog_cache_size = 7000;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 7000' at line 1
-SELECT local.max_binlog_cache_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.max_binlog_cache_size = 8000;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 8000' at line 1
-SELECT global.max_binlog_cache_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
-ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list'
-SET @@global.max_binlog_cache_size = @start_value;
-SELECT @@global.max_binlog_cache_size;
-@@global.max_binlog_cache_size
-18446744073709547520
diff --git a/mysql-test/r/max_connect_errors_basic_64.result b/mysql-test/r/max_connect_errors_basic_64.result
deleted file mode 100644
index 8117b650651..00000000000
--- a/mysql-test/r/max_connect_errors_basic_64.result
+++ /dev/null
@@ -1,133 +0,0 @@
-SET @start_value = @@global.max_connect_errors;
-SELECT @start_value;
-@start_value
-10
-'#--------------------FN_DYNVARS_073_01------------------------#'
-SET @@global.max_connect_errors = 5000;
-SET @@global.max_connect_errors = DEFAULT;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-10
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#---------------------FN_DYNVARS_073_02-------------------------#'
-SET @@global.max_connect_errors = @start_value;
-SELECT @@global.max_connect_errors = 10;
-@@global.max_connect_errors = 10
-1
-'#--------------------FN_DYNVARS_073_03------------------------#'
-SET @@global.max_connect_errors = 4096;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4096
-SET @@global.max_connect_errors = 4294967294;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967294
-SET @@global.max_connect_errors = 4294967295;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967295
-SET @@global.max_connect_errors = 1;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-SET @@global.max_connect_errors = 2;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-2
-'Bug# 34877:  Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_073_04-------------------------#'
-SET @@global.max_connect_errors = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '0'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-SET @@global.max_connect_errors = 100000000000;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-100000000000
-SET @@global.max_connect_errors = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-100000000000
-SET @@global.max_connect_errors = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '0'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-SET @@global.max_connect_errors = 0;
-Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '0'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-SET @@global.max_connect_errors = 4294967296;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.max_connect_errors = ON;
-ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967296
-SET @@global.max_connect_errors = 'test';
-ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-4294967296
-'#-------------------FN_DYNVARS_073_05----------------------------#'
-SET @@session.max_connect_errors = 4096;
-ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@session.max_connect_errors;
-ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable
-'#----------------------FN_DYNVARS_073_06------------------------#'
-SELECT @@global.max_connect_errors = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_connect_errors';
-@@global.max_connect_errors = VARIABLE_VALUE
-1
-SELECT @@max_connect_errors = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_connect_errors';
-@@max_connect_errors = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_073_07----------------------#'
-SET @@global.max_connect_errors = TRUE;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-SET @@global.max_connect_errors = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_connect_errors value: '0'
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-1
-'#---------------------FN_DYNVARS_073_08----------------------#'
-SET @@global.max_connect_errors = 5000;
-SELECT @@max_connect_errors = @@global.max_connect_errors;
-@@max_connect_errors = @@global.max_connect_errors
-1
-'#---------------------FN_DYNVARS_073_09----------------------#'
-SET max_connect_errors = 6000;
-ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@max_connect_errors;
-@@max_connect_errors
-5000
-SET local.max_connect_errors = 7000;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 7000' at line 1
-SELECT local.max_connect_errors;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.max_connect_errors = 8000;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 8000' at line 1
-SELECT global.max_connect_errors;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT max_connect_errors = @@session.max_connect_errors;
-ERROR 42S22: Unknown column 'max_connect_errors' in 'field list'
-SET @@global.max_connect_errors = @start_value;
-SELECT @@global.max_connect_errors;
-@@global.max_connect_errors
-10
diff --git a/mysql-test/r/max_heap_table_size_basic_64.result b/mysql-test/r/max_heap_table_size_basic_64.result
deleted file mode 100644
index ebab80f376b..00000000000
--- a/mysql-test/r/max_heap_table_size_basic_64.result
+++ /dev/null
@@ -1,196 +0,0 @@
-SET @start_global_value = @@global.max_heap_table_size;
-SELECT @start_global_value;
-@start_global_value
-1048576
-SET @start_session_value = @@session.max_heap_table_size;
-SELECT @start_session_value;
-@start_session_value
-1048576
-'#--------------------FN_DYNVARS_077_01-------------------------#'
-SET @@global.max_heap_table_size = 1677721610;
-SET @@global.max_heap_table_size = DEFAULT;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16777216
-SET @@session.max_heap_table_size = 1677721610;
-SET @@session.max_heap_table_size = DEFAULT;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16777216
-'#--------------------FN_DYNVARS_077_02-------------------------#'
-SET @@global.max_heap_table_size = DEFAULT;
-SELECT @@global.max_heap_table_size = 16777216;
-@@global.max_heap_table_size = 16777216
-1
-SET @@session.max_heap_table_size = DEFAULT;
-SELECT @@session.max_heap_table_size = 16777216;
-@@session.max_heap_table_size = 16777216
-1
-'#--------------------FN_DYNVARS_077_03-------------------------#'
-SET @@global.max_heap_table_size = 16384;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 16385;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 65535;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-64512
-SET @@global.max_heap_table_size = 4294967294;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294966272
-SET @@global.max_heap_table_size = 4294967295;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_077_04-------------------------#'
-SET @@session.max_heap_table_size = 16384;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 16385;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 65535;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-64512
-SET @@session.max_heap_table_size = 4294967294;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294966272
-SET @@session.max_heap_table_size = 4294967295;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#------------------FN_DYNVARS_077_05-----------------------#'
-SET @@global.max_heap_table_size = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 1024;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '1024'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 16383;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '16383'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = 4294967296;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294967296
-SET @@global.max_heap_table_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294967296
-SET @@global.max_heap_table_size = test;
-ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-4294967296
-SET @@session.max_heap_table_size = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 16383;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '16383'
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-16384
-SET @@session.max_heap_table_size = 4294967296;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-4294967296
-SET @@session.max_heap_table_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.max_heap_table_size = 10737418241;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-10737418240
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.max_heap_table_size = test;
-ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-10737418240
-'#------------------FN_DYNVARS_077_06-----------------------#'
-SELECT @@global.max_heap_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_heap_table_size';
-@@global.max_heap_table_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_077_07-----------------------#'
-SELECT @@session.max_heap_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_heap_table_size';
-@@session.max_heap_table_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_077_08-----------------------#'
-SET @@global.max_heap_table_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '1'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-SET @@global.max_heap_table_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_heap_table_size value: '0'
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-16384
-'#---------------------FN_DYNVARS_077_09----------------------#'
-SET @@global.max_heap_table_size = 163845;
-SELECT @@max_heap_table_size = @@global.max_heap_table_size;
-@@max_heap_table_size = @@global.max_heap_table_size
-0
-'#---------------------FN_DYNVARS_077_10----------------------#'
-SET @@max_heap_table_size = 16777216;
-SELECT @@max_heap_table_size = @@local.max_heap_table_size;
-@@max_heap_table_size = @@local.max_heap_table_size
-1
-SELECT @@local.max_heap_table_size = @@session.max_heap_table_size;
-@@local.max_heap_table_size = @@session.max_heap_table_size
-1
-'#---------------------FN_DYNVARS_077_11----------------------#'
-SET max_heap_table_size = 316777216;
-SELECT @@max_heap_table_size;
-@@max_heap_table_size
-316776448
-SELECT local.max_heap_table_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.max_heap_table_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT max_heap_table_size = @@session.max_heap_table_size;
-ERROR 42S22: Unknown column 'max_heap_table_size' in 'field list'
-SET @@global.max_heap_table_size = @start_global_value;
-SELECT @@global.max_heap_table_size;
-@@global.max_heap_table_size
-1048576
-SET @@session.max_heap_table_size = @start_session_value;
-SELECT @@session.max_heap_table_size;
-@@session.max_heap_table_size
-1048576
diff --git a/mysql-test/r/max_seeks_for_key_basic_64.result b/mysql-test/r/max_seeks_for_key_basic_64.result
deleted file mode 100644
index eefb829cdae..00000000000
--- a/mysql-test/r/max_seeks_for_key_basic_64.result
+++ /dev/null
@@ -1,176 +0,0 @@
-SET @start_global_value = @@global.max_seeks_for_key;
-SELECT @start_global_value;
-@start_global_value
-18446744073709551615
-SET @start_session_value = @@session.max_seeks_for_key;
-SELECT @start_session_value;
-@start_session_value
-18446744073709551615
-'#--------------------FN_DYNVARS_083_01-------------------------#'
-SET @@global.max_seeks_for_key = 100;
-SET @@global.max_seeks_for_key = DEFAULT;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-18446744073709551615
-SET @@session.max_seeks_for_key = 200;
-SET @@session.max_seeks_for_key = DEFAULT;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-18446744073709551615
-'#--------------------FN_DYNVARS_083_02-------------------------#'
-SET @@global.max_seeks_for_key = DEFAULT;
-SELECT @@global.max_seeks_for_key = 4294967295;
-@@global.max_seeks_for_key = 4294967295
-0
-SET @@session.max_seeks_for_key = DEFAULT;
-SELECT @@session.max_seeks_for_key = 4294967295;
-@@session.max_seeks_for_key = 4294967295
-0
-'#--------------------FN_DYNVARS_083_03-------------------------#'
-SET @@global.max_seeks_for_key = 1;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-1
-SET @@global.max_seeks_for_key = 2;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-2
-SET @@global.max_seeks_for_key = 65536;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-65536
-SET @@global.max_seeks_for_key = 4294967295;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967295
-SET @@global.max_seeks_for_key = 4294967294;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967294
-'#--------------------FN_DYNVARS_083_04-------------------------#'
-SET @@session.max_seeks_for_key = 1;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-1
-SET @@session.max_seeks_for_key = 2;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-2
-SET @@session.max_seeks_for_key = 4294967295;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-4294967295
-SET @@session.max_seeks_for_key = 4294967294;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-4294967294
-SET @@session.max_seeks_for_key = 65535;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-65535
-'#------------------FN_DYNVARS_083_05-----------------------#'
-SET @@global.max_seeks_for_key = 0;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-1
-SET @@global.max_seeks_for_key = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-1
-SET @@global.max_seeks_for_key = 4294967296;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967296
-SET @@global.max_seeks_for_key = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967296
-SET @@global.max_seeks_for_key = test;
-ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-4294967296
-SET @@session.max_seeks_for_key = 0;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-1
-SET @@session.max_seeks_for_key = -2;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-1
-SET @@session.max_seeks_for_key = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.max_seeks_for_key = 4294967296;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.max_seeks_for_key = test;
-ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-4294967296
-'#------------------FN_DYNVARS_083_06-----------------------#'
-SELECT @@global.max_seeks_for_key = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_seeks_for_key';
-@@global.max_seeks_for_key = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_083_07-----------------------#'
-SELECT @@session.max_seeks_for_key = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_seeks_for_key';
-@@session.max_seeks_for_key = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_083_08-----------------------#'
-SET @@global.max_seeks_for_key = TRUE;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-1
-SET @@global.max_seeks_for_key = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-1
-'#---------------------FN_DYNVARS_083_09----------------------#'
-SET @@global.max_seeks_for_key = 10;
-SELECT @@max_seeks_for_key = @@global.max_seeks_for_key;
-@@max_seeks_for_key = @@global.max_seeks_for_key
-0
-'#---------------------FN_DYNVARS_083_10----------------------#'
-SET @@max_seeks_for_key = 100;
-SELECT @@max_seeks_for_key = @@local.max_seeks_for_key;
-@@max_seeks_for_key = @@local.max_seeks_for_key
-1
-SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key;
-@@local.max_seeks_for_key = @@session.max_seeks_for_key
-1
-'#---------------------FN_DYNVARS_083_11----------------------#'
-SET max_seeks_for_key = 1;
-SELECT @@max_seeks_for_key;
-@@max_seeks_for_key
-1
-SELECT local.max_seeks_for_key;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.max_seeks_for_key;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT max_seeks_for_key = @@session.max_seeks_for_key;
-ERROR 42S22: Unknown column 'max_seeks_for_key' in 'field list'
-SET @@global.max_seeks_for_key = @start_global_value;
-SELECT @@global.max_seeks_for_key;
-@@global.max_seeks_for_key
-18446744073709551615
-SET @@session.max_seeks_for_key = @start_session_value;
-SELECT @@session.max_seeks_for_key;
-@@session.max_seeks_for_key
-18446744073709551615
diff --git a/mysql-test/r/max_tmp_tables_basic_64.result b/mysql-test/r/max_tmp_tables_basic_64.result
deleted file mode 100644
index 4b9f68c509e..00000000000
--- a/mysql-test/r/max_tmp_tables_basic_64.result
+++ /dev/null
@@ -1,187 +0,0 @@
-SET @start_global_value = @@global.max_tmp_tables;
-SELECT @start_global_value;
-@start_global_value
-32
-SET @start_session_value = @@session.max_tmp_tables;
-SELECT @start_session_value;
-@start_session_value
-32
-'#--------------------FN_DYNVARS_086_01-------------------------#'
-SET @@global.max_tmp_tables = 1000;
-SET @@global.max_tmp_tables = DEFAULT;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-32
-SET @@session.max_tmp_tables = 1000;
-SET @@session.max_tmp_tables = DEFAULT;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-32
-'#--------------------FN_DYNVARS_086_02-------------------------#'
-SET @@global.max_tmp_tables = DEFAULT;
-SELECT @@global.max_tmp_tables = 32;
-@@global.max_tmp_tables = 32
-1
-SET @@session.max_tmp_tables = DEFAULT;
-SELECT @@session.max_tmp_tables = 32;
-@@session.max_tmp_tables = 32
-1
-'#--------------------FN_DYNVARS_086_03-------------------------#'
-SET @@global.max_tmp_tables = 1;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = 2;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-2
-SET @@global.max_tmp_tables = 65536;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-65536
-SET @@global.max_tmp_tables = 4294967295;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@global.max_tmp_tables = 4294967294;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967294
-'#--------------------FN_DYNVARS_086_04-------------------------#'
-SET @@session.max_tmp_tables = 1;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-1
-SET @@session.max_tmp_tables = 2;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-2
-SET @@session.max_tmp_tables = 65536;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-65536
-SET @@session.max_tmp_tables = 4294967295;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = 4294967294;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967294
-'#------------------FN_DYNVARS_086_05-----------------------#'
-SET @@global.max_tmp_tables = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = 4294967296;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967296
-SET @@global.max_tmp_tables = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = 429496729500;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-429496729500
-SET @@global.max_tmp_tables = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-429496729500
-SET @@global.max_tmp_tables = test;
-ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-429496729500
-SET @@session.max_tmp_tables = 4294967296;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967296
-SET @@session.max_tmp_tables = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-1
-SET @@session.max_tmp_tables = 429496729500;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-429496729500
-SET @@session.max_tmp_tables = -001;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-1
-SET @@session.max_tmp_tables = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.max_tmp_tables = 10737418241;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-10737418241
-SET @@session.max_tmp_tables = test;
-ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-10737418241
-'#------------------FN_DYNVARS_086_06-----------------------#'
-SELECT @@global.max_tmp_tables = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_tmp_tables';
-@@global.max_tmp_tables = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_086_07-----------------------#'
-SELECT @@session.max_tmp_tables = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_tmp_tables';
-@@session.max_tmp_tables = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_086_08-----------------------#'
-SET @@global.max_tmp_tables = TRUE;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_tmp_tables value: '0'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-'#---------------------FN_DYNVARS_086_09----------------------#'
-SET @@global.max_tmp_tables = 20;
-SELECT @@max_tmp_tables = @@global.max_tmp_tables;
-@@max_tmp_tables = @@global.max_tmp_tables
-0
-'#---------------------FN_DYNVARS_086_10----------------------#'
-SET @@max_tmp_tables = 255;
-SELECT @@max_tmp_tables = @@local.max_tmp_tables;
-@@max_tmp_tables = @@local.max_tmp_tables
-1
-SELECT @@local.max_tmp_tables = @@session.max_tmp_tables;
-@@local.max_tmp_tables = @@session.max_tmp_tables
-1
-'#---------------------FN_DYNVARS_086_11----------------------#'
-SET max_tmp_tables = 102;
-SELECT @@max_tmp_tables;
-@@max_tmp_tables
-102
-SELECT local.max_tmp_tables;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.max_tmp_tables;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT max_tmp_tables = @@session.max_tmp_tables;
-ERROR 42S22: Unknown column 'max_tmp_tables' in 'field list'
-SET @@global.max_tmp_tables = @start_global_value;
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-32
-SET @@session.max_tmp_tables = @start_session_value;
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-32
diff --git a/mysql-test/r/max_write_lock_count_basic_64.result b/mysql-test/r/max_write_lock_count_basic_64.result
deleted file mode 100644
index d74586841dd..00000000000
--- a/mysql-test/r/max_write_lock_count_basic_64.result
+++ /dev/null
@@ -1,104 +0,0 @@
-SET @start_global_value = @@global.max_write_lock_count;
-SELECT @start_global_value;
-@start_global_value
-18446744073709551615
-'#--------------------FN_DYNVARS_088_01-------------------------#'
-SET @@global.max_write_lock_count = 1000;
-SET @@global.max_write_lock_count = DEFAULT;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-18446744073709551615
-'#--------------------FN_DYNVARS_088_02-------------------------#'
-SET @@global.max_write_lock_count = DEFAULT;
-SELECT @@global.max_write_lock_count = 4294967295;
-@@global.max_write_lock_count = 4294967295
-0
-'#--------------------FN_DYNVARS_088_03-------------------------#'
-SET @@global.max_write_lock_count = 1;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-1
-SET @@global.max_write_lock_count = 2;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-2
-SET @@global.max_write_lock_count = 65536;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-65536
-SET @@global.max_write_lock_count = 4294967295;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967295
-SET @@global.max_write_lock_count = 4294967294;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967294
-'#------------------FN_DYNVARS_088_04-----------------------#'
-SET @@global.max_write_lock_count = -1024;
-Warnings:
-Warning	1292	Truncated incorrect max_write_lock_count value: '0'
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-1
-SET @@global.max_write_lock_count = 4294967296;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-4294967296
-SET @@global.max_write_lock_count = -1;
-Warnings:
-Warning	1292	Truncated incorrect max_write_lock_count value: '0'
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-1
-SET @@global.max_write_lock_count = 429496729500;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-429496729500
-SET @@global.max_write_lock_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-429496729500
-SET @@global.max_write_lock_count = test;
-ERROR 42000: Incorrect argument type to variable 'max_write_lock_count'
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-429496729500
-'#------------------FN_DYNVARS_088_05-----------------------#'
-SELECT @@global.max_write_lock_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_write_lock_count';
-@@global.max_write_lock_count = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_088_06-----------------------#'
-SET @@global.max_write_lock_count = TRUE;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-1
-SET @@global.max_write_lock_count = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect max_write_lock_count value: '0'
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-1
-'#---------------------FN_DYNVARS_088_07----------------------#'
-SET @@global.max_write_lock_count = 20;
-SELECT @@max_write_lock_count = @@global.max_write_lock_count;
-@@max_write_lock_count = @@global.max_write_lock_count
-1
-'#---------------------FN_DYNVARS_088_08----------------------#'
-SET @@global.max_write_lock_count = 102;
-SELECT @@max_write_lock_count;
-@@max_write_lock_count
-102
-SELECT local.max_write_lock_count;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT global.max_write_lock_count;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT max_write_lock_count = @@global.max_write_lock_count;
-ERROR 42S22: Unknown column 'max_write_lock_count' in 'field list'
-SET @@global.max_write_lock_count = @start_global_value;
-SELECT @@global.max_write_lock_count;
-@@global.max_write_lock_count
-18446744073709551615
diff --git a/mysql-test/r/min_examined_row_limit_basic_64.result b/mysql-test/r/min_examined_row_limit_basic_64.result
deleted file mode 100644
index fa11659c6c5..00000000000
--- a/mysql-test/r/min_examined_row_limit_basic_64.result
+++ /dev/null
@@ -1,174 +0,0 @@
-SET @start_global_value = @@global.min_examined_row_limit;
-SELECT @start_global_value;
-@start_global_value
-0
-SET @start_session_value = @@session.min_examined_row_limit;
-SELECT @start_session_value;
-@start_session_value
-0
-'#--------------------FN_DYNVARS_089_01-------------------------#'
-SET @@global.min_examined_row_limit = 100;
-SET @@global.min_examined_row_limit = DEFAULT;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-0
-SET @@session.min_examined_row_limit = 200;
-SET @@session.min_examined_row_limit = DEFAULT;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-0
-'#--------------------FN_DYNVARS_089_02-------------------------#'
-SET @@global.min_examined_row_limit = DEFAULT;
-SELECT @@global.min_examined_row_limit = 0;
-@@global.min_examined_row_limit = 0
-1
-SET @@session.min_examined_row_limit = DEFAULT;
-SELECT @@session.min_examined_row_limit = 0;
-@@session.min_examined_row_limit = 0
-1
-'#--------------------FN_DYNVARS_089_03-------------------------#'
-SET @@global.min_examined_row_limit = 0;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-0
-SET @@global.min_examined_row_limit = 1;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-1
-SET @@global.min_examined_row_limit = 60020;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-60020
-SET @@global.min_examined_row_limit = 65535;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-65535
-SET @@global.min_examined_row_limit = 4294967295;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-4294967295
-SET @@global.min_examined_row_limit = 4294967294;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-4294967294
-'#--------------------FN_DYNVARS_089_04-------------------------#'
-SET @@session.min_examined_row_limit = 0;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-0
-SET @@session.min_examined_row_limit = 1;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-1
-SET @@session.min_examined_row_limit = 50050;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-50050
-SET @@session.min_examined_row_limit = 65535;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-65535
-SET @@session.min_examined_row_limit = 4294967295;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-4294967295
-SET @@session.min_examined_row_limit = 4294967294;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-4294967294
-'#------------------FN_DYNVARS_089_05-----------------------#'
-SET @@global.min_examined_row_limit = 429496726;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-429496726
-SET @@global.min_examined_row_limit = -1024;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-0
-SET @@global.min_examined_row_limit = 429496729500;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-429496729500
-SET @@global.min_examined_row_limit = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-429496729500
-SET @@global.min_examined_row_limit = test;
-ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-429496729500
-SET @@session.min_examined_row_limit = 4294967296;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-4294967296
-SET @@session.min_examined_row_limit = -1;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-0
-SET @@session.min_examined_row_limit = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.min_examined_row_limit = 4294967295021;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-4294967295021
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.min_examined_row_limit = test;
-ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-4294967295021
-'#------------------FN_DYNVARS_089_06-----------------------#'
-SELECT @@global.min_examined_row_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='min_examined_row_limit';
-@@global.min_examined_row_limit = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_089_07-----------------------#'
-SELECT @@session.min_examined_row_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='min_examined_row_limit';
-@@session.min_examined_row_limit = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_089_08-----------------------#'
-SET @@global.min_examined_row_limit = TRUE;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-1
-SET @@global.min_examined_row_limit = FALSE;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-0
-'#---------------------FN_DYNVARS_089_09----------------------#'
-SET @@global.min_examined_row_limit = 10;
-SELECT @@min_examined_row_limit = @@global.min_examined_row_limit;
-@@min_examined_row_limit = @@global.min_examined_row_limit
-0
-'#---------------------FN_DYNVARS_089_10----------------------#'
-SET @@min_examined_row_limit = 100;
-SELECT @@min_examined_row_limit = @@local.min_examined_row_limit;
-@@min_examined_row_limit = @@local.min_examined_row_limit
-1
-SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit;
-@@local.min_examined_row_limit = @@session.min_examined_row_limit
-1
-'#---------------------FN_DYNVARS_089_11----------------------#'
-SET min_examined_row_limit = 1;
-SELECT @@min_examined_row_limit;
-@@min_examined_row_limit
-1
-SELECT local.min_examined_row_limit;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.min_examined_row_limit;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT min_examined_row_limit = @@session.min_examined_row_limit;
-ERROR 42S22: Unknown column 'min_examined_row_limit' in 'field list'
-SET @@global.min_examined_row_limit = @start_global_value;
-SELECT @@global.min_examined_row_limit;
-@@global.min_examined_row_limit
-0
-SET @@session.min_examined_row_limit = @start_session_value;
-SELECT @@session.min_examined_row_limit;
-@@session.min_examined_row_limit
-0
diff --git a/mysql-test/r/multi_range_count_basic_64.result b/mysql-test/r/multi_range_count_basic_64.result
deleted file mode 100644
index f2115aec2e2..00000000000
--- a/mysql-test/r/multi_range_count_basic_64.result
+++ /dev/null
@@ -1,184 +0,0 @@
-SET @start_global_value = @@global.multi_range_count;
-SELECT @start_global_value;
-@start_global_value
-256
-SET @start_session_value = @@session.multi_range_count;
-SELECT @start_session_value;
-@start_session_value
-256
-'#--------------------FN_DYNVARS_090_01-------------------------#'
-SET @@global.multi_range_count = 100;
-SET @@global.multi_range_count = DEFAULT;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-256
-SET @@session.multi_range_count = 200;
-SET @@session.multi_range_count = DEFAULT;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-256
-'#--------------------FN_DYNVARS_090_02-------------------------#'
-SET @@global.multi_range_count = DEFAULT;
-SELECT @@global.multi_range_count = 256;
-@@global.multi_range_count = 256
-1
-SET @@session.multi_range_count = DEFAULT;
-SELECT @@session.multi_range_count = 256;
-@@session.multi_range_count = 256
-1
-'#--------------------FN_DYNVARS_090_03-------------------------#'
-SET @@global.multi_range_count = 1;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-1
-SET @@global.multi_range_count = 60020;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-60020
-SET @@global.multi_range_count = 65535;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-65535
-SET @@global.multi_range_count = 4294967295;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-4294967295
-SET @@global.multi_range_count = 4294967294;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-4294967294
-'#--------------------FN_DYNVARS_090_04-------------------------#'
-SET @@session.multi_range_count = 1;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-1
-SET @@session.multi_range_count = 50050;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-50050
-SET @@session.multi_range_count = 65535;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-65535
-SET @@session.multi_range_count = 4294967295;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-4294967295
-SET @@session.multi_range_count = 4294967294;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-4294967294
-'#------------------FN_DYNVARS_090_05-----------------------#'
-SET @@global.multi_range_count = 0;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-1
-SET @@global.multi_range_count = 4294967296;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-4294967296
-SET @@global.multi_range_count = -1024;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-1
-SET @@global.multi_range_count = 429496729500;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-429496729500
-SET @@global.multi_range_count = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'multi_range_count'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-429496729500
-SET @@global.multi_range_count = test;
-ERROR 42000: Incorrect argument type to variable 'multi_range_count'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-429496729500
-SET @@session.multi_range_count = 0;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-1
-SET @@session.multi_range_count = 4294967296;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-4294967296
-SET @@session.multi_range_count = -1;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-1
-SET @@session.multi_range_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.multi_range_count = 4294967295021;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-4294967295021
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.multi_range_count = test;
-ERROR 42000: Incorrect argument type to variable 'multi_range_count'
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-4294967295021
-'#------------------FN_DYNVARS_090_06-----------------------#'
-SELECT @@global.multi_range_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='multi_range_count';
-@@global.multi_range_count = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_090_07-----------------------#'
-SELECT @@session.multi_range_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='multi_range_count';
-@@session.multi_range_count = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_090_08-----------------------#'
-SET @@global.multi_range_count = TRUE;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-1
-SET @@global.multi_range_count = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect multi_range_count value: '0'
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-1
-'#---------------------FN_DYNVARS_090_09----------------------#'
-SET @@global.multi_range_count = 10;
-SELECT @@multi_range_count = @@global.multi_range_count;
-@@multi_range_count = @@global.multi_range_count
-0
-'#---------------------FN_DYNVARS_090_10----------------------#'
-SET @@multi_range_count = 100;
-SELECT @@multi_range_count = @@local.multi_range_count;
-@@multi_range_count = @@local.multi_range_count
-1
-SELECT @@local.multi_range_count = @@session.multi_range_count;
-@@local.multi_range_count = @@session.multi_range_count
-1
-'#---------------------FN_DYNVARS_090_11----------------------#'
-SET multi_range_count = 1;
-SELECT @@multi_range_count;
-@@multi_range_count
-1
-SELECT local.multi_range_count;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.multi_range_count;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT multi_range_count = @@session.multi_range_count;
-ERROR 42S22: Unknown column 'multi_range_count' in 'field list'
-SET @@global.multi_range_count = @start_global_value;
-SELECT @@global.multi_range_count;
-@@global.multi_range_count
-256
-SET @@session.multi_range_count = @start_session_value;
-SELECT @@session.multi_range_count;
-@@session.multi_range_count
-256
diff --git a/mysql-test/r/myisam_max_sort_file_size_basic_64.result b/mysql-test/r/myisam_max_sort_file_size_basic_64.result
deleted file mode 100644
index 00ff1dfc1ab..00000000000
--- a/mysql-test/r/myisam_max_sort_file_size_basic_64.result
+++ /dev/null
@@ -1,114 +0,0 @@
-SET @start_global_value = @@global.myisam_max_sort_file_size;
-SELECT @start_global_value;
-@start_global_value
-9223372036854775807
-'#--------------------FN_DYNVARS_094_01-------------------------#'
-SET @@global.myisam_max_sort_file_size = 500000;
-SET @@global.myisam_max_sort_file_size = DEFAULT;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-9223372036853727232
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_094_02-------------------------#'
-SET @@global.myisam_max_sort_file_size = DEFAULT;
-SELECT @@global.myisam_max_sort_file_size = 2147483648;
-@@global.myisam_max_sort_file_size = 2147483648
-0
-'#--------------------FN_DYNVARS_094_03-------------------------#'
-SET @@global.myisam_max_sort_file_size = 0;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = 1024;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = 123456789;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-122683392
-SET @@global.myisam_max_sort_file_size = 2147483648*2;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-4294967296
-SET @@global.myisam_max_sort_file_size = 2147483648*1024;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-2199023255552
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-2199023255552
-SET @@global.myisam_max_sort_file_size = 2147483648*2147483648;
-'#--------------------FN_DYNVARS_094_04-------------------------#'
-SET @@myisam_max_sort_file_size = 2;
-ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.myisam_max_sort_file_size = 3;
-ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@local.myisam_max_sort_file_size = 4;
-ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
-'#------------------FN_DYNVARS_094_05-----------------------#'
-SET @@global.myisam_max_sort_file_size = -1;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = -2147483648;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = -2147483649;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = 2147483649.56;
-ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = 1G;
-ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-'#------------------FN_DYNVARS_094_06-----------------------#'
-SET @@global.myisam_max_sort_file_size = 3000;
-SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='myisam_max_sort_file_size';
-@@global.myisam_max_sort_file_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_094_07-----------------------#'
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='myisam_max_sort_file_size';
-count(VARIABLE_VALUE)
-1
-'#------------------FN_DYNVARS_094_08-----------------------#'
-SET @@global.myisam_max_sort_file_size = TRUE;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-SET @@global.myisam_max_sort_file_size = FALSE;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-0
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.myisam_max_sort_file_size = 512;
-SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size;
-@@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET myisam_max_sort_file_size = 2048;
-ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT myisam_max_sort_file_size;
-ERROR 42S22: Unknown column 'myisam_max_sort_file_size' in 'field list'
-SELECT @@myisam_max_sort_file_size;
-@@myisam_max_sort_file_size
-0
-SET global myisam_max_sort_file_size = 64;
-SET @@global.myisam_max_sort_file_size = @start_global_value;
-SELECT @@global.myisam_max_sort_file_size;
-@@global.myisam_max_sort_file_size
-9223372036853727232
diff --git a/mysql-test/r/myisam_repair_threads_basic_64.result b/mysql-test/r/myisam_repair_threads_basic_64.result
deleted file mode 100644
index 8271451cc9e..00000000000
--- a/mysql-test/r/myisam_repair_threads_basic_64.result
+++ /dev/null
@@ -1,178 +0,0 @@
-SET @start_global_value = @@global.myisam_repair_threads;
-SELECT @start_global_value;
-@start_global_value
-1
-SET @start_session_value = @@session.myisam_repair_threads;
-SELECT @start_session_value;
-@start_session_value
-1
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.myisam_repair_threads  = 100;
-SET @@global.myisam_repair_threads  = DEFAULT;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = 200;
-SET @@session.myisam_repair_threads  = DEFAULT;
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.myisam_repair_threads  = DEFAULT;
-SELECT @@global.myisam_repair_threads  = 1;
-@@global.myisam_repair_threads  = 1
-1
-SET @@session.myisam_repair_threads  = DEFAULT;
-SELECT @@session.myisam_repair_threads  = 1;
-@@session.myisam_repair_threads  = 1
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.myisam_repair_threads  = 1;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@global.myisam_repair_threads  = 4294967295;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-4294967295
-SET @@global.myisam_repair_threads  = 655354;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-655354
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.myisam_repair_threads  = 1;
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = 4294967295;
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-4294967295
-SET @@session.myisam_repair_threads  = 655345;
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-655345
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.myisam_repair_threads  = 0;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@global.myisam_repair_threads  = -1024;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@global.myisam_repair_threads  = 429496729533;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-429496729533
-SET @@global.myisam_repair_threads  = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-429496729533
-SET @@global.myisam_repair_threads  = test;
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-429496729533
-SET @@global.myisam_repair_threads  = "test";
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-429496729533
-SET @@global.myisam_repair_threads  = 'test';
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-429496729533
-SET @@global.myisam_repair_threads  = ON;
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-429496729533
-SET @@session.myisam_repair_threads  = 0;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = -2;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = test;
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = "test";
-ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.myisam_repair_threads  = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='myisam_repair_threads ';
-@@global.myisam_repair_threads  = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.myisam_repair_threads  = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='myisam_repair_threads ';
-@@session.myisam_repair_threads  = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_08-----------------------#'
-SET @@global.myisam_repair_threads  = TRUE;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@global.myisam_repair_threads  = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.myisam_repair_threads  = 10;
-SELECT @@myisam_repair_threads  = @@global.myisam_repair_threads ;
-@@myisam_repair_threads  = @@global.myisam_repair_threads
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@myisam_repair_threads  = 100;
-SELECT @@myisam_repair_threads  = @@local.myisam_repair_threads ;
-@@myisam_repair_threads  = @@local.myisam_repair_threads
-1
-SELECT @@local.myisam_repair_threads  = @@session.myisam_repair_threads ;
-@@local.myisam_repair_threads  = @@session.myisam_repair_threads
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET myisam_repair_threads  = 1;
-SELECT @@myisam_repair_threads ;
-@@myisam_repair_threads
-1
-SELECT local.myisam_repair_threads ;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.myisam_repair_threads ;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT myisam_repair_threads  = @@session.myisam_repair_threads ;
-ERROR 42S22: Unknown column 'myisam_repair_threads' in 'field list'
-SET @@global.myisam_repair_threads  = @start_global_value;
-SELECT @@global.myisam_repair_threads ;
-@@global.myisam_repair_threads
-1
-SET @@session.myisam_repair_threads  = @start_session_value;
-SELECT @@session.myisam_repair_threads ;
-@@session.myisam_repair_threads
-1
diff --git a/mysql-test/r/myisam_sort_buffer_size_basic_64.result b/mysql-test/r/myisam_sort_buffer_size_basic_64.result
deleted file mode 100644
index bfcada76a46..00000000000
--- a/mysql-test/r/myisam_sort_buffer_size_basic_64.result
+++ /dev/null
@@ -1,182 +0,0 @@
-SET @start_global_value = @@global.myisam_sort_buffer_size ;
-SELECT @start_global_value;
-@start_global_value
-8388608
-SET @start_session_value = @@session.myisam_sort_buffer_size ;
-SELECT @start_session_value;
-@start_session_value
-8388608
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.myisam_sort_buffer_size   = 100;
-SET @@global.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-8388608
-SET @@session.myisam_sort_buffer_size   = 200;
-SET @@session.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-8388608
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size   = 8388608;
-@@global.myisam_sort_buffer_size   = 8388608
-1
-SET @@session.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size   = 8388608;
-@@session.myisam_sort_buffer_size   = 8388608
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.myisam_sort_buffer_size   = 4;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size   = 4294967295;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4294967295
-SET @@global.myisam_sort_buffer_size   = 655354;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-655354
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.myisam_sort_buffer_size   = 4;
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size   = 4294967295;
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4294967295
-SET @@session.myisam_sort_buffer_size   = 655345;
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-655345
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.myisam_sort_buffer_size   = 0;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size   = -1024;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size   = 429496729533;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-429496729533
-SET @@global.myisam_sort_buffer_size   = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-429496729533
-SET @@global.myisam_sort_buffer_size   = test;
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-429496729533
-SET @@global.myisam_sort_buffer_size   = "test";
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-429496729533
-SET @@global.myisam_sort_buffer_size   = 'test';
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-429496729533
-SET @@global.myisam_sort_buffer_size   = ON;
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-429496729533
-SET @@session.myisam_sort_buffer_size   = 0;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size   = -2;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size   = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size   = test;
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-SET @@session.myisam_sort_buffer_size   = "test";
-ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-4
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.myisam_sort_buffer_size   = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
-@@global.myisam_sort_buffer_size   = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.myisam_sort_buffer_size   = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
-@@session.myisam_sort_buffer_size   = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_08-----------------------#'
-SET @@global.myisam_sort_buffer_size   = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '1'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4
-SET @@global.myisam_sort_buffer_size   = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-4
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.myisam_sort_buffer_size   = 10;
-SELECT @@myisam_sort_buffer_size   = @@global.myisam_sort_buffer_size  ;
-@@myisam_sort_buffer_size   = @@global.myisam_sort_buffer_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@myisam_sort_buffer_size   = 100;
-SELECT @@myisam_sort_buffer_size   = @@local.myisam_sort_buffer_size  ;
-@@myisam_sort_buffer_size   = @@local.myisam_sort_buffer_size
-1
-SELECT @@local.myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
-@@local.myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET myisam_sort_buffer_size   = 1;
-Warnings:
-Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '1'
-SELECT @@myisam_sort_buffer_size  ;
-@@myisam_sort_buffer_size
-4
-SELECT local.myisam_sort_buffer_size  ;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.myisam_sort_buffer_size  ;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
-ERROR 42S22: Unknown column 'myisam_sort_buffer_size' in 'field list'
-SET @@global.myisam_sort_buffer_size   = @start_global_value;
-SELECT @@global.myisam_sort_buffer_size  ;
-@@global.myisam_sort_buffer_size
-8388608
-SET @@session.myisam_sort_buffer_size   = @start_session_value;
-SELECT @@session.myisam_sort_buffer_size  ;
-@@session.myisam_sort_buffer_size
-8388608
diff --git a/mysql-test/r/net_retry_count_basic_64.result b/mysql-test/r/net_retry_count_basic_64.result
deleted file mode 100644
index db133d23f79..00000000000
--- a/mysql-test/r/net_retry_count_basic_64.result
+++ /dev/null
@@ -1,184 +0,0 @@
-SET @start_global_value = @@global.net_retry_count;
-SELECT @start_global_value;
-@start_global_value
-10
-SET @start_session_value = @@session.net_retry_count;
-SELECT @start_session_value;
-@start_session_value
-10
-'#--------------------FN_DYNVARS_111_01-------------------------#'
-SET @@global.net_retry_count = 100;
-SET @@global.net_retry_count = DEFAULT;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-10
-SET @@session.net_retry_count = 200;
-SET @@session.net_retry_count = DEFAULT;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-10
-'#--------------------FN_DYNVARS_111_02-------------------------#'
-SET @@global.net_retry_count = DEFAULT;
-SELECT @@global.net_retry_count = 10;
-@@global.net_retry_count = 10
-1
-SET @@session.net_retry_count = DEFAULT;
-SELECT @@session.net_retry_count = 10;
-@@session.net_retry_count = 10
-1
-'#--------------------FN_DYNVARS_111_03-------------------------#'
-SET @@global.net_retry_count = 1;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-1
-SET @@global.net_retry_count = 2;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-2
-SET @@global.net_retry_count = 4294967295;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-4294967295
-SET @@global.net_retry_count = 4294967294;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-4294967294
-SET @@global.net_retry_count = 65536;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-65536
-'#--------------------FN_DYNVARS_111_04-------------------------#'
-SET @@session.net_retry_count = 1;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-1
-SET @@session.net_retry_count = 2;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-2
-SET @@session.net_retry_count = 65535;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-65535
-SET @@session.net_retry_count = 4294967295;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-4294967295
-SET @@session.net_retry_count = 4294967294;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-4294967294
-'#------------------FN_DYNVARS_111_05-----------------------#'
-SET @@global.net_retry_count = 0;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-1
-SET @@global.net_retry_count = -1024;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-1
-SET @@global.net_retry_count = 4294967296;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-4294967296
-SET @@global.net_retry_count = 429496729500;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-429496729500
-SET @@global.net_retry_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-429496729500
-SET @@global.net_retry_count = test;
-ERROR 42000: Incorrect argument type to variable 'net_retry_count'
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-429496729500
-SET @@session.net_retry_count = 0;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-1
-SET @@session.net_retry_count = -2;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-1
-SET @@session.net_retry_count = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.net_retry_count = 6555015425;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-6555015425
-SET @@session.net_retry_count = 4294967296;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.net_retry_count = test;
-ERROR 42000: Incorrect argument type to variable 'net_retry_count'
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-4294967296
-'#------------------FN_DYNVARS_111_06-----------------------#'
-SELECT @@global.net_retry_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='net_retry_count';
-@@global.net_retry_count = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_111_07-----------------------#'
-SELECT @@session.net_retry_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='net_retry_count';
-@@session.net_retry_count = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_111_08-----------------------#'
-SET @@global.net_retry_count = TRUE;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-1
-SET @@global.net_retry_count = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect net_retry_count value: '0'
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-1
-'#---------------------FN_DYNVARS_111_09----------------------#'
-SET @@global.net_retry_count = 10;
-SELECT @@net_retry_count = @@global.net_retry_count;
-@@net_retry_count = @@global.net_retry_count
-0
-'#---------------------FN_DYNVARS_111_10----------------------#'
-SET @@net_retry_count = 100;
-SELECT @@net_retry_count = @@local.net_retry_count;
-@@net_retry_count = @@local.net_retry_count
-1
-SELECT @@local.net_retry_count = @@session.net_retry_count;
-@@local.net_retry_count = @@session.net_retry_count
-1
-'#---------------------FN_DYNVARS_111_11----------------------#'
-SET net_retry_count = 1;
-SELECT @@net_retry_count;
-@@net_retry_count
-1
-SELECT local.net_retry_count;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.net_retry_count;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT net_retry_count = @@session.net_retry_count;
-ERROR 42S22: Unknown column 'net_retry_count' in 'field list'
-SET @@global.net_retry_count = @start_global_value;
-SELECT @@global.net_retry_count;
-@@global.net_retry_count
-10
-SET @@session.net_retry_count = @start_session_value;
-SELECT @@session.net_retry_count;
-@@session.net_retry_count
-10
diff --git a/mysql-test/r/query_alloc_block_size_basic_64.result b/mysql-test/r/query_alloc_block_size_basic_64.result
deleted file mode 100644
index 57c96a8168a..00000000000
--- a/mysql-test/r/query_alloc_block_size_basic_64.result
+++ /dev/null
@@ -1,199 +0,0 @@
-SET @start_global_value = @@global.query_alloc_block_size;
-SELECT @start_global_value;
-@start_global_value
-8192
-SET @start_session_value = @@session.query_alloc_block_size;
-SELECT @start_session_value;
-@start_session_value
-8192
-'#--------------------FN_DYNVARS_130_01-------------------------#'
-SET @@global.query_alloc_block_size = 10000;
-SET @@global.query_alloc_block_size = DEFAULT;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-8192
-SET @@session.query_alloc_block_size = 20000;
-SET @@session.query_alloc_block_size = DEFAULT;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-8192
-'#--------------------FN_DYNVARS_130_02-------------------------#'
-SET @@global.query_alloc_block_size = DEFAULT;
-SELECT @@global.query_alloc_block_size = 8192;
-@@global.query_alloc_block_size = 8192
-1
-SET @@session.query_alloc_block_size = DEFAULT;
-SELECT @@session.query_alloc_block_size = 8192;
-@@session.query_alloc_block_size = 8192
-1
-'#--------------------FN_DYNVARS_130_03-------------------------#'
-SET @@global.query_alloc_block_size = 1024;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = 1025;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = 4294967295;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-4294966272
-SET @@global.query_alloc_block_size = 4294967294;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-4294966272
-SET @@global.query_alloc_block_size = 65536;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-65536
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_130_04-------------------------#'
-SET @@session.query_alloc_block_size = 1024;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-1024
-SET @@session.query_alloc_block_size = 1025;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-1024
-SET @@session.query_alloc_block_size = 4294967295;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-4294966272
-SET @@session.query_alloc_block_size = 4294967294;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-4294966272
-SET @@session.query_alloc_block_size = 655536;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-655360
-'#------------------FN_DYNVARS_130_05-----------------------#'
-SET @@global.query_alloc_block_size = 64;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '64'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = -1;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = 1023;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '1023'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = 4294967296;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-4294967296
-SET @@global.query_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-4294967296
-SET @@global.query_alloc_block_size = test;
-ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-4294967296
-SET @@session.query_alloc_block_size = 64;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '64'
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-1024
-SET @@session.query_alloc_block_size = -2;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-1024
-SET @@session.query_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.query_alloc_block_size = 1023;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '1023'
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-1024
-SET @@session.query_alloc_block_size = 4294967296;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.query_alloc_block_size = test;
-ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-4294967296
-'#------------------FN_DYNVARS_130_06-----------------------#'
-'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement';
-SET @@global.query_alloc_block_size = 1;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '1'
-SET @@session.query_alloc_block_size = 12;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '12'
-SELECT @@global.query_alloc_block_size = 
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_alloc_block_size';
-@@global.query_alloc_block_size = 
-VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_130_07-----------------------#'
-SELECT @@session.query_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='query_alloc_block_size';
-@@session.query_alloc_block_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_130_08-----------------------#'
-SET @@global.query_alloc_block_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '1'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-SET @@global.query_alloc_block_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-1024
-'#---------------------FN_DYNVARS_130_09----------------------#'
-SET @@global.query_alloc_block_size = 2048;
-SELECT @@query_alloc_block_size = @@global.query_alloc_block_size;
-@@query_alloc_block_size = @@global.query_alloc_block_size
-0
-'#---------------------FN_DYNVARS_130_10----------------------#'
-SET @@query_alloc_block_size = 5000;
-SELECT @@query_alloc_block_size = @@local.query_alloc_block_size;
-@@query_alloc_block_size = @@local.query_alloc_block_size
-1
-SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size;
-@@local.query_alloc_block_size = @@session.query_alloc_block_size
-1
-'#---------------------FN_DYNVARS_130_11----------------------#'
-SET query_alloc_block_size = 1024;
-SELECT @@query_alloc_block_size;
-@@query_alloc_block_size
-1024
-SELECT local.query_alloc_block_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.query_alloc_block_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT query_alloc_block_size = @@session.query_alloc_block_size;
-ERROR 42S22: Unknown column 'query_alloc_block_size' in 'field list'
-SET @@global.query_alloc_block_size = @start_global_value;
-SELECT @@global.query_alloc_block_size;
-@@global.query_alloc_block_size
-8192
-SET @@session.query_alloc_block_size = @start_session_value;
-SELECT @@session.query_alloc_block_size;
-@@session.query_alloc_block_size
-8192
diff --git a/mysql-test/r/query_cache_limit_basic_64.result b/mysql-test/r/query_cache_limit_basic_64.result
deleted file mode 100644
index a592883ef91..00000000000
--- a/mysql-test/r/query_cache_limit_basic_64.result
+++ /dev/null
@@ -1,120 +0,0 @@
-SET @start_value = @@global.query_cache_limit;
-SELECT @start_value;
-@start_value
-1048576
-'#--------------------FN_DYNVARS_131_01------------------------#'
-SET @@global.query_cache_limit = 99;
-SET @@global.query_cache_limit = DEFAULT;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1048576
-'#---------------------FN_DYNVARS_131_02-------------------------#'
-SET @@global.query_cache_limit = @start_value;
-SELECT @@global.query_cache_limit = 1048576;
-@@global.query_cache_limit = 1048576
-1
-'#--------------------FN_DYNVARS_131_03------------------------#'
-SET @@global.query_cache_limit = 0;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-0
-SET @@global.query_cache_limit = 1;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1
-SET @@global.query_cache_limit = 1048576;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1048576
-SET @@global.query_cache_limit = 1048575;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1048575
-'#--------------------FN_DYNVARS_131_04-------------------------#'
-SET @@global.query_cache_limit = -1;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-0
-SET @@global.query_cache_limit = 4294967296;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-4294967296
-SET @@global.query_cache_limit = 10240022115;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-10240022115
-SET @@global.query_cache_limit = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-10240022115
-SET @@global.query_cache_limit = -1024;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-0
-SET @@global.query_cache_limit = 42949672950;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-42949672950
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.query_cache_limit = ON;
-ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-42949672950
-SET @@global.query_cache_limit = 'test';
-ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-42949672950
-'#-------------------FN_DYNVARS_131_05----------------------------#'
-SET @@session.query_cache_limit = 0;
-ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_limit;
-@@query_cache_limit
-42949672950
-'#----------------------FN_DYNVARS_131_06------------------------#'
-SELECT @@global.query_cache_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_limit';
-@@global.query_cache_limit = VARIABLE_VALUE
-1
-SELECT @@query_cache_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_limit';
-@@query_cache_limit = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_131_07----------------------#'
-SET @@global.query_cache_limit = TRUE;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1
-SET @@global.query_cache_limit = FALSE;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-0
-'#---------------------FN_DYNVARS_131_08----------------------#'
-SET @@global.query_cache_limit = 1;
-SELECT @@query_cache_limit = @@global.query_cache_limit;
-@@query_cache_limit = @@global.query_cache_limit
-1
-'#---------------------FN_DYNVARS_131_09----------------------#'
-SET query_cache_limit = 1;
-ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_limit;
-@@query_cache_limit
-1
-SET local.query_cache_limit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1
-SELECT local.query_cache_limit;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.query_cache_limit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1
-SELECT global.query_cache_limit;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT query_cache_limit = @@session.query_cache_limit;
-ERROR 42S22: Unknown column 'query_cache_limit' in 'field list'
-SET @@global.query_cache_limit = @start_value;
-SELECT @@global.query_cache_limit;
-@@global.query_cache_limit
-1048576
diff --git a/mysql-test/r/query_cache_min_res_unit_basic_64.result b/mysql-test/r/query_cache_min_res_unit_basic_64.result
deleted file mode 100644
index e1c74d2bbc1..00000000000
--- a/mysql-test/r/query_cache_min_res_unit_basic_64.result
+++ /dev/null
@@ -1,130 +0,0 @@
-SET @start_value = @@global.query_cache_min_res_unit;
-SELECT @start_value;
-@start_value
-4096
-'#--------------------FN_DYNVARS_132_01------------------------#'
-SET @@global.query_cache_min_res_unit = 99;
-SET @@global.query_cache_min_res_unit = DEFAULT;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-4096
-'#---------------------FN_DYNVARS_132_02-------------------------#'
-SET @@global.query_cache_min_res_unit = @start_value;
-SELECT @@global.query_cache_min_res_unit = 4096;
-@@global.query_cache_min_res_unit = 4096
-1
-'#--------------------FN_DYNVARS_132_03------------------------#'
-SET @@global.query_cache_min_res_unit = 0;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = 1;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512';
-SET @@global.query_cache_min_res_unit = 512;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = 513;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-520
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.query_cache_min_res_unit = 1048576;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-1048576
-SET @@global.query_cache_min_res_unit = 1048575;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-1048576
-'#--------------------FN_DYNVARS_132_04-------------------------#'
-SET @@global.query_cache_min_res_unit = -1;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = 4294967296;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-4294967296
-SET @@global.query_cache_min_res_unit = 511;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = -1024;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = 42949672950;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-42949672952
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.query_cache_min_res_unit = ON;
-ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-42949672952
-SET @@global.query_cache_min_res_unit = 'test';
-ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-42949672952
-'#-------------------FN_DYNVARS_132_05----------------------------#'
-SET @@session.query_cache_min_res_unit = 0;
-ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_min_res_unit;
-@@query_cache_min_res_unit
-42949672952
-'#----------------------FN_DYNVARS_132_06------------------------#'
-SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_min_res_unit';
-@@global.query_cache_min_res_unit = VARIABLE_VALUE
-1
-SELECT @@query_cache_min_res_unit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_min_res_unit';
-@@query_cache_min_res_unit = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_132_07----------------------#'
-SET @@global.query_cache_min_res_unit = TRUE;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-SET @@global.query_cache_min_res_unit = FALSE;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-512
-'#---------------------FN_DYNVARS_132_08----------------------#'
-SET @@global.query_cache_min_res_unit = 1;
-SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit;
-@@query_cache_min_res_unit = @@global.query_cache_min_res_unit
-1
-'#---------------------FN_DYNVARS_132_09----------------------#'
-SET query_cache_min_res_unit = 1;
-ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_min_res_unit;
-@@query_cache_min_res_unit
-512
-SET local.query_cache_min_res_unit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1
-SELECT local.query_cache_min_res_unit;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.query_cache_min_res_unit = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1
-SELECT global.query_cache_min_res_unit;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit;
-ERROR 42S22: Unknown column 'query_cache_min_res_unit' in 'field list'
-SET @@global.query_cache_min_res_unit = @start_value;
-SELECT @@global.query_cache_min_res_unit;
-@@global.query_cache_min_res_unit
-4096
diff --git a/mysql-test/r/query_cache_size_basic_64.result b/mysql-test/r/query_cache_size_basic_64.result
deleted file mode 100644
index 0d67eec1ccc..00000000000
--- a/mysql-test/r/query_cache_size_basic_64.result
+++ /dev/null
@@ -1,134 +0,0 @@
-SET @start_value = @@global.query_cache_size;
-SELECT @start_value;
-@start_value
-0
-'#--------------------FN_DYNVARS_133_01------------------------#'
-SET @@global.query_cache_size = 99;
-SET @@global.query_cache_size = DEFAULT;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-'#---------------------FN_DYNVARS_133_02-------------------------#'
-SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size = 0;
-@@global.query_cache_size = 0
-1
-'#--------------------FN_DYNVARS_133_03------------------------#'
-SET @@global.query_cache_size = 0;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 1;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 512;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 1024;
-Warnings:
-Warning	1282	Query cache failed to set size 1024; new query cache size is 0
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-: 'Bug#34880: Warnings are coming on assinging valid values to variable
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.query_cache_size = 1048576;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-1048576
-SET @@global.query_cache_size = 1048575;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-1047552
-'#--------------------FN_DYNVARS_133_04-------------------------#'
-SET @@global.query_cache_size = -1;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 4294967296;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-4294967296
-SET @@global.query_cache_size = 511;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'query_cache_size'
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = -1024;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 42949672950;
-Warnings:
-Warning	1282	Query cache failed to set size 42949671936; new query cache size is 0
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.query_cache_size = ON;
-ERROR 42000: Incorrect argument type to variable 'query_cache_size'
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'query_cache_size'
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-'#-------------------FN_DYNVARS_133_05----------------------------#'
-SET @@session.query_cache_size = 0;
-ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_size;
-@@query_cache_size
-0
-'#----------------------FN_DYNVARS_133_06------------------------#'
-SELECT @@global.query_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_size';
-@@global.query_cache_size = VARIABLE_VALUE
-1
-SELECT @@query_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='query_cache_size';
-@@query_cache_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_133_07----------------------#'
-SET @@global.query_cache_size = TRUE;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-SET @@global.query_cache_size = FALSE;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
-'#---------------------FN_DYNVARS_133_08----------------------#'
-SET @@global.query_cache_size = 1;
-SELECT @@query_cache_size = @@global.query_cache_size;
-@@query_cache_size = @@global.query_cache_size
-1
-'#---------------------FN_DYNVARS_133_09----------------------#'
-SET query_cache_size = 1;
-ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@query_cache_size;
-@@query_cache_size
-0
-SET local.query_cache_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1
-SELECT local.query_cache_size;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.query_cache_size = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1
-SELECT global.query_cache_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT query_cache_size = @@session.query_cache_size;
-ERROR 42S22: Unknown column 'query_cache_size' in 'field list'
-SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size;
-@@global.query_cache_size
-0
diff --git a/mysql-test/r/query_prealloc_size_basic_64.result b/mysql-test/r/query_prealloc_size_basic_64.result
deleted file mode 100644
index fe8aba990a7..00000000000
--- a/mysql-test/r/query_prealloc_size_basic_64.result
+++ /dev/null
@@ -1,178 +0,0 @@
-SET @start_global_value = @@global.query_prealloc_size ;
-SELECT @start_global_value;
-@start_global_value
-8192
-SET @start_session_value = @@session.query_prealloc_size ;
-SELECT @start_session_value;
-@start_session_value
-8192
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.query_prealloc_size   = 100;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '100'
-SET @@global.query_prealloc_size   = DEFAULT;
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = 200;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '200'
-SET @@session.query_prealloc_size   = DEFAULT;
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.query_prealloc_size   = DEFAULT;
-SELECT @@global.query_prealloc_size   = 8192;
-@@global.query_prealloc_size   = 8192
-1
-SET @@session.query_prealloc_size   = DEFAULT;
-SELECT @@session.query_prealloc_size   = 8192;
-@@session.query_prealloc_size   = 8192
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.query_prealloc_size   = 8192;
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = 655354;
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-654336
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.query_prealloc_size   = 8192;
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = 655345;
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-654336
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.query_prealloc_size   = 0;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '0'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = -1024;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '0'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = test;
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = "test";
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = 'test';
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = ON;
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = 0;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '0'
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = -2;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '0'
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = test;
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = "test";
-ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.query_prealloc_size   = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='query_prealloc_size  ';
-@@global.query_prealloc_size   = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.query_prealloc_size   = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='query_prealloc_size  ';
-@@session.query_prealloc_size   = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_08-----------------------#'
-SET @@global.query_prealloc_size   = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '1'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@global.query_prealloc_size   = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '0'
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.query_prealloc_size   = 10;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '10'
-SELECT @@query_prealloc_size   = @@global.query_prealloc_size  ;
-@@query_prealloc_size   = @@global.query_prealloc_size
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@query_prealloc_size   = 100;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '100'
-SELECT @@query_prealloc_size   = @@local.query_prealloc_size  ;
-@@query_prealloc_size   = @@local.query_prealloc_size
-1
-SELECT @@local.query_prealloc_size   = @@session.query_prealloc_size  ;
-@@local.query_prealloc_size   = @@session.query_prealloc_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET query_prealloc_size   = 1;
-Warnings:
-Warning	1292	Truncated incorrect query_prealloc_size value: '1'
-SELECT @@query_prealloc_size  ;
-@@query_prealloc_size
-8192
-SELECT local.query_prealloc_size  ;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.query_prealloc_size  ;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT query_prealloc_size   = @@session.query_prealloc_size  ;
-ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list'
-SET @@global.query_prealloc_size   = @start_global_value;
-SELECT @@global.query_prealloc_size  ;
-@@global.query_prealloc_size
-8192
-SET @@session.query_prealloc_size   = @start_session_value;
-SELECT @@session.query_prealloc_size  ;
-@@session.query_prealloc_size
-8192
diff --git a/mysql-test/r/range_alloc_block_size_basic_64.result b/mysql-test/r/range_alloc_block_size_basic_64.result
deleted file mode 100644
index 26ddfdd2bae..00000000000
--- a/mysql-test/r/range_alloc_block_size_basic_64.result
+++ /dev/null
@@ -1,178 +0,0 @@
-SET @start_global_value = @@global.range_alloc_block_size;
-SELECT @start_global_value;
-@start_global_value
-4096
-SET @start_session_value = @@session.range_alloc_block_size;
-SELECT @start_session_value;
-@start_session_value
-4096
-'#--------------------FN_DYNVARS_137_01-------------------------#'
-SET @@global.range_alloc_block_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '100'
-SET @@global.range_alloc_block_size = DEFAULT;
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-SET @@session.range_alloc_block_size = 200;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '200'
-SET @@session.range_alloc_block_size = DEFAULT;
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4096
-'#--------------------FN_DYNVARS_137_02-------------------------#'
-SET @@global.range_alloc_block_size = DEFAULT;
-SELECT @@global.range_alloc_block_size = 2048;
-@@global.range_alloc_block_size = 2048
-0
-SET @@session.range_alloc_block_size = DEFAULT;
-SELECT @@session.range_alloc_block_size = 2048;
-@@session.range_alloc_block_size = 2048
-0
-'#--------------------FN_DYNVARS_137_03-------------------------#'
-SET @@global.range_alloc_block_size = 2048;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '2048'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.range_alloc_block_size = 4294967295;
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4294966272
-SET @@global.range_alloc_block_size = 4294967294;
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_137_04-------------------------#'
-SET @@session.range_alloc_block_size = 2048;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '2048'
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4096
-SET @@session.range_alloc_block_size = 4294967295;
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4294966272
-SET @@session.range_alloc_block_size = 4294967294;
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4294966272
-'#------------------FN_DYNVARS_137_05-----------------------#'
-SET @@global.range_alloc_block_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-SET @@global.range_alloc_block_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-SET @@global.range_alloc_block_size = 42949672951;
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-42949671936
-SET @@global.range_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-42949671936
-SET @@global.range_alloc_block_size = test;
-ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-42949671936
-SET @@session.range_alloc_block_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4096
-SET @@session.range_alloc_block_size = -2;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4096
-SET @@session.range_alloc_block_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.range_alloc_block_size = 4294967296;
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.range_alloc_block_size = test;
-ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4294967296
-'#------------------FN_DYNVARS_137_06-----------------------#'
-SELECT @@global.range_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='range_alloc_block_size';
-@@global.range_alloc_block_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_137_07-----------------------#'
-SELECT @@session.range_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='range_alloc_block_size';
-@@session.range_alloc_block_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_137_08-----------------------#'
-SET @@global.range_alloc_block_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '1'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-SET @@global.range_alloc_block_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-'#---------------------FN_DYNVARS_137_09----------------------#'
-SET @@global.range_alloc_block_size = 10;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '10'
-SELECT @@range_alloc_block_size = @@global.range_alloc_block_size;
-@@range_alloc_block_size = @@global.range_alloc_block_size
-0
-'#---------------------FN_DYNVARS_137_10----------------------#'
-SET @@range_alloc_block_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '100'
-SELECT @@range_alloc_block_size = @@local.range_alloc_block_size;
-@@range_alloc_block_size = @@local.range_alloc_block_size
-1
-SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size;
-@@local.range_alloc_block_size = @@session.range_alloc_block_size
-1
-'#---------------------FN_DYNVARS_137_11----------------------#'
-SET range_alloc_block_size = 1;
-Warnings:
-Warning	1292	Truncated incorrect range_alloc_block_size value: '1'
-SELECT @@range_alloc_block_size;
-@@range_alloc_block_size
-4096
-SELECT local.range_alloc_block_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.range_alloc_block_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT range_alloc_block_size = @@session.range_alloc_block_size;
-ERROR 42S22: Unknown column 'range_alloc_block_size' in 'field list'
-SET @@global.range_alloc_block_size = @start_global_value;
-SELECT @@global.range_alloc_block_size;
-@@global.range_alloc_block_size
-4096
-SET @@session.range_alloc_block_size = @start_session_value;
-SELECT @@session.range_alloc_block_size;
-@@session.range_alloc_block_size
-4096
diff --git a/mysql-test/r/rpl_recovery_rank_basic_64.result b/mysql-test/r/rpl_recovery_rank_basic_64.result
deleted file mode 100644
index d4dd46eba71..00000000000
--- a/mysql-test/r/rpl_recovery_rank_basic_64.result
+++ /dev/null
@@ -1,110 +0,0 @@
-SET @start_global_value = @@global.rpl_recovery_rank;
-SELECT @start_global_value;
-@start_global_value
-0
-'#--------------------FN_DYNVARS_142_01-------------------------#'
-SET @@global.rpl_recovery_rank = 500000;
-SET @@global.rpl_recovery_rank = DEFAULT;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-'#--------------------FN_DYNVARS_142_02-------------------------#'
-SET @@global.rpl_recovery_rank = 0;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = 1024;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-1024
-SET @@global.rpl_recovery_rank = 123456789;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-123456789
-SET @@global.rpl_recovery_rank = 2147483648*2;
-Warnings:
-Warning	1292	Truncated incorrect rpl-recovery-rank value: '4294967296'
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-SET @@global.rpl_recovery_rank = 2147483648*1024;
-Warnings:
-Warning	1292	Truncated incorrect rpl-recovery-rank value: '2199023255552'
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-SET @@global.rpl_recovery_rank = 2147483648*2147483648;
-Warnings:
-Warning	1292	Truncated incorrect rpl-recovery-rank value: '4611686018427387904'
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-4294967295
-'#--------------------FN_DYNVARS_142_03-------------------------#'
-SET @@rpl_recovery_rank = 2;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.rpl_recovery_rank = 3;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@local.rpl_recovery_rank = 4;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-'#------------------FN_DYNVARS_142_04-----------------------#'
-SET @@global.rpl_recovery_rank = -1;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = -2147483648;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = -2147483649;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-SET @@global.rpl_recovery_rank = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@global.rpl_recovery_rank = 2147483649.56;
-ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
-SET @@global.rpl_recovery_rank = 1G;
-ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
-'#------------------FN_DYNVARS_142_05-----------------------#'
-SET @@global.rpl_recovery_rank = 3000;
-SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-@@global.rpl_recovery_rank = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_142_06-----------------------#'
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-count(VARIABLE_VALUE)
-1
-'#------------------FN_DYNVARS_142_07-----------------------#'
-SET @@global.rpl_recovery_rank = TRUE;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-1
-SET @@global.rpl_recovery_rank = FALSE;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
-'#---------------------FN_DYNVARS_001_08----------------------#'
-SET @@global.rpl_recovery_rank = 512;
-SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
-@@rpl_recovery_rank = @@global.rpl_recovery_rank
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET rpl_recovery_rank = 2048;
-ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT rpl_recovery_rank;
-ERROR 42S22: Unknown column 'rpl_recovery_rank' in 'field list'
-SELECT @@rpl_recovery_rank;
-@@rpl_recovery_rank
-512
-SET global rpl_recovery_rank = 64;
-SET @@global.rpl_recovery_rank = @start_global_value;
-SELECT @@global.rpl_recovery_rank;
-@@global.rpl_recovery_rank
-0
diff --git a/mysql-test/r/server_id_basic_64.result b/mysql-test/r/server_id_basic_64.result
deleted file mode 100644
index b6f3095ccfe..00000000000
--- a/mysql-test/r/server_id_basic_64.result
+++ /dev/null
@@ -1,115 +0,0 @@
-SET @@global.general_log= 0;
-SET @start_global_value = @@global.server_id;
-SELECT @start_global_value;
-@start_global_value
-1
-'#--------------------FN_DYNVARS_144_01-------------------------#'
-SET @@global.server_id = 500000;
-SET @@global.server_id = DEFAULT;
-SELECT @@global.server_id;
-@@global.server_id
-0
-'#--------------------FN_DYNVARS_144_02-------------------------#'
-SET @@global.server_id = DEFAULT;
-SELECT @@global.server_id = 0;
-@@global.server_id = 0
-1
-'#--------------------FN_DYNVARS_144_03-------------------------#'
-SET @@global.server_id = 0;
-SELECT @@global.server_id;
-@@global.server_id
-0
-SET @@global.server_id = 1;
-SELECT @@global.server_id;
-@@global.server_id
-1
-SET @@global.server_id = 15;
-SELECT @@global.server_id;
-@@global.server_id
-15
-SET @@global.server_id = 1024;
-SELECT @@global.server_id;
-@@global.server_id
-1024
-SET @@global.server_id = 123456789;
-SELECT @@global.server_id;
-@@global.server_id
-123456789
-SET @@global.server_id = 2147483648;
-SELECT @@global.server_id;
-@@global.server_id
-2147483648
-SET @@global.server_id = 2147483648*2-1;
-SELECT @@global.server_id;
-@@global.server_id
-4294967295
-'#--------------------FN_DYNVARS_144_04-------------------------#'
-SET @@server_id = 2;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.server_id = 3;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@local.server_id = 4;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-'#------------------FN_DYNVARS_144_05-----------------------#'
-SET @@global.server_id = -1;
-SELECT @@global.server_id;
-@@global.server_id
-0
-SET @@global.server_id = -2147483648;
-SELECT @@global.server_id;
-@@global.server_id
-0
-SET @@global.server_id = 2147483649*2;
-SELECT @@global.server_id;
-@@global.server_id
-4294967298
-SET @@global.server_id = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@global.server_id = '125';
-ERROR 42000: Incorrect argument type to variable 'server_id'
-SET @@global.server_id = 7483649.56;
-ERROR 42000: Incorrect argument type to variable 'server_id'
-SET @@global.server_id = 1G;
-ERROR 42000: Incorrect argument type to variable 'server_id'
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#------------------FN_DYNVARS_144_06-----------------------#'
-SET @@global.server_id = 3000;
-SELECT @@global.server_id = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='server_id';
-@@global.server_id = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_144_07-----------------------#'
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='server_id';
-count(VARIABLE_VALUE)
-1
-'#------------------FN_DYNVARS_144_08-----------------------#'
-SET @@global.server_id = TRUE;
-SELECT @@global.server_id;
-@@global.server_id
-1
-SET @@global.server_id = FALSE;
-SELECT @@global.server_id;
-@@global.server_id
-0
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.server_id = 512;
-SELECT @@server_id = @@global.server_id;
-@@server_id = @@global.server_id
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET server_id = 2048;
-ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT server_id;
-ERROR 42S22: Unknown column 'server_id' in 'field list'
-SELECT @@server_id;
-@@server_id
-512
-SET global server_id = 99;
-SET @@global.server_id = @start_global_value;
-SELECT @@global.server_id;
-@@global.server_id
-1
-SET @@global.general_log= 1;
diff --git a/mysql-test/r/slave_transaction_retries_basic_64.result b/mysql-test/r/slave_transaction_retries_basic_64.result
deleted file mode 100644
index 9434b14b238..00000000000
--- a/mysql-test/r/slave_transaction_retries_basic_64.result
+++ /dev/null
@@ -1,115 +0,0 @@
-SET @start_global_value = @@global.slave_transaction_retries;
-SELECT @start_global_value;
-@start_global_value
-10
-'#--------------------FN_DYNVARS_149_01-------------------------#'
-SET @@global.slave_transaction_retries = 50;
-SET @@global.slave_transaction_retries = DEFAULT;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-10
-'#--------------------FN_DYNVARS_149_02-------------------------#'
-SET @@global.slave_transaction_retries = DEFAULT;
-SELECT @@global.slave_transaction_retries = 10;
-@@global.slave_transaction_retries = 10
-1
-'#--------------------FN_DYNVARS_149_03-------------------------#'
-SET @@global.slave_transaction_retries = 0;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-0
-SET @@global.slave_transaction_retries = 1;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-1
-SET @@global.slave_transaction_retries = 15;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-15
-SET @@global.slave_transaction_retries = 1024;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-1024
-SET @@global.slave_transaction_retries = 2147483648;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-2147483648
-SET @@global.slave_transaction_retries = 2147483648*2-1;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-4294967295
-SET @@global.slave_transaction_retries = 2147483649*2;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-4294967298
-SET @@global.slave_transaction_retries = 4294967295;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-4294967295
-'#--------------------FN_DYNVARS_149_04-------------------------#'
-SET @@slave_transaction_retries = 2;
-ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@session.slave_transaction_retries = 3;
-ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
-SET @@local.slave_transaction_retries = 4;
-ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
-'#------------------FN_DYNVARS_149_05-----------------------#'
-SET @@global.slave_transaction_retries = -1;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-0
-SET @@global.slave_transaction_retries = 2147483649*2147483649;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-4611686022722355201
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.slave_transaction_retries = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@global.slave_transaction_retries = '100';
-ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
-SET @@global.slave_transaction_retries = 7483649.56;
-ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
-SET @@global.slave_transaction_retries = ON;
-ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
-SET @@global.slave_transaction_retries = OFF;
-ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
-'#------------------FN_DYNVARS_149_06-----------------------#'
-SET @@global.slave_transaction_retries = 3000;
-SELECT @@global.slave_transaction_retries = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='slave_transaction_retries';
-@@global.slave_transaction_retries = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_149_07-----------------------#'
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='slave_transaction_retries';
-count(VARIABLE_VALUE)
-1
-'#------------------FN_DYNVARS_149_08-----------------------#'
-SET @@global.slave_transaction_retries = TRUE;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-1
-SET @@global.slave_transaction_retries = FALSE;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-0
-'#---------------------FN_DYNVARS_149_09----------------------#'
-SET @@global.slave_transaction_retries = 60*60;
-SELECT @@slave_transaction_retries = @@global.slave_transaction_retries;
-@@slave_transaction_retries = @@global.slave_transaction_retries
-1
-'#---------------------FN_DYNVARS_149_10----------------------#'
-SET slave_transaction_retries = 2048;
-ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT slave_transaction_retries;
-ERROR 42S22: Unknown column 'slave_transaction_retries' in 'field list'
-SELECT @@slave_transaction_retries;
-@@slave_transaction_retries
-3600
-SET global slave_transaction_retries = 99;
-SET @@global.slave_transaction_retries = @start_global_value;
-SELECT @@global.slave_transaction_retries;
-@@global.slave_transaction_retries
-10
diff --git a/mysql-test/r/sort_buffer_size_basic_64.result b/mysql-test/r/sort_buffer_size_basic_64.result
deleted file mode 100644
index e9bd14abc67..00000000000
--- a/mysql-test/r/sort_buffer_size_basic_64.result
+++ /dev/null
@@ -1,189 +0,0 @@
-SET @start_global_value = @@global.sort_buffer_size;
-SELECT @start_global_value;
-@start_global_value
-262144
-SET @start_session_value = @@session.sort_buffer_size;
-SELECT @start_session_value;
-@start_session_value
-262144
-'#--------------------FN_DYNVARS_151_01-------------------------#'
-SET @@global.sort_buffer_size = 1000;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '1000'
-SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116
-1
-SET @@session.sort_buffer_size = 2000;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '2000'
-SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116
-1
-'#--------------------FN_DYNVARS_151_02-------------------------#'
-SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
-@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116
-1
-SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
-@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116
-1
-'#--------------------FN_DYNVARS_151_03-------------------------#'
-SET @@global.sort_buffer_size = 32776;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
-1
-SET @@global.sort_buffer_size = 32777;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804
-1
-SET @@global.sort_buffer_size = 4294967295;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-4294967295
-SET @@global.sort_buffer_size = 4294967294;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-4294967294
-'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
-'#--------------------FN_DYNVARS_151_04-------------------------#'
-SET @@session.sort_buffer_size = 32776;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32776'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
-1
-SET @@session.sort_buffer_size = 32777;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32777'
-SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804
-1
-SET @@session.sort_buffer_size = 4294967295;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967295
-SET @@session.sort_buffer_size = 4294967294;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967294
-'#------------------FN_DYNVARS_151_05-----------------------#'
-SET @@global.sort_buffer_size = 32775;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
-1
-SET @@global.sort_buffer_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
-1
-SET @@global.sort_buffer_size = 4294967296;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-4294967296
-SET @@global.sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-4294967296
-SET @@global.sort_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-4294967296
-SET @@session.sort_buffer_size = 32775;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '32775'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
-1
-SET @@session.sort_buffer_size = -2;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '0'
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
-1
-SET @@session.sort_buffer_size = 65530.34.;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
-SET @@session.sort_buffer_size = 4294967296;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967296
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.sort_buffer_size = test;
-ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-4294967296
-'#------------------FN_DYNVARS_151_06-----------------------#'
-SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
-@@global.sort_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_151_07-----------------------#'
-SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
-@@session.sort_buffer_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_151_08-----------------------#'
-SET @@global.sort_buffer_size = TRUE;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '1'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
-1
-SET @@global.sort_buffer_size = FALSE;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '0'
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
-1
-'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'
-'#---------------------FN_DYNVARS_151_09----------------------#'
-SET @@global.sort_buffer_size = 9000;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '9000'
-SELECT @@sort_buffer_size = @@global.sort_buffer_size;
-@@sort_buffer_size = @@global.sort_buffer_size
-0
-'#---------------------FN_DYNVARS_151_10----------------------#'
-SET @@sort_buffer_size = 9000;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '9000'
-SELECT @@sort_buffer_size = @@local.sort_buffer_size;
-@@sort_buffer_size = @@local.sort_buffer_size
-1
-SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
-@@local.sort_buffer_size = @@session.sort_buffer_size
-1
-'#---------------------FN_DYNVARS_151_11----------------------#'
-SET sort_buffer_size = 9100;
-Warnings:
-Warning	1292	Truncated incorrect sort_buffer_size value: '9100'
-SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
-@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804
-1
-SELECT @@sort_buffer_size;
-@@sort_buffer_size
-32804
-SELECT local.sort_buffer_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.sort_buffer_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT sort_buffer_size = @@session.sort_buffer_size;
-ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list'
-SET @@global.sort_buffer_size = @start_global_value;
-SELECT @@global.sort_buffer_size;
-@@global.sort_buffer_size
-262144
-SET @@session.sort_buffer_size = @start_session_value;
-SELECT @@session.sort_buffer_size;
-@@session.sort_buffer_size
-262144
diff --git a/mysql-test/r/sync_binlog_basic_64.result b/mysql-test/r/sync_binlog_basic_64.result
deleted file mode 100644
index ffd1b3fc4f1..00000000000
--- a/mysql-test/r/sync_binlog_basic_64.result
+++ /dev/null
@@ -1,105 +0,0 @@
-SET @start_value = @@global.sync_binlog;
-SELECT @start_value;
-@start_value
-0
-'#--------------------FN_DYNVARS_168_01------------------------#'
-SET @@global.sync_binlog = 99;
-SET @@global.sync_binlog = DEFAULT;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-'#---------------------FN_DYNVARS_168_02-------------------------#'
-SET @@global.sync_binlog = @start_value;
-SELECT @@global.sync_binlog = 0;
-@@global.sync_binlog = 0
-1
-'#--------------------FN_DYNVARS_168_03------------------------#'
-SET @@global.sync_binlog = 0;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-SET @@global.sync_binlog = 1;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-1
-SET @@global.sync_binlog = 4294967295;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967295
-SET @@global.sync_binlog = 4294967294;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967294
-SET @@global.sync_binlog = 65536;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-65536
-'#--------------------FN_DYNVARS_168_04-------------------------#'
-SET @@global.sync_binlog = -1;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-SET @@global.sync_binlog = 4294967296;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-4294967296
-SET @@global.sync_binlog = 10240022115;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-10240022115
-SET @@global.sync_binlog = 10000.01;
-ERROR 42000: Incorrect argument type to variable 'sync_binlog'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-10240022115
-SET @@global.sync_binlog = -1024;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
-SET @@global.sync_binlog = 42949672950;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-42949672950
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.sync_binlog = ON;
-ERROR 42000: Incorrect argument type to variable 'sync_binlog'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-42949672950
-SET @@global.sync_binlog = 'test';
-ERROR 42000: Incorrect argument type to variable 'sync_binlog'
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-42949672950
-'#-------------------FN_DYNVARS_168_05----------------------------#'
-SET @@session.sync_binlog = 0;
-ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@sync_binlog;
-@@sync_binlog
-42949672950
-'#----------------------FN_DYNVARS_168_06------------------------#'
-SELECT @@global.sync_binlog = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='sync_binlog';
-@@global.sync_binlog = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_168_07----------------------#'
-SET sync_binlog = 1;
-ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
-SELECT @@sync_binlog;
-@@sync_binlog
-42949672950
-SET local.sync_binlog = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
-SELECT local.sync_binlog;
-ERROR 42S02: Unknown table 'local' in field list
-SET global.sync_binlog = 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
-SELECT global.sync_binlog;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT sync_binlog = @@session.sync_binlog;
-ERROR 42S22: Unknown column 'sync_binlog' in 'field list'
-SET @@global.sync_binlog = @start_value;
-SELECT @@global.sync_binlog;
-@@global.sync_binlog
-0
diff --git a/mysql-test/r/timestamp_basic_64.result b/mysql-test/r/timestamp_basic_64.result
deleted file mode 100644
index df877cd455b..00000000000
--- a/mysql-test/r/timestamp_basic_64.result
+++ /dev/null
@@ -1,73 +0,0 @@
-SET @session_start_value = @@session.timestamp;
-'#--------------------FN_DYNVARS_001_01------------------------#'
-SET @@timestamp = DEFAULT;
-'timestamp does not have any DEFAULT value'
-'#---------------------FN_DYNVARS_001_02-------------------------#'
-SET @@global.timestamp = "1000";
-ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL
-'#--------------------FN_DYNVARS_001_03------------------------#'
-SET @@timestamp = 0;
-'Setting 0 resets timestamp to session default timestamp'
-SET @@timestamp = 123456789123456;
-SELECT @@timestamp;
-@@timestamp
-123456789123456
-SET @@timestamp = 60*60*60*60*365;
-SELECT @@timestamp;
-@@timestamp
-4730400000
-SET @@timestamp = -1000000000;
-SELECT @@timestamp;
-@@timestamp
-18446744072709551616
-SET @temp_ts = @@timestamp - @@timestamp;
-SELECT @temp_ts;
-@temp_ts
-0
-'#--------------------FN_DYNVARS_001_04-------------------------#'
-SET @@timestamp = "100";
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-'Bug# 34836: Documentation says its a string variable but infact its numeric'
-SET @@timestamp = " ";
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = 1.1;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = 9999999999999999999999;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-'#----------------------FN_DYNVARS_001_06------------------------#'
-SELECT @@timestamp = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='timestamp';
-@@timestamp = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_08-------------------------#'
-SET @@timestamp = OFF;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = ON;
-ERROR 42000: Incorrect argument type to variable 'timestamp'
-SET @@timestamp = TRUE;
-SELECT @@timestamp;
-@@timestamp
-1
-SET @@timestamp = FALSE;
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@timestamp = 123456;
-SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
-@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
-1
-SET @@timestamp = 654321;
-SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
-@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET timestamp = 1;
-SELECT @@timestamp;
-@@timestamp
-1
-SELECT local.timestamp;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.timestamp;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT timestamp = @@session.timestamp;
-ERROR 42S22: Unknown column 'timestamp' in 'field list'
-SET @@timestamp = @session_start_value;
diff --git a/mysql-test/r/tmp_table_size_basic_64.result b/mysql-test/r/tmp_table_size_basic_64.result
deleted file mode 100644
index 837b90fc143..00000000000
--- a/mysql-test/r/tmp_table_size_basic_64.result
+++ /dev/null
@@ -1,172 +0,0 @@
-SET @start_global_value = @@global.tmp_table_size;
-SELECT @start_global_value;
-@start_global_value
-16777216
-SET @start_session_value = @@session.tmp_table_size;
-SELECT @start_session_value;
-@start_session_value
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.tmp_table_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '100'
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-SET @@session.tmp_table_size = 200;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '200'
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size = 33554432;
-@@global.tmp_table_size = 33554432
-0
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size = 33554432;
-@@session.tmp_table_size = 33554432
-0
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.tmp_table_size = 1024;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = 60020;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-60020
-SET @@global.tmp_table_size = 4294967295;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-4294967295
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.tmp_table_size = 1024;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size =4294967295;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-4294967295
-SET @@session.tmp_table_size = 65535;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-65535
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.tmp_table_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = 1000;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '1000'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.tmp_table_size = ON;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size = True;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '1'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-SET @@global.tmp_table_size = False;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '0'
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-1024
-'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
-SET @@global.tmp_table_size = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@global.tmp_table_size ="Test";
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = ON;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = True;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '1'
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size = False;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '0'
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-1024
-SET @@session.tmp_table_size = "Test";
-ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
-SET @@session.tmp_table_size = 12345678901;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-12345678901
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.tmp_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='tmp_table_size';
-@@global.tmp_table_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.tmp_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='tmp_table_size';
-@@session.tmp_table_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.tmp_table_size = 1024;
-SET @@tmp_table_size = 4294967295;
-SELECT @@tmp_table_size = @@global.tmp_table_size;
-@@tmp_table_size = @@global.tmp_table_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@tmp_table_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect tmp_table_size value: '100'
-SELECT @@tmp_table_size = @@local.tmp_table_size;
-@@tmp_table_size = @@local.tmp_table_size
-1
-SELECT @@local.tmp_table_size = @@session.tmp_table_size;
-@@local.tmp_table_size = @@session.tmp_table_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET tmp_table_size = 1027;
-SELECT @@tmp_table_size;
-@@tmp_table_size
-1027
-SELECT local.tmp_table_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT global.tmp_table_size;
-ERROR 42S02: Unknown table 'global' in field list
-SELECT tmp_table_size = @@session.tmp_table_size;
-ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
-SET @@global.tmp_table_size = @start_global_value;
-SELECT @@global.tmp_table_size;
-@@global.tmp_table_size
-16777216
-SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.tmp_table_size;
-@@session.tmp_table_size
-16777216
diff --git a/mysql-test/r/transaction_alloc_block_size_basic_64.result b/mysql-test/r/transaction_alloc_block_size_basic_64.result
deleted file mode 100644
index c968d6f108c..00000000000
--- a/mysql-test/r/transaction_alloc_block_size_basic_64.result
+++ /dev/null
@@ -1,176 +0,0 @@
-SET @start_global_value = @@global.transaction_alloc_block_size;
-SELECT @start_global_value;
-@start_global_value
-8192
-SET @start_session_value = @@session.transaction_alloc_block_size;
-SELECT @start_session_value;
-@start_session_value
-8192
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.transaction_alloc_block_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '100'
-SET @@global.transaction_alloc_block_size = DEFAULT;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-8192
-SET @@session.transaction_alloc_block_size = 200;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '200'
-SET @@session.transaction_alloc_block_size = DEFAULT;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-8192
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.transaction_alloc_block_size = DEFAULT;
-SELECT @@global.transaction_alloc_block_size = 8192;
-@@global.transaction_alloc_block_size = 8192
-1
-SET @@session.transaction_alloc_block_size = DEFAULT;
-SELECT @@session.transaction_alloc_block_size = 8192;
-@@session.transaction_alloc_block_size = 8192
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.transaction_alloc_block_size = 1024;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = 60020;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-59392
-SET @@global.transaction_alloc_block_size = 4294967295;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-4294966272
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.transaction_alloc_block_size = 1024;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size =4294967295;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-4294966272
-SET @@session.transaction_alloc_block_size = 65535;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-64512
-'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.transaction_alloc_block_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = 123456789201;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-123456788480
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.transaction_alloc_block_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size = True;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = False;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@global.transaction_alloc_block_size = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size ="Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@global.transaction_alloc_block_size = 1000;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1000'
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size = 12345678901;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-12345678848
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@session.transaction_alloc_block_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@session.transaction_alloc_block_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@session.transaction_alloc_block_size = True;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size = False;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
-SET @@session.transaction_alloc_block_size = "Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-SET @@session.transaction_alloc_block_size = 'test';
-ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='transaction_alloc_block_size';
-@@global.transaction_alloc_block_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='transaction_alloc_block_size';
-@@session.transaction_alloc_block_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_08----------------------#'
-SET @@transaction_alloc_block_size = 1024;
-SET @@global.transaction_alloc_block_size = 4294967295;
-SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
-@@transaction_alloc_block_size = @@global.transaction_alloc_block_size
-0
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@transaction_alloc_block_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect transaction_alloc_block_size value: '100'
-SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size;
-@@transaction_alloc_block_size = @@local.transaction_alloc_block_size
-1
-SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size;
-@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size
-1
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET transaction_alloc_block_size = 1027;
-SELECT @@transaction_alloc_block_size;
-@@transaction_alloc_block_size
-1024
-SELECT local.transaction_alloc_block_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.transaction_alloc_block_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size;
-ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list'
-SET @@global.transaction_alloc_block_size = @start_global_value;
-SELECT @@global.transaction_alloc_block_size;
-@@global.transaction_alloc_block_size
-8192
-SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.transaction_alloc_block_size;
-@@session.transaction_alloc_block_size
-1024
diff --git a/mysql-test/r/transaction_prealloc_size_basic_64.result b/mysql-test/r/transaction_prealloc_size_basic_64.result
deleted file mode 100644
index 2fb6451372f..00000000000
--- a/mysql-test/r/transaction_prealloc_size_basic_64.result
+++ /dev/null
@@ -1,170 +0,0 @@
-SET @start_global_value = @@global.transaction_prealloc_size;
-SELECT @start_global_value;
-@start_global_value
-4096
-SET @start_session_value = @@session.transaction_prealloc_size;
-SELECT @start_session_value;
-@start_session_value
-4096
-'Bug# 34876: This variable has invalid default value as compared to documentation';
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.transaction_prealloc_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '100'
-SET @@global.transaction_prealloc_size = DEFAULT;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-4096
-SET @@session.transaction_prealloc_size = 200;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '200'
-SET @@session.transaction_prealloc_size = DEFAULT;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4096
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.transaction_prealloc_size = DEFAULT;
-SELECT @@global.transaction_prealloc_size = 4096;
-@@global.transaction_prealloc_size = 4096
-1
-SET @@session.transaction_prealloc_size = DEFAULT;
-SELECT @@session.transaction_prealloc_size = 4096;
-@@session.transaction_prealloc_size = 4096
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.transaction_prealloc_size = 1024;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = 60020;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-59392
-SET @@global.transaction_prealloc_size = 4294966272;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-4294966272
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.transaction_prealloc_size = 1024;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size =4294966272;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4294966272
-SET @@session.transaction_prealloc_size = 65535;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-64512
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.transaction_prealloc_size = 0;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = -1024;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.transaction_prealloc_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size = True;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '1'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = False;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@global.transaction_prealloc_size = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size ="Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@global.transaction_prealloc_size = 1000;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '1000'
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size = ON;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@session.transaction_prealloc_size = OFF;
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@session.transaction_prealloc_size = True;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '1'
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size = False;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-1024
-SET @@session.transaction_prealloc_size = "Test";
-ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
-SET @@session.transaction_prealloc_size = 123456789031;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-123456788480
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='transaction_prealloc_size';
-@@global.transaction_prealloc_size = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='transaction_prealloc_size';
-@@session.transaction_prealloc_size = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.transaction_prealloc_size = 1024;
-SET @@global.transaction_prealloc_size = 10;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '10'
-SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
-@@transaction_prealloc_size = @@global.transaction_prealloc_size
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@transaction_prealloc_size = 100;
-Warnings:
-Warning	1292	Truncated incorrect transaction_prealloc_size value: '100'
-SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size;
-@@transaction_prealloc_size = @@local.transaction_prealloc_size
-1
-SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size;
-@@local.transaction_prealloc_size = @@session.transaction_prealloc_size
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET transaction_prealloc_size = 1027;
-SELECT @@transaction_prealloc_size;
-@@transaction_prealloc_size
-1024
-SELECT local.transaction_prealloc_size;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.transaction_prealloc_size;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT transaction_prealloc_size = @@session.transaction_prealloc_size;
-ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list'
-SET @@global.transaction_prealloc_size = @start_global_value;
-SELECT @@global.transaction_prealloc_size;
-@@global.transaction_prealloc_size
-4096
-SET @@session.transaction_prealloc_size = @start_session_value;
-SELECT @@session.transaction_prealloc_size;
-@@session.transaction_prealloc_size
-4096
diff --git a/mysql-test/r/wait_timeout_basic_64.result b/mysql-test/r/wait_timeout_basic_64.result
deleted file mode 100644
index ae03e677e56..00000000000
--- a/mysql-test/r/wait_timeout_basic_64.result
+++ /dev/null
@@ -1,129 +0,0 @@
-SET @start_global_value = @@global.wait_timeout;
-SET @start_session_value = @@session.wait_timeout;
-'#--------------------FN_DYNVARS_005_01-------------------------#'
-SET @@global.wait_timeout = 100;
-SET @@global.wait_timeout = DEFAULT;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-28800
-SET @@session.wait_timeout = 200;
-SET @@session.wait_timeout = DEFAULT;
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-28800
-'#--------------------FN_DYNVARS_005_02-------------------------#'
-SET @@global.wait_timeout = DEFAULT;
-SELECT @@global.wait_timeout = @default_wait_timeout;
-@@global.wait_timeout = @default_wait_timeout
-1
-SET @@session.wait_timeout = DEFAULT;
-SELECT @@session.wait_timeout = @default_wait_timeout;
-@@session.wait_timeout = @default_wait_timeout
-1
-'#--------------------FN_DYNVARS_005_03-------------------------#'
-SET @@global.wait_timeout= 1;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-1
-SET @@global.wait_timeout = 60020;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-60020
-SET @@global.wait_timeout = 31536000;
-SELECT @@global.wait_timeout = @max_wait_timeout;
-@@global.wait_timeout = @max_wait_timeout
-1
-'#--------------------FN_DYNVARS_005_04-------------------------#'
-SET @@session.wait_timeout =6000;
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-6000
-'#------------------FN_DYNVARS_005_05-----------------------#'
-SET @@global.wait_timeout = 0;
-Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '0'
-SET @@global.wait_timeout = -1024;
-Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '0'
-'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-SET @@global.wait_timeout = ON;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@global.wait_timeout = OFF;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@global.wait_timeout = True;
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-1
-SET @@global.wait_timeout = False;
-Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '0'
-SELECT @@global.wait_timeout;
-@@global.wait_timeout
-1
-SET @@global.wait_timeout = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@global.wait_timeout ="Test";
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = ON;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = OFF;
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = True;
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-1
-SET @@session.wait_timeout = False;
-Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '0'
-SELECT @@session.wait_timeout;
-@@session.wait_timeout
-1
-SET @@session.wait_timeout = "Test";
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = 'test';
-ERROR 42000: Incorrect argument type to variable 'wait_timeout'
-SET @@session.wait_timeout = 123456789031;
-Warnings:
-Warning	1292	Truncated incorrect wait_timeout value: '123456789031'
-SELECT @@session.wait_timeout = @max_wait_timeout;
-@@session.wait_timeout = @max_wait_timeout
-1
-'#------------------FN_DYNVARS_005_06-----------------------#'
-SELECT @@global.wait_timeout = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='wait_timeout';
-@@global.wait_timeout = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_005_07-----------------------#'
-SELECT @@session.wait_timeout = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='wait_timeout';
-@@session.wait_timeout = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_001_09----------------------#'
-SET @@global.wait_timeout = 30000;
-SET @@global.wait_timeout = 40000;
-SELECT @@wait_timeout = @@global.wait_timeout;
-@@wait_timeout = @@global.wait_timeout
-0
-'#---------------------FN_DYNVARS_001_10----------------------#'
-SET @@wait_timeout = 100;
-SELECT @@wait_timeout = @@local.wait_timeout;
-@@wait_timeout = @@local.wait_timeout
-1
-SELECT @@local.wait_timeout = @@session.wait_timeout;
-@@local.wait_timeout = @@session.wait_timeout
-1
-'#---------------------FN_DYNVARS_001_11----------------------#'
-SET wait_timeout = 1027;
-SELECT @@wait_timeout;
-@@wait_timeout
-1027
-SELECT local.wait_timeout;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.wait_timeout;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT wait_timeout = @@session.wait_timeout;
-ERROR 42S22: Unknown column 'wait_timeout' in 'field list'
-SET @@global.wait_timeout = @start_global_value;
-SET @@session.wait_timeout = @start_session_value;

From 497c97905e73aa69fac0f1dfaeb4eb89a241e5b0 Mon Sep 17 00:00:00 2001
From: Horst Hunger <horst@mysql.com>
Date: Tue, 22 Jul 2008 18:56:50 +0200
Subject: [PATCH 06/33]

---
 .../include/binlog_cache_size_basic.inc       | 154 -----------
 .../include/bulk_insert_buffer_size_basic.inc | 203 --------------
 .../include/delayed_insert_limit_basic.inc    | 167 ------------
 .../include/delayed_queue_size_basic.inc      | 163 ------------
 .../innodb_concurrency_tickets_basic.inc      | 147 -----------
 .../include/innodb_max_purge_lag_basic.inc    | 147 -----------
 .../include/innodb_sync_spin_loops_basic.inc  | 142 ----------
 mysql-test/include/join_buffer_size_basic.inc | 216 ---------------
 mysql-test/include/key_buffer_size_basic.inc  | 187 -------------
 .../include/key_cache_age_threshold_basic.inc | 180 -------------
 .../include/key_cache_block_size_basic.inc    | 185 -------------
 .../key_cache_division_limit_basic.inc        | 184 -------------
 mysql-test/include/log_warnings_basic.inc     | 210 ---------------
 .../include/max_binlog_cache_size_basic.inc   | 187 -------------
 .../include/max_connect_errors_basic.inc      | 182 -------------
 .../include/max_heap_table_size_basic.inc     | 222 ----------------
 .../include/max_seeks_for_key_basic.inc       | 213 ---------------
 mysql-test/include/max_tmp_tables_basic.inc   | 227 ----------------
 .../include/max_write_lock_count_basic.inc    | 158 -----------
 .../include/min_examined_row_limit_basic.inc  | 219 ----------------
 .../include/multi_range_count_basic.inc       | 219 ----------------
 .../myisam_max_sort_file_size_basic.inc       | 184 -------------
 .../include/myisam_repair_threads_basic.inc   | 242 -----------------
 .../include/myisam_sort_buffer_size_basic.inc | 240 -----------------
 mysql-test/include/net_retry_count_basic.inc  | 217 ---------------
 .../include/query_alloc_block_size_basic.inc  | 225 ----------------
 .../include/query_cache_limit_basic.inc       | 178 -------------
 .../query_cache_min_res_unit_basic.inc        | 187 -------------
 mysql-test/include/query_cache_size_basic.inc | 175 -------------
 .../include/query_prealloc_size_basic.inc     | 247 ------------------
 .../include/range_alloc_block_size_basic.inc  | 208 ---------------
 .../include/rpl_recovery_rank_basic.inc       | 171 ------------
 mysql-test/include/server_id_basic.inc        | 190 --------------
 .../slave_transaction_retries_basic.inc       | 188 -------------
 mysql-test/include/sort_buffer_size_basic.inc | 213 ---------------
 mysql-test/include/sync_binlog_basic.inc      | 156 -----------
 mysql-test/include/timestamp_basic.inc        | 162 ------------
 mysql-test/include/tmp_table_size_basic.inc   | 233 -----------------
 .../transaction_alloc_block_size_basic.inc    | 240 -----------------
 .../transaction_prealloc_size_basic.inc       | 229 ----------------
 40 files changed, 7797 deletions(-)
 delete mode 100644 mysql-test/include/binlog_cache_size_basic.inc
 delete mode 100644 mysql-test/include/bulk_insert_buffer_size_basic.inc
 delete mode 100644 mysql-test/include/delayed_insert_limit_basic.inc
 delete mode 100644 mysql-test/include/delayed_queue_size_basic.inc
 delete mode 100644 mysql-test/include/innodb_concurrency_tickets_basic.inc
 delete mode 100644 mysql-test/include/innodb_max_purge_lag_basic.inc
 delete mode 100644 mysql-test/include/innodb_sync_spin_loops_basic.inc
 delete mode 100644 mysql-test/include/join_buffer_size_basic.inc
 delete mode 100644 mysql-test/include/key_buffer_size_basic.inc
 delete mode 100644 mysql-test/include/key_cache_age_threshold_basic.inc
 delete mode 100644 mysql-test/include/key_cache_block_size_basic.inc
 delete mode 100644 mysql-test/include/key_cache_division_limit_basic.inc
 delete mode 100644 mysql-test/include/log_warnings_basic.inc
 delete mode 100644 mysql-test/include/max_binlog_cache_size_basic.inc
 delete mode 100644 mysql-test/include/max_connect_errors_basic.inc
 delete mode 100644 mysql-test/include/max_heap_table_size_basic.inc
 delete mode 100644 mysql-test/include/max_seeks_for_key_basic.inc
 delete mode 100644 mysql-test/include/max_tmp_tables_basic.inc
 delete mode 100644 mysql-test/include/max_write_lock_count_basic.inc
 delete mode 100644 mysql-test/include/min_examined_row_limit_basic.inc
 delete mode 100644 mysql-test/include/multi_range_count_basic.inc
 delete mode 100644 mysql-test/include/myisam_max_sort_file_size_basic.inc
 delete mode 100644 mysql-test/include/myisam_repair_threads_basic.inc
 delete mode 100644 mysql-test/include/myisam_sort_buffer_size_basic.inc
 delete mode 100644 mysql-test/include/net_retry_count_basic.inc
 delete mode 100644 mysql-test/include/query_alloc_block_size_basic.inc
 delete mode 100644 mysql-test/include/query_cache_limit_basic.inc
 delete mode 100644 mysql-test/include/query_cache_min_res_unit_basic.inc
 delete mode 100644 mysql-test/include/query_cache_size_basic.inc
 delete mode 100644 mysql-test/include/query_prealloc_size_basic.inc
 delete mode 100644 mysql-test/include/range_alloc_block_size_basic.inc
 delete mode 100644 mysql-test/include/rpl_recovery_rank_basic.inc
 delete mode 100644 mysql-test/include/server_id_basic.inc
 delete mode 100644 mysql-test/include/slave_transaction_retries_basic.inc
 delete mode 100644 mysql-test/include/sort_buffer_size_basic.inc
 delete mode 100644 mysql-test/include/sync_binlog_basic.inc
 delete mode 100644 mysql-test/include/timestamp_basic.inc
 delete mode 100644 mysql-test/include/tmp_table_size_basic.inc
 delete mode 100644 mysql-test/include/transaction_alloc_block_size_basic.inc
 delete mode 100644 mysql-test/include/transaction_prealloc_size_basic.inc

diff --git a/mysql-test/include/binlog_cache_size_basic.inc b/mysql-test/include/binlog_cache_size_basic.inc
deleted file mode 100644
index 323e19c4d66..00000000000
--- a/mysql-test/include/binlog_cache_size_basic.inc
+++ /dev/null
@@ -1,154 +0,0 @@
-################# mysql-test\t\binlog_cache_size_basic.test ####################
-#                                                                              #
-# Variable Name: binlog_cache_size                                             #
-# Scope: GLOBAL                                                                #
-# Access Type: Dynamic                                                         #
-# Data Type: Numeric                                                           #
-# Default Value: 32768                                                         #
-# Range: 4096 - 4294967295                                                     #
-#                                                                              #
-#                                                                              #
-# Creation Date: 2008-04-28                                                    #
-# Author:  Salman Rawala/Horst Hunger                                          #
-#                                                                              #
-# Description: Test Cases of Dynamic System Variable "binlog_cache_size"       #
-#              that checks behavior of this variable in the following ways     #
-#              * Default Value                                                 #
-#              * Valid & Invalid values                                        #
-#              * Scope & Access method                                         #
-#              * Data Integrity                          .                     #
-#                                                                              #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
-#         server-system-variables.html#option_mysqld_binlog_cache_size         #
-#                                                                              #
-################################################################################
-
-#################################################################
-#           START OF binlog_cache_size TESTS                    #
-#################################################################
-
-#########################################################################
-# Saving initial value of binlog_cache_size in a temporary variable     #
-#########################################################################
-
-SET @start_value = @@global.binlog_cache_size;
-SELECT @start_value;
-
---echo '#--------------------FN_DYNVARS_006_01------------------------#'
-######################################################################### 
-#              Display the DEFAULT value of binlog_cache_size           #
-######################################################################### 
-
-SET @@global.binlog_cache_size = 100;
-SET @@global.binlog_cache_size = DEFAULT;
-SELECT @@global.binlog_cache_size;
-
-
---echo '#---------------------FN_DYNVARS_006_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.binlog_cache_size = @start_value;
-SELECT @@global.binlog_cache_size = 32768;
-
-
---echo '#--------------------FN_DYNVARS_006_03------------------------#'
-#########################################################################
-#        Change the value of binlog_cache_size to a valid value         #
-#########################################################################
-
-SET @@global.binlog_cache_size = 4096;
-SELECT @@global.binlog_cache_size;
-SET @@global.binlog_cache_size = 4294967295;
-SELECT @@global.binlog_cache_size;
-SET @@global.binlog_cache_size = 10000;
-SELECT @@global.binlog_cache_size;
-SET @@global.binlog_cache_size = 21221204;
-SELECT @@global.binlog_cache_size;
-echo 'Bug: Invalid values are coming in variable on assigning valid values';
-
-
---echo '#--------------------FN_DYNVARS_006_04-------------------------#'
-############################################################################
-#         Change the value of binlog_cache_size to invalid value           #
-############################################################################ 
-
-SET @@global.binlog_cache_size = 1024;
-SELECT @@global.binlog_cache_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.binlog_cache_size = 10000.01;
-SET @@global.binlog_cache_size = -1024;
-SELECT @@global.binlog_cache_size;
-SET @@global.binlog_cache_size = 42949672950;
-SELECT @@global.binlog_cache_size;
-echo 'Bug: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.binlog_cache_size = ON;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.binlog_cache_size = 'test';
-
-
---echo '#-------------------FN_DYNVARS_006_05----------------------------#'
-############################################################################
-#       Test if accessing session binlog_cache_size gives error            #
-############################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.binlog_cache_size = 0;
-
-
---echo '#----------------------FN_DYNVARS_006_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL Tables matches values in variable             #
-##############################################################################
-
-SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size';
-
---echo '#---------------------FN_DYNVARS_006_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.binlog_cache_size = TRUE;
-SELECT @@global.binlog_cache_size;
-SET @@global.binlog_cache_size = FALSE;
-SELECT @@global.binlog_cache_size;
-echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
-
---echo '#---------------------FN_DYNVARS_006_08----------------------#'
-###############################################################################
-#    Check if accessing variable without SCOPE points to same global variable #
-###############################################################################
-
-SET @@global.binlog_cache_size = 1;
-SELECT @@binlog_cache_size = @@global.binlog_cache_size;
-
---echo '#---------------------FN_DYNVARS_006_09----------------------#'
-###########################################################################
-#   Check if binlog_cache_size can be accessed with and without @@ sign   #
-###########################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET binlog_cache_size = 1;
---Error ER_PARSE_ERROR
-SET global.binlog_cache_size = 1;
---Error ER_UNKNOWN_TABLE
-SELECT global.binlog_cache_size;
---Error ER_BAD_FIELD_ERROR
-SELECT binlog_cache_size = @@session.binlog_cache_size;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.binlog_cache_size = @start_value;
-SELECT @@global.binlog_cache_size;
-
-
-###########################################################
-#              END OF binlog_cache_size TESTS             #
-###########################################################
diff --git a/mysql-test/include/bulk_insert_buffer_size_basic.inc b/mysql-test/include/bulk_insert_buffer_size_basic.inc
deleted file mode 100644
index 56ffbace173..00000000000
--- a/mysql-test/include/bulk_insert_buffer_size_basic.inc
+++ /dev/null
@@ -1,203 +0,0 @@
-############## mysql-test\t\bulk_insert_buffer_size_basic.test #################
-#                                                                              #
-# Variable Name: bulk_insert_buffer_size                                       #
-# Scope: GLOBAL & SESSION                                                      #
-# Access Type: Dynamic                                                         #
-# Data Type: Numeric                                                           #
-# Default Value: 8388608                                                       #
-# Range: 0 - 4294967295                                                        #
-#                                                                              #
-#                                                                              #
-# Creation Date: 2008-02-07                                                    #
-# Author:  Salman Rawala                                                       #
-#                                                                              #
-# Description: Test Cases of Dynamic System Variable "bulk_insert_buffer_size" #
-#              that checks behavior of this variable in the following ways     #
-#              * Default Value                                                 #
-#              * Valid & Invalid values                                        #
-#              * Scope & Access method                                         #
-#              * Data Integrity                          .                     #
-#                                                                              #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           # 
-#   server-system-variables.html#option_mysqld_bulk_insert_buffer_size         #
-#                                                                              #
-################################################################################
-
---source include/load_sysvars.inc
-
-#######################################################################
-#           START OF bulk_insert_buffer_size TESTS                    #
-#######################################################################
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.bulk_insert_buffer_size;
-SELECT @start_global_value;
-SET @start_session_value = @@session.bulk_insert_buffer_size;
-SELECT @start_session_value;
-
---echo '#--------------------FN_DYNVARS_007_01-------------------------#'
-#######################################################################
-#     Display the DEFAULT value of bulk_insert_buffer_size            #
-#######################################################################
-
-SET @@global.bulk_insert_buffer_size = 100;
-SET @@global.bulk_insert_buffer_size = DEFAULT;
-SELECT @@global.bulk_insert_buffer_size;
-
-SET @@session.bulk_insert_buffer_size = 200;
-SET @@session.bulk_insert_buffer_size = DEFAULT;
-SELECT @@session.bulk_insert_buffer_size;
-
-
---echo '#--------------------FN_DYNVARS_007_02-------------------------#'
-#######################################################################
-#     Check the DEFAULT value of bulk_insert_buffer_size              #
-#######################################################################
-
-SET @@global.bulk_insert_buffer_size = @start_global_value;
-SELECT @@global.bulk_insert_buffer_size = 8388608;
-
-SET @@session.bulk_insert_buffer_size = @start_session_value;
-SELECT @@session.bulk_insert_buffer_size = 8388608;
-
-
---echo '#--------------------FN_DYNVARS_007_03-------------------------#'
-###############################################################################
-#Change the value of bulk_insert_buffer_size to valid values for GLOBAL Scope #
-###############################################################################
-
-SET @@global.bulk_insert_buffer_size = 0;
-SELECT @@global.bulk_insert_buffer_size;
-SET @@global.bulk_insert_buffer_size = 1;
-SELECT @@global.bulk_insert_buffer_size;
-SET @@global.bulk_insert_buffer_size = 4294967295;
-SELECT @@global.bulk_insert_buffer_size;
-SET @@global.bulk_insert_buffer_size = 429496;
-SELECT @@global.bulk_insert_buffer_size;
-
-
---echo '#--------------------FN_DYNVARS_007_04-------------------------#'
-###############################################################################
-#Change the value of bulk_insert_buffer_size to valid values for SESSION Scope#
-###############################################################################
-
-SET @@session.bulk_insert_buffer_size = 0;
-SELECT @@session.bulk_insert_buffer_size;
-SET @@session.bulk_insert_buffer_size = 1;
-SELECT @@session.bulk_insert_buffer_size;
-SET @@session.bulk_insert_buffer_size = 4294967295;
-SELECT @@session.bulk_insert_buffer_size;
-SET @@session.bulk_insert_buffer_size = 429496;
-SELECT @@session.bulk_insert_buffer_size;
-
-
---echo '#------------------FN_DYNVARS_007_05-----------------------#'
-###################################################################
-# Change the value of bulk_insert_buffer_size to an invalid value #
-###################################################################
-
-SET @@global.bulk_insert_buffer_size = 42949672950;
-SELECT @@global.bulk_insert_buffer_size;
-SET @@global.bulk_insert_buffer_size = -1024;
-SELECT @@global.bulk_insert_buffer_size;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.bulk_insert_buffer_size = test;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.bulk_insert_buffer_size = ON;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.bulk_insert_buffer_size = 429496.10;
-
-SET @@session.bulk_insert_buffer_size = 42949672950;
-SELECT @@session.bulk_insert_buffer_size;
-SET @@session.bulk_insert_buffer_size = -2;
-SELECT @@session.bulk_insert_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.bulk_insert_buffer_size = test;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.bulk_insert_buffer_size = 429496.10;
-
-
---echo '#------------------FN_DYNVARS_007_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='bulk_insert_buffer_size';
-
---echo '#------------------FN_DYNVARS_007_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='bulk_insert_buffer_size';
-
-
---echo '#------------------FN_DYNVARS_007_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.bulk_insert_buffer_size = TRUE;
-SELECT @@global.bulk_insert_buffer_size;
-SET @@global.bulk_insert_buffer_size = FALSE;
-SELECT @@global.bulk_insert_buffer_size;
-
-SET @@session.bulk_insert_buffer_size = TRUE;
-SELECT @@session.bulk_insert_buffer_size;
-SET @@session.bulk_insert_buffer_size = FALSE;
-SELECT @@session.bulk_insert_buffer_size;
-
-
---echo '#---------------------FN_DYNVARS_007_09----------------------#'
-##############################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points #
-#    to same session variable                                                #
-##############################################################################
-
-SET @@bulk_insert_buffer_size = 100;
-SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size;
-SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
-
-
---echo '#---------------------FN_DYNVARS_007_10----------------------#'
-###############################################################################
-#   Check if bulk_insert_buffer_size can be accessed with and without @@ sign #
-###############################################################################
-
-SET bulk_insert_buffer_size = 1;
-SELECT @@bulk_insert_buffer_size;
---Error ER_PARSE_ERROR
-SET local.bulk_insert_buffer_size = 1;
---Error ER_UNKNOWN_TABLE
-SELECT local.bulk_insert_buffer_size;
---Error ER_PARSE_ERROR
-SET session.bulk_insert_buffer_size = 1;
---Error ER_UNKNOWN_TABLE
-SELECT session.bulk_insert_buffer_size;
---Error ER_BAD_FIELD_ERROR
-SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.bulk_insert_buffer_size = @start_global_value;
-SELECT @@global.bulk_insert_buffer_size;
-SET @@session.bulk_insert_buffer_size = @start_session_value;
-SELECT @@session.bulk_insert_buffer_size;
-
-
-####################################################
-#         END OF bulk_insert_buffer_size TESTS     #
-####################################################
diff --git a/mysql-test/include/delayed_insert_limit_basic.inc b/mysql-test/include/delayed_insert_limit_basic.inc
deleted file mode 100644
index ab158bc593e..00000000000
--- a/mysql-test/include/delayed_insert_limit_basic.inc
+++ /dev/null
@@ -1,167 +0,0 @@
-############### mysql-test\t\delayed_insert_limit_basic.test ###################
-#                                                                              #
-# Variable Name: delayed_insert_limit                                          #
-# Scope: GLOBAL                                                                #
-# Access Type: Dynamic                                                         #
-# Data Type: Numeric                                                           #
-# Default Value: 100                                                           #
-# Range: 1 - 4294967295                                                        #
-#                                                                              #
-#                                                                              #
-# Creation Date: 2008-02-07                                                    #
-# Author:  Salman Rawala                                                       #
-#                                                                              #
-# Description: Test Cases of Dynamic System Variable "delayed_insert_limit"    #
-#              that checks behavior of this variable in the following ways     #
-#              * Default Value                                                 #
-#              * Valid & Invalid values                                        #
-#              * Scope & Access method                                         #
-#              * Data Integrity                                                #
-#                                                                              #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
-#        server-system-variables.html#option_mysqld_delayed_insert_limit       #
-#                                                                              #
-################################################################################
-
---source include/load_sysvars.inc
-
-#################################################################
-#           START OF delayed_insert_limit TESTS                 #
-#################################################################
-
-#########################################################################
-# Saving initial value of delayed_insert_limit in a temporary variable  #
-#########################################################################
-
-SET @start_value = @@global.delayed_insert_limit;
-SELECT @start_value;
-
---echo '#--------------------FN_DYNVARS_024_01------------------------#'
-######################################################################### 
-#              Display the DEFAULT value of delayed_insert_limit        #
-######################################################################### 
-
-SET @@global.delayed_insert_limit = 100;
-SET @@global.delayed_insert_limit = DEFAULT;
-SELECT @@global.delayed_insert_limit;
-
-
---echo '#---------------------FN_DYNVARS_024_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.delayed_insert_limit = @start_value;
-SELECT @@global.delayed_insert_limit = 100;
-
-
---echo '#--------------------FN_DYNVARS_024_03------------------------#'
-#########################################################################
-#        Change the value of delayed_insert_limit to a valid value      #
-#########################################################################
-
-SET @@global.delayed_insert_limit = 10000;
-SELECT @@global.delayed_insert_limit;
-SET @@global.delayed_insert_limit = 4294967295;
-SELECT @@global.delayed_insert_limit;
-SET @@global.delayed_insert_limit = 1;
-SELECT @@global.delayed_insert_limit;
-
-
---echo '#--------------------FN_DYNVARS_024_04-------------------------#'
-############################################################################
-#         Change the value of delayed_insert_limit to invalid value        #
-############################################################################ 
-
-SET @@global.delayed_insert_limit = 0;
-SELECT @@global.delayed_insert_limit;
-SET @@global.delayed_insert_limit = -1024;
-SELECT @@global.delayed_insert_limit;
-SET @@global.delayed_insert_limit = 42949672950;
-SELECT @@global.delayed_insert_limit;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.delayed_insert_limit = 429496729.5;
-SELECT @@global.delayed_insert_limit;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.delayed_insert_limit = ON;
-SELECT @@global.delayed_insert_limit;
-
-
-
---echo '#-------------------FN_DYNVARS_024_05----------------------------#'
-############################################################################
-#       Test if accessing session delayed_insert_limit gives error         #
-############################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.delayed_insert_limit = 0;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@Session.delayed_insert_limit;
-
-
---echo '#----------------------FN_DYNVARS_024_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.delayed_insert_limit =
- VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-  WHERE VARIABLE_NAME='delayed_insert_limit';
-
-SELECT @@delayed_insert_limit =
- VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-  WHERE VARIABLE_NAME='delayed_insert_limit';
-
-
---echo '#---------------------FN_DYNVARS_024_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.delayed_insert_limit = TRUE;
-SELECT @@global.delayed_insert_limit;
-SET @@global.delayed_insert_limit = FALSE;
-SELECT @@global.delayed_insert_limit;
-
---echo '#---------------------FN_DYNVARS_024_08----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@global.delayed_insert_limit = 1;
-SELECT @@delayed_insert_limit = @@global.delayed_insert_limit;
-
-
---echo '#---------------------FN_DYNVARS_024_09----------------------#'
-##############################################################################
-#   Check if delayed_insert_limit can be accessed with and without @@ sign   #
-##############################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET delayed_insert_limit = 1;
-SELECT @@delayed_insert_limit;
---Error ER_PARSE_ERROR
-SET local.delayed_insert_limit = 1;
---Error ER_UNKNOWN_TABLE
-SELECT local.delayed_insert_limit;
---Error ER_PARSE_ERROR
-SET global.delayed_insert_limit = 1;
---Error ER_UNKNOWN_TABLE
-SELECT global.delayed_insert_limit;
---Error ER_BAD_FIELD_ERROR
-SELECT delayed_insert_limit = @@session.delayed_insert_limit;
-
-##############################
-#   Restore initial value    #
-##############################
-
-SET @@global.delayed_insert_limit = @start_value;
-SELECT @@global.delayed_insert_limit;
-
-
-###########################################################
-#           END OF delayed_insert_limit TESTS             #
-###########################################################
-
diff --git a/mysql-test/include/delayed_queue_size_basic.inc b/mysql-test/include/delayed_queue_size_basic.inc
deleted file mode 100644
index 2d16f75d4e1..00000000000
--- a/mysql-test/include/delayed_queue_size_basic.inc
+++ /dev/null
@@ -1,163 +0,0 @@
-################# mysql-test\t\delayed_queue_size_basic.test ###################
-#                                                                              #
-# Variable Name: delayed_queue_size                                            #
-# Scope: GLOBAL                                                                #
-# Access Type: Dynamic                                                         #
-# Data Type: Numeric                                                           #
-# Default Value: 1000                                                          #
-# Range: 1 - 4294967295                                                        #
-#                                                                              #
-#                                                                              #
-# Creation Date: 2008-02-07                                                    #
-# Author:  Salman Rawala                                                       #
-#                                                                              #
-# Description: Test Cases of Dynamic System Variable "delayed_queue_size"      #
-#              that checks behavior of this variable in the following ways     #
-#              * Default Value                                                 #
-#              * Valid & Invalid values                                        #
-#              * Scope & Access method                                         #
-#              * Data Integrity                          .                     #
-#                                                                              #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
-#        server-system-variables.html#option_mysqld_delayed_queue_size         #
-#                                                                              #
-################################################################################
-
---source include/load_sysvars.inc
-
-#################################################################
-#           START OF delayed_queue_size TESTS                   #
-#################################################################
-
-#########################################################################
-# Saving initial value of delayed_queue_size in a temporary variable    #
-#########################################################################
-
-SET @start_value = @@global.delayed_queue_size;
-SELECT @start_value;
-
---echo '#--------------------FN_DYNVARS_026_01------------------------#'
-######################################################################### 
-#              Display the DEFAULT value of delayed_queue_size          #
-######################################################################### 
-
-SET @@global.delayed_queue_size = 100;
-SET @@global.delayed_queue_size = DEFAULT;
-SELECT @@global.delayed_queue_size;
-
---echo '#---------------------FN_DYNVARS_026_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.delayed_queue_size = @start_value;
-SELECT @@global.delayed_queue_size = 1000;
-
---echo '#--------------------FN_DYNVARS_026_03------------------------#'
-#########################################################################
-#        Change the value of delayed_queue_size to a valid value        #
-#########################################################################
-
-SET @@global.delayed_queue_size = 10000;
-SELECT @@global.delayed_queue_size;
-SET @@global.delayed_queue_size = 4294967295;
-SELECT @@global.delayed_queue_size;
-SET @@global.delayed_queue_size = 1;
-SELECT @@global.delayed_queue_size;
-
-
---echo '#--------------------FN_DYNVARS_026_04-------------------------#'
-############################################################################
-#         Change the value of delayed_queue_size to invalid value          #
-############################################################################ 
-
-SET @@global.delayed_queue_size = 0;
-SELECT @@global.delayed_queue_size;
-SET @@global.delayed_queue_size = -1024;
-SELECT @@global.delayed_queue_size;
-SET @@global.delayed_queue_size = 42949672950;
-SELECT @@global.delayed_queue_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.delayed_queue_size = 429496729.5;
-SELECT @@global.delayed_queue_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.delayed_queue_size = ON;
-SELECT @@delayed_queue_size;
-
---echo '#-------------------FN_DYNVARS_026_05----------------------------#'
-############################################################################
-#       Test if accessing session delayed_queue_size gives error           #
-############################################################################
-
---Error 1229
-SET @@session.delayed_queue_size = 0;
---Error 1238
-SELECT @@session.delayed_queue_size;
-
---echo '#----------------------FN_DYNVARS_026_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.delayed_queue_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='delayed_queue_size';
-
-SELECT @@delayed_queue_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='delayed_queue_size';
-
-
---echo '#---------------------FN_DYNVARS_026_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.delayed_queue_size = TRUE;
-SELECT @@global.delayed_queue_size;
-SET @@global.delayed_queue_size = FALSE;
-SELECT @@global.delayed_queue_size;
-
---echo '#---------------------FN_DYNVARS_026_08----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@global.delayed_queue_size = 1;
-SELECT @@delayed_queue_size = @@global.delayed_queue_size;
-
-
---echo '#---------------------FN_DYNVARS_026_09----------------------#'
-###########################################################################
-#   Check if delayed_queue_size can be accessed with and without @@ sign  #
-###########################################################################
-
---Error 1229
-SET delayed_queue_size = 1;
-SELECT @@delayed_queue_size;
---Error ER_PARSE_ERROR
-SET local.delayed_queue_size = 1;
---Error ER_UNKNOWN_TABLE
-SELECT local.delayed_queue_size;
---Error ER_PARSE_ERROR
-SET global.delayed_queue_size = 1;
---Error ER_UNKNOWN_TABLE
-SELECT global.delayed_queue_size;
---Error ER_BAD_FIELD_ERROR
-SELECT delayed_queue_size = @@session.delayed_queue_size;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.delayed_queue_size = @start_value;
-SELECT @@global.delayed_queue_size;
-
-
-###########################################################
-#              END OF delayed_queue_size TESTS            #
-###########################################################
-
diff --git a/mysql-test/include/innodb_concurrency_tickets_basic.inc b/mysql-test/include/innodb_concurrency_tickets_basic.inc
deleted file mode 100644
index 67b0247d169..00000000000
--- a/mysql-test/include/innodb_concurrency_tickets_basic.inc
+++ /dev/null
@@ -1,147 +0,0 @@
-################# mysql-test\t\innodb_concurrency_tickets_basic.test ##########
-#                                                                             #
-# Variable Name: innodb_concurrency_tickets                                   #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: Numeric                                                          #
-# Default Value: 500                                                          #
-# Range: 1-4294967295                                                         #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Rizwan                                                             #
-#                                                                             #
-#Description:Test Cases of Dynamic System Variable innodb_concurrency_tickets #
-#             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_concurrency_tickets TESTS         #
-########################################################################
-
-
-################################################################################
-# Saving initial value of innodb_concurrency_tickets in a temporary variable   #
-################################################################################
-
-SET @global_start_value = @@global.innodb_concurrency_tickets;
-SELECT @global_start_value;
-
---echo '#--------------------FN_DYNVARS_046_01------------------------#'
-######################################################################## 
-#           Display the DEFAULT value of innodb_concurrency_tickets    #
-######################################################################## 
-
-SET @@global.innodb_concurrency_tickets = 0;
-SET @@global.innodb_concurrency_tickets = DEFAULT;
-SELECT @@global.innodb_concurrency_tickets;
-
---echo '#---------------------FN_DYNVARS_046_02-------------------------#'
-################################################################################
-# Check if innodb_concurrency_tickets can be accessed with and without @@ sign #
-################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET innodb_concurrency_tickets = 1;
-SELECT @@innodb_concurrency_tickets;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.innodb_concurrency_tickets;
-
-
-SET global innodb_concurrency_tickets = 0;
-SELECT @@global.innodb_concurrency_tickets;
-
-
---echo '#--------------------FN_DYNVARS_046_03------------------------#'
-########################################################################## 
-#      change the value of innodb_concurrency_tickets to a valid value   #
-########################################################################## 
-
-
-SET @@global.innodb_concurrency_tickets = 1;
-SELECT @@global.innodb_concurrency_tickets;
-
-SET @@global.innodb_concurrency_tickets = 1000;
-SELECT @@global.innodb_concurrency_tickets;
-
-SET @@global.innodb_concurrency_tickets = 4294967295;
-SELECT @@global.innodb_concurrency_tickets;
-
-
---echo '#--------------------FN_DYNVARS_046_04-------------------------#'
-########################################################################### 
-#  Change the value of innodb_concurrency_tickets to invalid value        #
-###########################################################################
-
-SET @@global.innodb_concurrency_tickets = -1;
-SELECT @@global.innodb_concurrency_tickets;
-
---Error ER_WRONG_TYPE_FOR_VAR  
-SET @@global.innodb_concurrency_tickets = "T";
-SELECT @@global.innodb_concurrency_tickets;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_concurrency_tickets = "Y";
-SELECT @@global.innodb_concurrency_tickets;
-
-SET @@global.innodb_concurrency_tickets = 1001;
-SELECT @@global.innodb_concurrency_tickets;
-
---echo '#----------------------FN_DYNVARS_046_05------------------------#'
-######################################################################### 
-#     Check if the value in GLOBAL Table matches value in variable      #
-#########################################################################
-
-SELECT @@global.innodb_concurrency_tickets =
- VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-  WHERE VARIABLE_NAME='innodb_concurrency_tickets';
-SELECT @@global.innodb_concurrency_tickets;
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
- WHERE VARIABLE_NAME='innodb_concurrency_tickets';
-
---echo '#---------------------FN_DYNVARS_046_06-------------------------#'
-###################################################################
-#        Check if ON and OFF values can be used on variable       #
-###################################################################
-
---ERROR ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_concurrency_tickets = OFF;
-SELECT @@global.innodb_concurrency_tickets;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_concurrency_tickets = ON;
-SELECT @@global.innodb_concurrency_tickets;
-
---echo '#---------------------FN_DYNVARS_046_07----------------------#'
-###################################################################
-#      Check if TRUE and FALSE values can be used on variable     #
-###################################################################
-
-SET @@global.innodb_concurrency_tickets = TRUE;
-SELECT @@global.innodb_concurrency_tickets;
-SET @@global.innodb_concurrency_tickets = FALSE;
-SELECT @@global.innodb_concurrency_tickets;
-
-##############################
-#   Restore initial value    #
-##############################
-
-SET @@global.innodb_concurrency_tickets = @global_start_value;
-SELECT @@global.innodb_concurrency_tickets;
-
-###############################################################
-#           END OF innodb_concurrency_tickets TESTS           #
-###############################################################
-
diff --git a/mysql-test/include/innodb_max_purge_lag_basic.inc b/mysql-test/include/innodb_max_purge_lag_basic.inc
deleted file mode 100644
index 9e6b8201e3d..00000000000
--- a/mysql-test/include/innodb_max_purge_lag_basic.inc
+++ /dev/null
@@ -1,147 +0,0 @@
-################# mysql-test\t\innodb_max_purge_lag_basic.test ################
-#                                                                             #
-# Variable Name: innodb_max_purge_lag                                         #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: Numeric                                                          #
-# Default Value: 0                                                            #
-# Range: 0-4294967295                                                         #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Rizwan                                                             #
-#                                                                             #
-#Description:Test Cases of Dynamic System Variable innodb_max_purge_lag       #
-#             that checks the behavior of this variable in the following ways #
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/have_innodb.inc
---source include/load_sysvars.inc
-
-######################################################################## 
-#                    START OF innodb_max_purge_lag TESTS               #
-######################################################################## 
-
-################################################################################ 
-#   Saving initial value of innodb_max_purge_lag in a temporary variable       #
-################################################################################ 
-
-SET @global_start_value = @@global.innodb_max_purge_lag;
-SELECT @global_start_value;
-
---echo '#--------------------FN_DYNVARS_046_01------------------------#'
-######################################################################## 
-#           Display the DEFAULT value of innodb_max_purge_lag          #
-######################################################################## 
-
-SET @@global.innodb_max_purge_lag = 0;
-SET @@global.innodb_max_purge_lag = DEFAULT;
-SELECT @@global.innodb_max_purge_lag;
-
---echo '#---------------------FN_DYNVARS_046_02-------------------------#'
-############################################################################
-#   Check if innodb_max_purge_lag can be accessed with and without @@ sign #
-############################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET innodb_max_purge_lag = 1;
-SELECT @@innodb_max_purge_lag;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.innodb_max_purge_lag;
-
-SET global innodb_max_purge_lag = 0;
-SELECT @@global.innodb_max_purge_lag;
-
---echo '#--------------------FN_DYNVARS_046_03------------------------#'
-########################################################################## 
-#      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-------------------------#'
-########################################################################### 
-#       Change the value of innodb_max_purge_lag to invalid value         #
-########################################################################### 
-
-SET @@global.innodb_max_purge_lag = -1;
-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;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_max_purge_lag = "Y";
-SELECT @@global.innodb_max_purge_lag;
-
-
-SET @@global.innodb_max_purge_lag = 1001;
-SELECT @@global.innodb_max_purge_lag;
-
---echo '#----------------------FN_DYNVARS_046_05------------------------#'
-######################################################################### 
-#     Check if the value in GLOBAL Table matches value in variable      #
-#########################################################################
-
-SELECT @@global.innodb_max_purge_lag =
- VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-  WHERE VARIABLE_NAME='innodb_max_purge_lag';
-SELECT @@global.innodb_max_purge_lag;
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
- WHERE VARIABLE_NAME='innodb_max_purge_lag';
-
-
-
-
---echo '#---------------------FN_DYNVARS_046_06-------------------------#'
-################################################################### 
-#        Check if ON and OFF values can be used on variable       #
-################################################################### 
-
---ERROR ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_max_purge_lag = OFF;
-SELECT @@global.innodb_max_purge_lag;
-
---ERROR ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_max_purge_lag = ON;
-SELECT @@global.innodb_max_purge_lag;
-
---echo '#---------------------FN_DYNVARS_046_07----------------------#'
-################################################################### 
-#      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;
-SELECT @@global.innodb_max_purge_lag;
-
-##############################  
-#   Restore initial value    #
-##############################
-
-
-SET @@global.innodb_max_purge_lag = @global_start_value;
-SELECT @@global.innodb_max_purge_lag;
-
-###############################################################
-#                    END OF innodb_max_purge_lag TESTS        #
-############################################################### 
diff --git a/mysql-test/include/innodb_sync_spin_loops_basic.inc b/mysql-test/include/innodb_sync_spin_loops_basic.inc
deleted file mode 100644
index 35460fe47f2..00000000000
--- a/mysql-test/include/innodb_sync_spin_loops_basic.inc
+++ /dev/null
@@ -1,142 +0,0 @@
-################# mysql-test\t\innodb_sync_spin_loops_basic.test ##############
-#                                                                             #
-# Variable Name: innodb_sync_spin_loops                                       #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: Numeric                                                          #
-# Default Value: 20                                                           #
-# Range: 0-4294967295                                                         #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Rizwan                                                             #
-#                                                                             #
-#Description:Test Cases of Dynamic System Variable innodb_sync_spin_loops     #
-#             that checks the behavior of this variable in the following ways #
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/have_innodb.inc
---source include/load_sysvars.inc
-
-########################################################################
-#                    START OF innodb_sync_spin_loops TESTS             #
-########################################################################
-
-
-############################################################################
-#   Saving initial value of innodb_sync_spin_loops in a temporary variable #
-############################################################################
-
-SET @global_start_value = @@global.innodb_sync_spin_loops;
-SELECT @global_start_value;
-
---echo '#--------------------FN_DYNVARS_046_01------------------------#'
-########################################################################
-#           Display the DEFAULT value of innodb_sync_spin_loops        #
-########################################################################
-
-SET @@global.innodb_sync_spin_loops = 0;
-SET @@global.innodb_sync_spin_loops = DEFAULT;
-SELECT @@global.innodb_sync_spin_loops;
-
---echo '#---------------------FN_DYNVARS_046_02-------------------------#'
-##############################################################################
-#   Check if innodb_sync_spin_loops can be accessed with and without @@ sign #
-##############################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET innodb_sync_spin_loops = 1;
-SELECT @@innodb_sync_spin_loops;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.innodb_sync_spin_loops;
-
-SET global innodb_sync_spin_loops = 0;
-SELECT @@global.innodb_sync_spin_loops;
-
---echo '#--------------------FN_DYNVARS_046_03------------------------#'
-##########################################################################
-#      change the value of innodb_sync_spin_loops to a valid value       #
-##########################################################################
-
-SET @@global.innodb_sync_spin_loops = 0;
-SELECT @@global.innodb_sync_spin_loops;
-
-SET @@global.innodb_sync_spin_loops = 1;
-SELECT @@global.innodb_sync_spin_loops;
-SET @@global.innodb_sync_spin_loops = 1000;
-SELECT @@global.innodb_sync_spin_loops;
-
---echo '#--------------------FN_DYNVARS_046_04-------------------------#'
-###########################################################################
-#       Change the value of innodb_sync_spin_loops to invalid value       #
-########################################################################### 
-
-SET @@global.innodb_sync_spin_loops = -1;
-SELECT @@global.innodb_sync_spin_loops;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_sync_spin_loops = "T";
-SELECT @@global.innodb_sync_spin_loops;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_sync_spin_loops = "Y";
-SELECT @@global.innodb_sync_spin_loops;
-
-SET @@global.innodb_sync_spin_loops = 1001;
-SELECT @@global.innodb_sync_spin_loops;
-
---echo '#----------------------FN_DYNVARS_046_05------------------------#'
-######################################################################### 
-#     Check if the value in GLOBAL Table matches value in variable      #
-#########################################################################
-
-SELECT @@global.innodb_sync_spin_loops =
- VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-  WHERE VARIABLE_NAME='innodb_sync_spin_loops';
-SELECT @@global.innodb_sync_spin_loops;
-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
- WHERE VARIABLE_NAME='innodb_sync_spin_loops';
-
---echo '#---------------------FN_DYNVARS_046_06-------------------------#'
-################################################################### 
-#        Check if ON and OFF values can be used on variable       #
-###################################################################
-
---ERROR ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_sync_spin_loops = OFF;
-SELECT @@global.innodb_sync_spin_loops;
-
---ERROR ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_sync_spin_loops = ON;
-SELECT @@global.innodb_sync_spin_loops;
-
---echo '#---------------------FN_DYNVARS_046_07----------------------#'
-###################################################################
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-
-SET @@global.innodb_sync_spin_loops = TRUE;
-SELECT @@global.innodb_sync_spin_loops;
-SET @@global.innodb_sync_spin_loops = FALSE;
-SELECT @@global.innodb_sync_spin_loops;
-
-##############################
-#   Restore initial value    #
-##############################
-
-SET @@global.innodb_sync_spin_loops = @global_start_value;
-SELECT @@global.innodb_sync_spin_loops;
-
-###############################################################
-#                    END OF innodb_sync_spin_loops TESTS      #
-############################################################### 
diff --git a/mysql-test/include/join_buffer_size_basic.inc b/mysql-test/include/join_buffer_size_basic.inc
deleted file mode 100644
index 880dac4cac4..00000000000
--- a/mysql-test/include/join_buffer_size_basic.inc
+++ /dev/null
@@ -1,216 +0,0 @@
-############## mysql-test\t\join_buffer_size_basic.test ###############
-#                                                                             #
-# Variable Name: join_buffer_size                                             #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 131072                                                       #
-# Range: 8200-4294967295                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable join_buffer_size         #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-################################################################
-#           START OF join_buffer_size TESTS                    #
-################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.join_buffer_size;
-SELECT @start_global_value;
-SET @start_session_value = @@session.join_buffer_size;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_053_01-------------------------#'
-################################################################
-#     Display the DEFAULT value of join_buffer_size            #
-################################################################
-
-SET @@global.join_buffer_size = 8200;
-SET @@global.join_buffer_size = DEFAULT;
-SELECT @@global.join_buffer_size;
-
-SET @@session.join_buffer_size = 8200;
-SET @@session.join_buffer_size = DEFAULT;
-SELECT @@session.join_buffer_size;
-
-
---echo '#--------------------FN_DYNVARS_053_02-------------------------#'
-###################################################################
-#     Check the DEFAULT value of join_buffer_size              #
-###################################################################
-
-SET @@global.join_buffer_size = DEFAULT;
-SELECT @@global.join_buffer_size = 131072;
-
-SET @@session.join_buffer_size = DEFAULT;
-SELECT @@session.join_buffer_size = 131072;
-
-
---echo '#--------------------FN_DYNVARS_053_03-------------------------#'
-##########################################################################
-# Change the value of join_buffer_size to a valid value for GLOBAL Scope #
-##########################################################################
-
-SET @@global.join_buffer_size = 8200;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-SET @@global.join_buffer_size = 65536;
-SELECT @@global.join_buffer_size;
-SET @@global.join_buffer_size = 4294967295;
-SELECT @@global.join_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-
---echo '#--------------------FN_DYNVARS_053_04-------------------------#'
-###########################################################################
-# Change the value of join_buffer_size to a valid value for SESSION Scope #
-###########################################################################
- 
-SET @@session.join_buffer_size = 8200;
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-SET @@session.join_buffer_size = 65536;
-SELECT @@session.join_buffer_size;
-SET @@session.join_buffer_size = 4294967295;
-SELECT @@session.join_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-
---echo '#------------------FN_DYNVARS_053_05-----------------------#'
-############################################################
-# Change the value of join_buffer_size to an invalid value #
-############################################################
-
-SET @@global.join_buffer_size = 0;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-SET @@global.join_buffer_size = -1024;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-SET @@global.join_buffer_size = 8199;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-SET @@global.join_buffer_size = 42949672951;
-SELECT @@global.join_buffer_size;
-
---Error ER_PARSE_ERROR
-SET @@global.join_buffer_size = 65530.34.;
-SELECT @@global.join_buffer_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.join_buffer_size = test;
-SELECT @@global.join_buffer_size;
-
-SET @@session.join_buffer_size = 0;
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-SET @@session.join_buffer_size = -2;
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-SET @@session.join_buffer_size = 8199;
-SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
-SET @@session.join_buffer_size = 42949672951;
-SELECT @@session.join_buffer_size;
-
---Error ER_PARSE_ERROR
-SET @@session.join_buffer_size = 65530.34.;
-SELECT @@session.join_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.join_buffer_size = test;
-SELECT @@session.join_buffer_size;
-
-
---echo '#------------------FN_DYNVARS_053_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.join_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='join_buffer_size';
-
---echo '#------------------FN_DYNVARS_053_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.join_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='join_buffer_size';
-
-
---echo '#------------------FN_DYNVARS_053_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.join_buffer_size = TRUE;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
-SET @@global.join_buffer_size = FALSE;
-SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
---echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-#################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-#################################################################################
-
-SET @@global.join_buffer_size = 10;
-SELECT @@join_buffer_size = @@global.join_buffer_size;
-
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@join_buffer_size = 100;
-SELECT @@join_buffer_size = @@local.join_buffer_size;
-SELECT @@local.join_buffer_size = @@session.join_buffer_size;
-
-
---echo '#---------------------FN_DYNVARS_001_11----------------------#'
-##############################################################################
-#   Check if join_buffer_size can be accessed with and without @@ sign    #
-##############################################################################
-
-SET join_buffer_size = 1;
-SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
---Error ER_UNKNOWN_TABLE
-SELECT local.join_buffer_size;
---Error ER_UNKNOWN_TABLE
-SELECT session.join_buffer_size;
---Error ER_BAD_FIELD_ERROR
-SELECT join_buffer_size = @@session.join_buffer_size;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.join_buffer_size = @start_global_value;
-SELECT @@global.join_buffer_size;
-SET @@session.join_buffer_size = @start_session_value;
-SELECT @@session.join_buffer_size;
-
-
-########################################################
-#                 END OF join_buffer_size TESTS     #
-########################################################
-
diff --git a/mysql-test/include/key_buffer_size_basic.inc b/mysql-test/include/key_buffer_size_basic.inc
deleted file mode 100644
index 996a9e712f9..00000000000
--- a/mysql-test/include/key_buffer_size_basic.inc
+++ /dev/null
@@ -1,187 +0,0 @@
-############## mysql-test\t\key_buffer_size_basic.test ########################
-#                                                                             #
-# Variable Name: key_buffer_size                                              #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 131072                                                       #
-# Range:8-4294967295                                                          #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable key_buffer_size          #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-# Changes:                                                             #
-# 2008-03-06 hhunger Got "lost connections with 5.1.24                 #
-########################################################################
-
---source include/load_sysvars.inc
-
-######################################################################## 
-#                    START OF key_buffer_size TESTS                    #
-######################################################################## 
-
---disable_warnings
-######################################################################## 
-# Saving initial value of key_buffer_size in a temporary variable      #
-######################################################################## 
-
-SET @start_value = @@global.key_buffer_size;
-SELECT @start_value;
-
-
---echo '#--------------------FN_DYNVARS_055_01------------------------#'
-######################################################################## 
-#              Display the DEFAULT value of key_buffer_size            #
-######################################################################## 
-
-SET @@global.key_buffer_size = 99;
---Error ER_NO_DEFAULT
-SET @@global.key_buffer_size = DEFAULT;
---echo 'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-
-
---echo '#---------------------FN_DYNVARS_055_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size = @start_value;
-
---echo '#--------------------FN_DYNVARS_055_03------------------------#'
-######################################################################## 
-#        Change the value of key_buffer_size to a valid value          #
-######################################################################## 
-
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@global.key_buffer_size= @min_key_buffer_size;
---disable_warnings
-#Due to "lost connection"
-#SET @@global.key_buffer_size = 4294967295;
---enable_warnings
-#SELECT @@global.key_buffer_size;
-SET @@global.key_buffer_size = 1800;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-SET @@global.key_buffer_size = 65535;
-SELECT @@global.key_buffer_size;
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-
---echo '#--------------------FN_DYNVARS_055_04-------------------------#'
-########################################################################### 
-#         Change the value of key_buffer_size to invalid value            #
-########################################################################### 
-
-# Due to "lost connection"
-#SET @@global.key_buffer_size = -1;
-#SELECT @@global.key_buffer_size;
-#SET @@global.key_buffer_size = 100000000000;
-#SELECT @@global.key_buffer_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_buffer_size = 10000.01;
-SELECT @@global.key_buffer_size;
-#SET @@global.key_buffer_size = -1024;
-#SELECT @@global.key_buffer_size;
-SET @@global.key_buffer_size = 4;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_buffer_size = ON;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_buffer_size = 'test';
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-
-
---echo '#-------------------FN_DYNVARS_055_05----------------------------#'
-########################################################################### 
-#       Test if accessing session key_buffer_size gives error             #
-########################################################################### 
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.key_buffer_size = 0;
-SELECT @@key_buffer_size = @min_key_buffer_size;
-
-
---echo '#----------------------FN_DYNVARS_055_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.key_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_buffer_size';
-
-SELECT @@key_buffer_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_buffer_size';
-
-
---echo '#---------------------FN_DYNVARS_055_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.key_buffer_size = TRUE;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-SET @@global.key_buffer_size = FALSE;
-SELECT @@global.key_buffer_size = @min_key_buffer_size;
-
-
---echo '#---------------------FN_DYNVARS_055_08----------------------#'
-#####################################################################
-#  Check if accessing variable with SESSION,LOCAL and without SCOPE #
-#  points to same session variable                                  #
-#####################################################################
-
-# due to differences in contents of the warnings
---disable_warnings
-SET @@global.key_buffer_size = @min_key_buffer_size;
-SELECT @@key_buffer_size = @@global.key_buffer_size;
---enable_warnings
-
---echo '#---------------------FN_DYNVARS_055_09----------------------#'
-##########################################################################  
-#   Check if key_buffer_size can be accessed with and without @@ sign    #
-##########################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET key_buffer_size = @min_key_buffer_size;
-SELECT @@key_buffer_size = @min_key_buffer_size;
---Error ER_PARSE_ERROR
-SET local.key_buffer_size = 10;
---Error ER_UNKNOWN_TABLE
-SELECT local.key_buffer_size;
---Error ER_PARSE_ERROR
-SET global.key_buffer_size = 10;
---Error ER_UNKNOWN_TABLE
-SELECT global.key_buffer_size;
---Error ER_BAD_FIELD_ERROR
-SELECT key_buffer_size = @@session.key_buffer_size;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.key_buffer_size = @start_value;
-SELECT @@global.key_buffer_size;
-
---enable_warnings
-#######################################################################
-#              END OF key_buffer_size TESTS                           #
-#######################################################################
diff --git a/mysql-test/include/key_cache_age_threshold_basic.inc b/mysql-test/include/key_cache_age_threshold_basic.inc
deleted file mode 100644
index 7841ad2cedc..00000000000
--- a/mysql-test/include/key_cache_age_threshold_basic.inc
+++ /dev/null
@@ -1,180 +0,0 @@
-############## mysql-test\t\key_cache_age_threshold_basic.test ###############
-#                                                                             #
-# Variable Name: key_cache_age_threshold                                      #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 300                                                          #
-# Range: 100-4294967295                                                       #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable key_cache_age_threshold  #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-######################################################################## 
-#            START OF key_cache_age_threshold TESTS                    #
-######################################################################## 
-
-
-############################################################################# 
-#  Saving initial value of key_cache_age_threshold in a temporary variable  #
-############################################################################# 
-
-SET @start_value = @@global.key_cache_age_threshold;
-SELECT @start_value;
-
-
---echo '#--------------------FN_DYNVARS_056_01------------------------#'
-################################################################################ 
-#              Display the DEFAULT value of key_cache_age_threshold            #
-################################################################################ 
-
-SET @@global.key_cache_age_threshold = 99;
---Error ER_NO_DEFAULT
-SET @@global.key_cache_age_threshold = DEFAULT;
---echo 'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_cache_age_threshold;
-
-
---echo '#---------------------FN_DYNVARS_056_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.key_cache_age_threshold = @start_value;
-SELECT @@global.key_cache_age_threshold = 300;
-
-
---echo '#--------------------FN_DYNVARS_056_03------------------------#'
-############################################################################### 
-#        Change the value of key_cache_age_threshold to a valid value         #
-############################################################################### 
-
-SET @@global.key_cache_age_threshold = 100;
-SELECT @@global.key_cache_age_threshold;
-SET @@global.key_cache_age_threshold = 4294967295;
-SELECT @@global.key_cache_age_threshold;
-SET @@global.key_cache_age_threshold = 1800;
-SELECT @@global.key_cache_age_threshold;
-SET @@global.key_cache_age_threshold = 65535;
-SELECT @@global.key_cache_age_threshold;
---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-
-
---echo '#--------------------FN_DYNVARS_056_04-------------------------#'
-########################################################################### 
-#         Change the value of key_cache_age_threshold to invalid value    #
-########################################################################### 
-
-SET @@global.key_cache_age_threshold = -1;
-SELECT @@global.key_cache_age_threshold;
-SET @@global.key_cache_age_threshold = 42949672951;
-SELECT @@global.key_cache_age_threshold;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_cache_age_threshold = 10000.01;
-SELECT @@global.key_cache_age_threshold;
-SET @@global.key_cache_age_threshold = -1024;
-SELECT @@global.key_cache_age_threshold;
-SET @@global.key_cache_age_threshold = 99;
-SELECT @@global.key_cache_age_threshold;
-
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_cache_age_threshold = ON;
-SELECT @@global.key_cache_age_threshold;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_cache_age_threshold = 'test';
-SELECT @@global.key_cache_age_threshold;
-
-
---echo '#-------------------FN_DYNVARS_056_05----------------------------#'
-########################################################################### 
-#       Test if accessing session key_cache_age_threshold gives error     #
-########################################################################### 
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.key_cache_age_threshold = 0;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.key_cache_age_threshold;
-
-
---echo '#----------------------FN_DYNVARS_056_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_age_threshold';
-
-SELECT @@key_cache_age_threshold = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_age_threshold';
-
-
---echo '#---------------------FN_DYNVARS_056_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.key_cache_age_threshold = TRUE;
-SELECT @@global.key_cache_age_threshold;
-SET @@global.key_cache_age_threshold = FALSE;
-SELECT @@global.key_cache_age_threshold;
-
-
---echo '#---------------------FN_DYNVARS_056_08----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@global.key_cache_age_threshold = 101;
-SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold;
-
-
---echo '#---------------------FN_DYNVARS_056_09----------------------#'
-########################################################################## ####### 
-#   Check if key_cache_age_threshold can be accessed with and without @@ sign    #
-##################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET key_cache_age_threshold = 8000;
-SELECT @@key_cache_age_threshold;
---Error ER_PARSE_ERROR
-SET local.key_cache_age_threshold = 10;
---Error ER_UNKNOWN_TABLE
-SELECT local.key_cache_age_threshold;
---Error ER_PARSE_ERROR
-SET global.key_cache_age_threshold = 10;
---Error ER_UNKNOWN_TABLE
-SELECT global.key_cache_age_threshold;
---Error ER_BAD_FIELD_ERROR
-SELECT key_cache_age_threshold = @@session.key_cache_age_threshold;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.key_cache_age_threshold = @start_value;
-SELECT @@global.key_cache_age_threshold;
-
-
-######################################################################## 
-#              END OF key_cache_age_threshold TESTS                    #
-######################################################################## 
diff --git a/mysql-test/include/key_cache_block_size_basic.inc b/mysql-test/include/key_cache_block_size_basic.inc
deleted file mode 100644
index b12ea45b762..00000000000
--- a/mysql-test/include/key_cache_block_size_basic.inc
+++ /dev/null
@@ -1,185 +0,0 @@
-############## mysql-test\t\key_cache_block_size_basic.test ###############
-#                                                                             #
-# Variable Name: key_cache_block_size                                         #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric 1024                                                     #
-# Default Value:                                                              #
-# Range: 512-16384                                                            #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable key_cache_block_size     #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-##################################################################### 
-#            START OF key_cache_block_size TESTS                    #
-#####################################################################
-
-
-########################################################################## 
-#  Saving initial value of key_cache_block_size in a temporary variable  #
-##########################################################################
-
-SET @start_value = @@global.key_cache_block_size;
-SELECT @start_value;
-
-
---echo '#--------------------FN_DYNVARS_057_01------------------------#'
-################################################################################ 
-#              Display the DEFAULT value of key_cache_block_size            #
-################################################################################ 
-
-SET @@global.key_cache_block_size = 600;
---Error ER_NO_DEFAULT
-SET @@global.key_cache_block_size = DEFAULT;
---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-SELECT @@global.key_cache_block_size;
-
-
---echo '#---------------------FN_DYNVARS_057_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.key_cache_block_size = @start_value;
-SELECT @@global.key_cache_block_size = 1024;
-
-
---echo '#--------------------FN_DYNVARS_057_03------------------------#'
-############################################################################### 
-#        Change the value of key_cache_block_size to a valid value            #
-############################################################################### 
-
-SET @@global.key_cache_block_size = 1024;
-SELECT @@global.key_cache_block_size;
-SET @@global.key_cache_block_size = 16384;
-SELECT @@global.key_cache_block_size;
-SET @@global.key_cache_block_size = 1800;
-SELECT @@global.key_cache_block_size;
-SET @@global.key_cache_block_size = 16383;
-SELECT @@global.key_cache_block_size;
---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
-
-
---echo '#--------------------FN_DYNVARS_057_04-------------------------#'
-########################################################################### 
-#         Change the value of key_cache_block_size to invalid value    #
-########################################################################### 
-
-SET @@global.key_cache_block_size = -1;
-SELECT @@global.key_cache_block_size;
-SET @@global.key_cache_block_size = 42949672951;
-SELECT @@global.key_cache_block_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_cache_block_size = 10000.01;
-SELECT @@global.key_cache_block_size;
-SET @@global.key_cache_block_size = -1024;
-SELECT @@global.key_cache_block_size;
-SET @@global.key_cache_block_size = 256;
-SELECT @@global.key_cache_block_size;
-SET @@global.key_cache_block_size = 511;
-SELECT @@global.key_cache_block_size;
-SET @@global.key_cache_block_size = 16385;
-SELECT @@global.key_cache_block_size;
-
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_cache_block_size = ON;
-SELECT @@global.key_cache_block_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_cache_block_size = 'test';
-SELECT @@global.key_cache_block_size;
-
-
---echo '#-------------------FN_DYNVARS_057_05----------------------------#'
-########################################################################### 
-#       Test if accessing session key_cache_block_size gives error     #
-########################################################################### 
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.key_cache_block_size = 0;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.key_cache_block_size;
-
-
---echo '#----------------------FN_DYNVARS_057_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.key_cache_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_block_size';
-
-SELECT @@key_cache_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_block_size';
-
-
---echo '#---------------------FN_DYNVARS_057_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.key_cache_block_size = TRUE;
-SELECT @@global.key_cache_block_size;
-SET @@global.key_cache_block_size = FALSE;
-SELECT @@global.key_cache_block_size;
-
-
---echo '#---------------------FN_DYNVARS_057_08----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@global.key_cache_block_size = 1024;
-SELECT @@key_cache_block_size = @@global.key_cache_block_size;
-
-
---echo '#---------------------FN_DYNVARS_057_09----------------------#'
-############################################################################### 
-#   Check if key_cache_block_size can be accessed with and without @@ sign    #
-###############################################################################;
-
---Error ER_GLOBAL_VARIABLE
-SET key_cache_block_size = 8000;
-SELECT @@key_cache_block_size;
---Error ER_PARSE_ERROR
-SET local.key_cache_block_size = 10;
---Error ER_UNKNOWN_TABLE
-SELECT local.key_cache_block_size;
---Error ER_PARSE_ERROR
-SET global.key_cache_block_size = 10;
---Error ER_UNKNOWN_TABLE
-SELECT global.key_cache_block_size;
---Error ER_BAD_FIELD_ERROR
-SELECT key_cache_block_size = @@session.key_cache_block_size;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.key_cache_block_size = @start_value;
-SELECT @@global.key_cache_block_size;
-
-
-#####################################################################
-#              END OF key_cache_block_size TESTS                    #
-#####################################################################
-
diff --git a/mysql-test/include/key_cache_division_limit_basic.inc b/mysql-test/include/key_cache_division_limit_basic.inc
deleted file mode 100644
index a2cc49a1f38..00000000000
--- a/mysql-test/include/key_cache_division_limit_basic.inc
+++ /dev/null
@@ -1,184 +0,0 @@
-############## mysql-test\t\key_cache_division_limit_basic.test ###############
-#                                                                             #
-# Variable Name: key_cache_division_limit                                     #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 100                                                          #
-# Range: 1-100                                                                #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable key_cache_division_limit #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-##################################################################### 
-#            START OF key_cache_division_limit TESTS                #
-#####################################################################
-
-
-############################################################################## 
-#  Saving initial value of key_cache_division_limit in a temporary variable  #
-##############################################################################
-
-SET @start_value = @@global.key_cache_division_limit;
-SELECT @start_value;
-
-
---echo '#--------------------FN_DYNVARS_058_01------------------------#'
-################################################################################ 
-#              Display the DEFAULT value of key_cache_division_limit           #
-################################################################################ 
-
-SET @@global.key_cache_division_limit = 50;
---Error ER_NO_DEFAULT
-SET @@global.key_cache_division_limit = DEFAULT;
---echo 'Bug# 34878: This variable has default value according to documentation';
-SELECT @@global.key_cache_division_limit;
-
-
---echo '#---------------------FN_DYNVARS_058_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.key_cache_division_limit = @start_value;
-SELECT @@global.key_cache_division_limit = 100;
-
-
---echo '#--------------------FN_DYNVARS_058_03------------------------#'
-############################################################################### 
-#        Change the value of key_cache_division_limit to a valid value        #
-############################################################################### 
-
-SET @@global.key_cache_division_limit = 1;
-SELECT @@global.key_cache_division_limit;
-SET @@global.key_cache_division_limit = 50;
-SELECT @@global.key_cache_division_limit;
-SET @@global.key_cache_division_limit = 99;
-SELECT @@global.key_cache_division_limit;
-SET @@global.key_cache_division_limit = 2;
-SELECT @@global.key_cache_division_limit;
-
-
---echo '#--------------------FN_DYNVARS_058_04-------------------------#'
-########################################################################### 
-#         Change the value of key_cache_division_limit to invalid value    #
-########################################################################### 
-
-SET @@global.key_cache_division_limit = -1;
-SELECT @@global.key_cache_division_limit;
-SET @@global.key_cache_division_limit = 101;
-SELECT @@global.key_cache_division_limit;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_cache_division_limit = 10000.01;
-SELECT @@global.key_cache_division_limit;
-SET @@global.key_cache_division_limit = -1024;
-SELECT @@global.key_cache_division_limit;
-SET @@global.key_cache_division_limit = 0;
-SELECT @@global.key_cache_division_limit;
-SET @@global.key_cache_division_limit = 200;
-SELECT @@global.key_cache_division_limit;
-SET @@global.key_cache_division_limit = 65535;
-SELECT @@global.key_cache_division_limit;
-
-echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_cache_division_limit = ON;
-SELECT @@global.key_cache_division_limit;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.key_cache_division_limit = 'test';
-SELECT @@global.key_cache_division_limit;
-
-
---echo '#-------------------FN_DYNVARS_058_05----------------------------#'
-########################################################################### 
-#       Test if accessing session key_cache_division_limit gives error     #
-########################################################################### 
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.key_cache_division_limit = 0;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.key_cache_division_limit;
-
-
---echo '#----------------------FN_DYNVARS_058_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.key_cache_division_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_division_limit';
-
-SELECT @@key_cache_division_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='key_cache_division_limit';
-
-
---echo '#---------------------FN_DYNVARS_058_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.key_cache_division_limit = TRUE;
-SELECT @@global.key_cache_division_limit;
-SET @@global.key_cache_division_limit = FALSE;
-SELECT @@global.key_cache_division_limit;
-
-
---echo '#---------------------FN_DYNVARS_058_08----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@global.key_cache_division_limit = 90;
-SELECT @@key_cache_division_limit = @@global.key_cache_division_limit;
-
-
---echo '#---------------------FN_DYNVARS_058_09----------------------#'
-############################################################################### 
-#  Check if key_cache_division_limit can be accessed with and without @@ sign #
-###############################################################################;
-
---Error ER_GLOBAL_VARIABLE
-SET key_cache_division_limit = 80;
-SELECT @@key_cache_division_limit;
---Error ER_PARSE_ERROR
-SET local.key_cache_division_limit = 10;
---Error ER_UNKNOWN_TABLE
-SELECT local.key_cache_division_limit;
---Error ER_PARSE_ERROR
-SET global.key_cache_division_limit = 10;
---Error ER_UNKNOWN_TABLE
-SELECT global.key_cache_division_limit;
---Error ER_BAD_FIELD_ERROR
-SELECT key_cache_division_limit = @@session.key_cache_division_limit;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.key_cache_division_limit = @start_value;
-SELECT @@global.key_cache_division_limit;
-
-
-#####################################################################
-#              END OF key_cache_division_limit TESTS                #
-#####################################################################
-
diff --git a/mysql-test/include/log_warnings_basic.inc b/mysql-test/include/log_warnings_basic.inc
deleted file mode 100644
index cd7e1023649..00000000000
--- a/mysql-test/include/log_warnings_basic.inc
+++ /dev/null
@@ -1,210 +0,0 @@
-############## mysql-test\t\log_warnings_basic.test ###############
-#                                                                             #
-# Variable Name: log_warnings                                                 #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 1                                                            #
-# Range: -                                                                    #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable log_warnings             #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-############################################################
-#           START OF log_warnings TESTS                    #
-############################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.log_warnings;
-SELECT @start_global_value;
-SET @start_session_value = @@session.log_warnings;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_067_01-------------------------#'
-########################################################################
-#     Display the DEFAULT value of log_warnings            #
-########################################################################
-
-SET @@global.log_warnings = 100;
-SET @@global.log_warnings = DEFAULT;
-SELECT @@global.log_warnings;
-
-SET @@session.log_warnings = 200;
-SET @@session.log_warnings = DEFAULT;
-SELECT @@session.log_warnings;
-
-
---echo '#--------------------FN_DYNVARS_067_02-------------------------#'
-########################################################################
-#     Check the DEFAULT value of log_warnings              #
-########################################################################
-
-SET @@global.log_warnings = DEFAULT;
-SELECT @@global.log_warnings = 1;
-
-SET @@session.log_warnings = DEFAULT;
-SELECT @@session.log_warnings = 1;
-
-
---echo '#--------------------FN_DYNVARS_067_03-------------------------#'
-######################################################################
-# Change the value of log_warnings to a valid value for GLOBAL Scope #
-######################################################################
-
-SET @@global.log_warnings = 0;
-SELECT @@global.log_warnings;
-SET @@global.log_warnings = 1;
-SELECT @@global.log_warnings;
-SET @@global.log_warnings = 60020;
-SELECT @@global.log_warnings;
-SET @@global.log_warnings = 65535;
-SELECT @@global.log_warnings;
-SET @@global.log_warnings = 65536;
-SELECT @@global.log_warnings;
-
-
---echo '#--------------------FN_DYNVARS_067_04-------------------------#'
-#######################################################################
-# Change the value of log_warnings to a valid value for SESSION Scope #
-#######################################################################
- 
-SET @@session.log_warnings = 0;
-SELECT @@session.log_warnings;
-SET @@session.log_warnings = 1;
-SELECT @@session.log_warnings;
-SET @@session.log_warnings = 50050;
-SELECT @@session.log_warnings;
-SET @@session.log_warnings = 65535;
-SELECT @@session.log_warnings;
-SET @@session.log_warnings = 65550;
-SELECT @@session.log_warnings;
-
-
---echo '#------------------FN_DYNVARS_067_05-----------------------#'
-########################################################
-# Change the value of log_warnings to an invalid value #
-########################################################
-
-SET @@global.log_warnings = 100000000000;
-SELECT @@global.log_warnings;
-SET @@global.log_warnings = -1024;
-SELECT @@global.log_warnings;
---Error ER_PARSE_ERROR
-SET @@global.log_warnings = 65530.34.;
-SELECT @@global.log_warnings;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.log_warnings = test;
-SELECT @@global.log_warnings;
-
-SET @@session.log_warnings = 100000000000;
-SELECT @@session.log_warnings;
-SET @@session.log_warnings = -2;
-SELECT @@session.log_warnings;
---Error ER_PARSE_ERROR
-SET @@session.log_warnings = 65530.34.;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.log_warnings = test;
-SELECT @@session.log_warnings;
-
-
---echo '#------------------FN_DYNVARS_067_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.log_warnings = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='log_warnings';
-
---echo '#------------------FN_DYNVARS_067_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.log_warnings = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='log_warnings';
-
-
---echo '#------------------FN_DYNVARS_067_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.log_warnings = TRUE;
-SELECT @@global.log_warnings;
-SET @@global.log_warnings = FALSE;
-SELECT @@global.log_warnings;
-
-
---echo '#---------------------FN_DYNVARS_067_09----------------------#'
-#################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-#################################################################################
-
-SET @@global.log_warnings = 10;
-SELECT @@log_warnings = @@global.log_warnings;
-
-
---echo '#---------------------FN_DYNVARS_067_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@log_warnings = 100;
-SELECT @@log_warnings = @@local.log_warnings;
-SELECT @@local.log_warnings = @@session.log_warnings;
-
-
---echo '#---------------------FN_DYNVARS_067_11----------------------#'
-#######################################################################
-#   Check if log_warnings can be accessed with and without @@ sign    #
-#######################################################################
-
-SET log_warnings = 1;
-SELECT @@log_warnings;
---Error ER_UNKNOWN_TABLE
-SELECT local.log_warnings;
---Error ER_UNKNOWN_TABLE
-SELECT session.log_warnings;
---Error ER_BAD_FIELD_ERROR
-SELECT log_warnings = @@session.log_warnings;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.log_warnings = @start_global_value;
-SELECT @@global.log_warnings;
-SET @@session.log_warnings = @start_session_value;
-SELECT @@session.log_warnings;
-
-
-#############################################################
-#                 END OF log_warnings TESTS     #
-#############################################################
-
diff --git a/mysql-test/include/max_binlog_cache_size_basic.inc b/mysql-test/include/max_binlog_cache_size_basic.inc
deleted file mode 100644
index 9f3416d2e31..00000000000
--- a/mysql-test/include/max_binlog_cache_size_basic.inc
+++ /dev/null
@@ -1,187 +0,0 @@
-############## mysql-test\t\max_binlog_cache_size_basic.test ###############
-#                                                                             #
-# Variable Name: max_binlog_cache_size                                        #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:4294967295                                                    #
-# Range: 4096-4294967295                                                      #
-#                                                                             #
-#                                                                             #
-#                                                                             #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable max_binlog_cache_size    #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-######################################################################## 
-#              START OF max_binlog_cache_size TESTS                    #
-######################################################################## 
-
-
-######################################################################## 
-# Saving initial value of max_binlog_cache_size in a temporary variable#
-######################################################################## 
-
-SET @start_value = @@global.max_binlog_cache_size;
-SELECT @start_value;
-
-
---echo '#--------------------FN_DYNVARS_072_01------------------------#'
-######################################################################## 
-#           Display the DEFAULT value of max_binlog_cache_size         #
-######################################################################## 
-
-SET @@global.max_binlog_cache_size = 5000;
-SET @@global.max_binlog_cache_size = DEFAULT;
-SELECT @@global.max_binlog_cache_size;
-
-
---echo '#---------------------FN_DYNVARS_072_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.max_binlog_cache_size = @start_value;
-SELECT @@global.max_binlog_cache_size = 4294967295;
---echo 'Bug# 34876: Incorrect Default Value is assigned to variable';
-
---echo '#--------------------FN_DYNVARS_072_03------------------------#'
-######################################################################## 
-#    Change the value of max_binlog_cache_size to a valid value        #
-######################################################################## 
-
-SET @@global.max_binlog_cache_size = 4096;
-SELECT @@global.max_binlog_cache_size;
-SET @@global.max_binlog_cache_size = 4294967295;
-SELECT @@global.max_binlog_cache_size;
-SET @@global.max_binlog_cache_size = 4294967294;
-SELECT @@global.max_binlog_cache_size;
-SET @@global.max_binlog_cache_size = 4097;
-SELECT @@global.max_binlog_cache_size;
-SET @@global.max_binlog_cache_size = 65535;
-SELECT @@global.max_binlog_cache_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
-
---echo '#--------------------FN_DYNVARS_072_04-------------------------#'
-########################################################################### 
-#      Change the value of max_binlog_cache_size to invalid value         #
-########################################################################### 
-
-SET @@global.max_binlog_cache_size = -1;
-SELECT @@global.max_binlog_cache_size;
-SET @@global.max_binlog_cache_size = 100000000000;
-SELECT @@global.max_binlog_cache_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_binlog_cache_size = 10000.01;
-SELECT @@global.max_binlog_cache_size;
-SET @@global.max_binlog_cache_size = -1024;
-SELECT @@global.max_binlog_cache_size;
-SET @@global.max_binlog_cache_size = 1024;
-SELECT @@global.max_binlog_cache_size;
-SET @@global.max_binlog_cache_size = 4294967296;
-SELECT @@global.max_binlog_cache_size;
-SET @@global.max_binlog_cache_size = 4095;
-SELECT @@global.max_binlog_cache_size;
-
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_binlog_cache_size = ON;
-SELECT @@global.max_binlog_cache_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_binlog_cache_size = 'test';
-SELECT @@global.max_binlog_cache_size;
-
-
---echo '#-------------------FN_DYNVARS_072_05----------------------------#'
-########################################################################### 
-#       Test if accessing session max_binlog_cache_size gives error       #
-########################################################################### 
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.max_binlog_cache_size = 4096;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.max_binlog_cache_size;
-
-
---echo '#----------------------FN_DYNVARS_072_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_binlog_cache_size';
-
-SELECT @@max_binlog_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_binlog_cache_size';
-
-
---echo '#---------------------FN_DYNVARS_072_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.max_binlog_cache_size = TRUE;
-SELECT @@global.max_binlog_cache_size;
-SET @@global.max_binlog_cache_size = FALSE;
-SELECT @@global.max_binlog_cache_size;
-
-
---echo '#---------------------FN_DYNVARS_072_08----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@global.max_binlog_cache_size = 5000;
-SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
-
-
---echo '#---------------------FN_DYNVARS_072_09----------------------#'
-################################################################################  
-#   Check if max_binlog_cache_size can be accessed with and without @@ sign    #
-################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET max_binlog_cache_size = 6000;
-SELECT @@max_binlog_cache_size;
---Error ER_PARSE_ERROR
-SET local.max_binlog_cache_size = 7000;
---Error ER_UNKNOWN_TABLE
-SELECT local.max_binlog_cache_size;
---Error ER_PARSE_ERROR
-SET global.max_binlog_cache_size = 8000;
---Error ER_UNKNOWN_TABLE
-SELECT global.max_binlog_cache_size;
---Error ER_BAD_FIELD_ERROR
-SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.max_binlog_cache_size = @start_value;
-SELECT @@global.max_binlog_cache_size;
-
-
-######################################################################## 
-#              END OF max_binlog_cache_size TESTS                      #
-######################################################################## 
diff --git a/mysql-test/include/max_connect_errors_basic.inc b/mysql-test/include/max_connect_errors_basic.inc
deleted file mode 100644
index 530022652a1..00000000000
--- a/mysql-test/include/max_connect_errors_basic.inc
+++ /dev/null
@@ -1,182 +0,0 @@
-############## mysql-test\t\max_connect_errors_basic.test ###############
-#                                                                             #
-# Variable Name: max_connect_errors                                           #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:  10                                                          #
-# Range:    1-4294967295                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable max_connect_errors       #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-##################################################################
-#              START OF max_connect_errors TESTS                 #
-##################################################################
-
-
-######################################################################
-# Saving initial value of max_connect_errors in a temporary variable #
-######################################################################
-
-SET @start_value = @@global.max_connect_errors;
-SELECT @start_value;
-
-
---echo '#--------------------FN_DYNVARS_073_01------------------------#'
-##################################################################
-#           Display the DEFAULT value of max_connect_errors         #
-##################################################################
-
-SET @@global.max_connect_errors = 5000;
-SET @@global.max_connect_errors = DEFAULT;
-SELECT @@global.max_connect_errors;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
---echo '#---------------------FN_DYNVARS_073_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.max_connect_errors = @start_value;
-SELECT @@global.max_connect_errors = 10;
-
---echo '#--------------------FN_DYNVARS_073_03------------------------#'
-##################################################################
-#    Change the value of max_connect_errors to a valid value        #
-##################################################################
-
-SET @@global.max_connect_errors = 4096;
-SELECT @@global.max_connect_errors;
-SET @@global.max_connect_errors = 4294967294;
-SELECT @@global.max_connect_errors;
-SET @@global.max_connect_errors = 4294967295;
-SELECT @@global.max_connect_errors;
-SET @@global.max_connect_errors = 1;
-SELECT @@global.max_connect_errors;
-SET @@global.max_connect_errors = 2;
-SELECT @@global.max_connect_errors;
---echo 'Bug# 34877:  Invalid Values are coming in variable on assigning valid values';
-
-
---echo '#--------------------FN_DYNVARS_073_04-------------------------#'
-#####################################################################
-#      Change the value of max_connect_errors to invalid value         #
-#####################################################################
-
-SET @@global.max_connect_errors = -1;
-SELECT @@global.max_connect_errors;
-SET @@global.max_connect_errors = 100000000000;
-SELECT @@global.max_connect_errors;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_connect_errors = 10000.01;
-SELECT @@global.max_connect_errors;
-SET @@global.max_connect_errors = -1024;
-SELECT @@global.max_connect_errors;
-SET @@global.max_connect_errors = 0;
-SELECT @@global.max_connect_errors;
-SET @@global.max_connect_errors = 4294967296;
-SELECT @@global.max_connect_errors;
-
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_connect_errors = ON;
-SELECT @@global.max_connect_errors;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_connect_errors = 'test';
-SELECT @@global.max_connect_errors;
-
-
---echo '#-------------------FN_DYNVARS_073_05----------------------------#'
-##################################################################### 
-#       Test if accessing session max_connect_errors gives error       #
-#####################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.max_connect_errors = 4096;
---Error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.max_connect_errors;
-
-
---echo '#----------------------FN_DYNVARS_073_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.max_connect_errors = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_connect_errors';
-
-SELECT @@max_connect_errors = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_connect_errors';
-
-
---echo '#---------------------FN_DYNVARS_073_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.max_connect_errors = TRUE;
-SELECT @@global.max_connect_errors;
-SET @@global.max_connect_errors = FALSE;
-SELECT @@global.max_connect_errors;
-
-
---echo '#---------------------FN_DYNVARS_073_08----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@global.max_connect_errors = 5000;
-SELECT @@max_connect_errors = @@global.max_connect_errors;
-
-
---echo '#---------------------FN_DYNVARS_073_09----------------------#'
-##########################################################################
-#   Check if max_connect_errors can be accessed with and without @@ sign    #
-##########################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET max_connect_errors = 6000;
-SELECT @@max_connect_errors;
---Error ER_PARSE_ERROR
-SET local.max_connect_errors = 7000;
---Error ER_UNKNOWN_TABLE
-SELECT local.max_connect_errors;
---Error ER_PARSE_ERROR
-SET global.max_connect_errors = 8000;
---Error ER_UNKNOWN_TABLE
-SELECT global.max_connect_errors;
---Error ER_BAD_FIELD_ERROR
-SELECT max_connect_errors = @@session.max_connect_errors;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.max_connect_errors = @start_value;
-SELECT @@global.max_connect_errors;
-
-
-##################################################################
-#              END OF max_connect_errors TESTS                      #
-##################################################################
-
diff --git a/mysql-test/include/max_heap_table_size_basic.inc b/mysql-test/include/max_heap_table_size_basic.inc
deleted file mode 100644
index d07ae094cde..00000000000
--- a/mysql-test/include/max_heap_table_size_basic.inc
+++ /dev/null
@@ -1,222 +0,0 @@
-############## mysql-test\t\max_heap_table_size_basic.test ###############
-#                                                                             #
-# Variable Name: max_heap_table_size                                          #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:  16777216                                                    #
-# Range:  16384-4294967295                                                    #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable max_heap_table_size      #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-###############################################################
-#           START OF max_heap_table_size TESTS                #
-###############################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.max_heap_table_size;
-SELECT @start_global_value;
-SET @start_session_value = @@session.max_heap_table_size;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_077_01-------------------------#'
-###############################################################
-#     Display the DEFAULT value of max_heap_table_size        #
-###############################################################
-
-SET @@global.max_heap_table_size = 1677721610;
-SET @@global.max_heap_table_size = DEFAULT;
-SELECT @@global.max_heap_table_size;
-
-SET @@session.max_heap_table_size = 1677721610;
-SET @@session.max_heap_table_size = DEFAULT;
-SELECT @@session.max_heap_table_size;
-
-
---echo '#--------------------FN_DYNVARS_077_02-------------------------#'
-##################################################################
-#     Check the DEFAULT value of max_heap_table_size             #
-##################################################################
-
-SET @@global.max_heap_table_size = DEFAULT;
-SELECT @@global.max_heap_table_size = 16777216;
-
-SET @@session.max_heap_table_size = DEFAULT;
-SELECT @@session.max_heap_table_size = 16777216;
-
-
---echo '#--------------------FN_DYNVARS_077_03-------------------------#'
-############################################################################
-# Change the value of max_heap_table_size to a valid value for GLOBAL Scope #
-############################################################################
-
-SET @@global.max_heap_table_size = 16384;
-SELECT @@global.max_heap_table_size;
-SET @@global.max_heap_table_size = 16385;
-SELECT @@global.max_heap_table_size;
-SET @@global.max_heap_table_size = 65535;
-SELECT @@global.max_heap_table_size;
-SET @@global.max_heap_table_size = 4294967294;
-SELECT @@global.max_heap_table_size;
-SET @@global.max_heap_table_size = 4294967295;
-SELECT @@global.max_heap_table_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
-
---echo '#--------------------FN_DYNVARS_077_04-------------------------#'
-#############################################################################
-# Change the value of max_heap_table_size to a valid value for SESSION Scope #
-#############################################################################
- 
-SET @@session.max_heap_table_size = 16384;
-SELECT @@session.max_heap_table_size;
-SET @@session.max_heap_table_size = 16385;
-SELECT @@session.max_heap_table_size;
-SET @@session.max_heap_table_size = 65535;
-SELECT @@session.max_heap_table_size;
-SET @@session.max_heap_table_size = 4294967294;
-SELECT @@session.max_heap_table_size;
-SET @@session.max_heap_table_size = 4294967295;
-SELECT @@session.max_heap_table_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
-
---echo '#------------------FN_DYNVARS_077_05-----------------------#'
-##############################################################
-# Change the value of max_heap_table_size to an invalid value #
-##############################################################
-
-SET @@global.max_heap_table_size = -1;
-SELECT @@global.max_heap_table_size;
-SET @@global.max_heap_table_size = -1024;
-SELECT @@global.max_heap_table_size;
-SET @@global.max_heap_table_size = 1024;
-SELECT @@global.max_heap_table_size;
-SET @@global.max_heap_table_size = 16383;
-SELECT @@global.max_heap_table_size;
-SET @@global.max_heap_table_size = 4294967296;
-SELECT @@global.max_heap_table_size;
---Error ER_PARSE_ERROR
-SET @@global.max_heap_table_size = 65530.34.;
-SELECT @@global.max_heap_table_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_heap_table_size = test;
-SELECT @@global.max_heap_table_size;
-
-SET @@session.max_heap_table_size = -1;
-SELECT @@session.max_heap_table_size;
-SET @@session.max_heap_table_size = 16383;
-SELECT @@session.max_heap_table_size;
-SET @@session.max_heap_table_size = 4294967296;
-SELECT @@session.max_heap_table_size;
---Error ER_PARSE_ERROR
-SET @@session.max_heap_table_size = 65530.34.;
-SET @@session.max_heap_table_size = 10737418241;
-SELECT @@session.max_heap_table_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.max_heap_table_size = test;
-SELECT @@session.max_heap_table_size;
-
-
---echo '#------------------FN_DYNVARS_077_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.max_heap_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_heap_table_size';
-
---echo '#------------------FN_DYNVARS_077_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.max_heap_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_heap_table_size';
-
-
---echo '#------------------FN_DYNVARS_077_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.max_heap_table_size = TRUE;
-SELECT @@global.max_heap_table_size;
-SET @@global.max_heap_table_size = FALSE;
-SELECT @@global.max_heap_table_size;
-
-
---echo '#---------------------FN_DYNVARS_077_09----------------------#'
-#################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-#################################################################################
-
-SET @@global.max_heap_table_size = 163845;
-SELECT @@max_heap_table_size = @@global.max_heap_table_size;
-
-
---echo '#---------------------FN_DYNVARS_077_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@max_heap_table_size = 16777216;
-SELECT @@max_heap_table_size = @@local.max_heap_table_size;
-SELECT @@local.max_heap_table_size = @@session.max_heap_table_size;
-
-
---echo '#---------------------FN_DYNVARS_077_11----------------------#'
-#############################################################################
-#   Check if max_heap_table_size can be accessed with and without @@ sign    #
-#############################################################################
-
-SET max_heap_table_size = 316777216;
-SELECT @@max_heap_table_size;
---Error ER_UNKNOWN_TABLE
-SELECT local.max_heap_table_size;
---Error ER_UNKNOWN_TABLE
-SELECT session.max_heap_table_size;
---Error ER_BAD_FIELD_ERROR
-SELECT max_heap_table_size = @@session.max_heap_table_size;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.max_heap_table_size = @start_global_value;
-SELECT @@global.max_heap_table_size;
-SET @@session.max_heap_table_size = @start_session_value;
-SELECT @@session.max_heap_table_size;
-
-
-#######################################################
-#                 END OF max_heap_table_size TESTS     #
-#######################################################
-
diff --git a/mysql-test/include/max_seeks_for_key_basic.inc b/mysql-test/include/max_seeks_for_key_basic.inc
deleted file mode 100644
index 23c3c5b2a95..00000000000
--- a/mysql-test/include/max_seeks_for_key_basic.inc
+++ /dev/null
@@ -1,213 +0,0 @@
-############## mysql-test\t\max_seeks_for_key_basic.test ###############
-#                                                                             #
-# Variable Name: max_seeks_for_key                                            #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:  4294967295                                                  #
-# Range:  1-4294967295                                                        #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable max_seeks_for_key        #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-#################################################################
-#           START OF max_seeks_for_key TESTS                    #
-#################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.max_seeks_for_key;
-SELECT @start_global_value;
-SET @start_session_value = @@session.max_seeks_for_key;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_083_01-------------------------#'
-#################################################################
-#     Display the DEFAULT value of max_seeks_for_key            #
-#################################################################
-
-SET @@global.max_seeks_for_key = 100;
-SET @@global.max_seeks_for_key = DEFAULT;
-SELECT @@global.max_seeks_for_key;
-
-SET @@session.max_seeks_for_key = 200;
-SET @@session.max_seeks_for_key = DEFAULT;
-SELECT @@session.max_seeks_for_key;
-
-
---echo '#--------------------FN_DYNVARS_083_02-------------------------#'
-#################################################################
-#     Check the DEFAULT value of max_seeks_for_key              #
-#################################################################
-
-SET @@global.max_seeks_for_key = DEFAULT;
-SELECT @@global.max_seeks_for_key = 4294967295;
-
-SET @@session.max_seeks_for_key = DEFAULT;
-SELECT @@session.max_seeks_for_key = 4294967295;
-
-
---echo '#--------------------FN_DYNVARS_083_03-------------------------#'
-###########################################################################
-# Change the value of max_seeks_for_key to a valid value for GLOBAL Scope #
-###########################################################################
-
-SET @@global.max_seeks_for_key = 1;
-SELECT @@global.max_seeks_for_key;
-SET @@global.max_seeks_for_key = 2;
-SELECT @@global.max_seeks_for_key;
-SET @@global.max_seeks_for_key = 65536;
-SELECT @@global.max_seeks_for_key;
-SET @@global.max_seeks_for_key = 4294967295;
-SELECT @@global.max_seeks_for_key;
-SET @@global.max_seeks_for_key = 4294967294;
-SELECT @@global.max_seeks_for_key;
-
-
---echo '#--------------------FN_DYNVARS_083_04-------------------------#'
-############################################################################
-# Change the value of max_seeks_for_key to a valid value for SESSION Scope #
-############################################################################
-SET @@session.max_seeks_for_key = 1;
-SELECT @@session.max_seeks_for_key;
-SET @@session.max_seeks_for_key = 2;
-SELECT @@session.max_seeks_for_key;
-SET @@session.max_seeks_for_key = 4294967295;
-SELECT @@session.max_seeks_for_key;
-SET @@session.max_seeks_for_key = 4294967294;
-SELECT @@session.max_seeks_for_key;
-SET @@session.max_seeks_for_key = 65535;
-SELECT @@session.max_seeks_for_key;
-
-
---echo '#------------------FN_DYNVARS_083_05-----------------------#'
-#############################################################
-# Change the value of max_seeks_for_key to an invalid value #
-#############################################################
-
-SET @@global.max_seeks_for_key = 0;
-SELECT @@global.max_seeks_for_key;
-SET @@global.max_seeks_for_key = -1024;
-SELECT @@global.max_seeks_for_key;
-SET @@global.max_seeks_for_key = 4294967296;
-SELECT @@global.max_seeks_for_key;
---Error ER_PARSE_ERROR
-SET @@global.max_seeks_for_key = 65530.34.;
-SELECT @@global.max_seeks_for_key;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_seeks_for_key = test;
-SELECT @@global.max_seeks_for_key;
-
-SET @@session.max_seeks_for_key = 0;
-SELECT @@session.max_seeks_for_key;
-SET @@session.max_seeks_for_key = -2;
-SELECT @@session.max_seeks_for_key;
---Error ER_PARSE_ERROR
-SET @@session.max_seeks_for_key = 65530.34.;
-SET @@session.max_seeks_for_key = 4294967296;
-SELECT @@session.max_seeks_for_key;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.max_seeks_for_key = test;
-SELECT @@session.max_seeks_for_key;
-
-
---echo '#------------------FN_DYNVARS_083_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.max_seeks_for_key = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_seeks_for_key';
-
---echo '#------------------FN_DYNVARS_083_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.max_seeks_for_key = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_seeks_for_key';
-
-
---echo '#------------------FN_DYNVARS_083_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.max_seeks_for_key = TRUE;
-SELECT @@global.max_seeks_for_key;
-SET @@global.max_seeks_for_key = FALSE;
-SELECT @@global.max_seeks_for_key;
-
-
---echo '#---------------------FN_DYNVARS_083_09----------------------#'
-#################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-#################################################################################
-
-SET @@global.max_seeks_for_key = 10;
-SELECT @@max_seeks_for_key = @@global.max_seeks_for_key;
-
-
---echo '#---------------------FN_DYNVARS_083_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@max_seeks_for_key = 100;
-SELECT @@max_seeks_for_key = @@local.max_seeks_for_key;
-SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key;
-
-
---echo '#---------------------FN_DYNVARS_083_11----------------------#'
-############################################################################  
-#   Check if max_seeks_for_key can be accessed with and without @@ sign    #
-############################################################################
-
-SET max_seeks_for_key = 1;
-SELECT @@max_seeks_for_key;
---Error ER_UNKNOWN_TABLE
-SELECT local.max_seeks_for_key;
---Error ER_UNKNOWN_TABLE
-SELECT session.max_seeks_for_key;
---Error ER_BAD_FIELD_ERROR
-SELECT max_seeks_for_key = @@session.max_seeks_for_key;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.max_seeks_for_key = @start_global_value;
-SELECT @@global.max_seeks_for_key;
-SET @@session.max_seeks_for_key = @start_session_value;
-SELECT @@session.max_seeks_for_key;
-
-
-#############################################################
-#                 END OF max_seeks_for_key TESTS     #
-#############################################################
-
diff --git a/mysql-test/include/max_tmp_tables_basic.inc b/mysql-test/include/max_tmp_tables_basic.inc
deleted file mode 100644
index e24d97f47dd..00000000000
--- a/mysql-test/include/max_tmp_tables_basic.inc
+++ /dev/null
@@ -1,227 +0,0 @@
-############## mysql-test\t\max_tmp_tables_basic.test ###############
-#                                                                             #
-# Variable Name: max_tmp_tables                                               #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 32                                                           #
-# Range: 1-4294967295                                                         #
-#                                                                             # 
-#                                                                             #
-#                                                                             #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable max_tmp_tables           #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-####################################
-#   START OF max_tmp_tables TESTS  #
-####################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.max_tmp_tables;
-SELECT @start_global_value;
-SET @start_session_value = @@session.max_tmp_tables;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_086_01-------------------------#'
-######################################################
-#    Display the DEFAULT value of max_tmp_tables     #
-######################################################
-
-SET @@global.max_tmp_tables = 1000;
-SET @@global.max_tmp_tables = DEFAULT;
-SELECT @@global.max_tmp_tables;
-
-
-SET @@session.max_tmp_tables = 1000;
-SET @@session.max_tmp_tables = DEFAULT;
-SELECT @@session.max_tmp_tables;
-
-
---echo '#--------------------FN_DYNVARS_086_02-------------------------#'
-######################################################
-#     Check the DEFAULT value of max_tmp_tables      #
-######################################################
-
-SET @@global.max_tmp_tables = DEFAULT;
-SELECT @@global.max_tmp_tables = 32;
-
-SET @@session.max_tmp_tables = DEFAULT;
-SELECT @@session.max_tmp_tables = 32;
-
-
-
---echo '#--------------------FN_DYNVARS_086_03-------------------------#'
-########################################################################
-# Change the value of max_tmp_tables to a valid value for GLOBAL Scope #
-########################################################################
-
-SET @@global.max_tmp_tables = 1;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 2;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 65536;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 4294967295;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 4294967294;
-SELECT @@global.max_tmp_tables;
-
---echo '#--------------------FN_DYNVARS_086_04-------------------------#'
-#########################################################################
-# Change the value of max_tmp_tables to a valid value for SESSION Scope #
-#########################################################################
-
-SET @@session.max_tmp_tables = 1;
-SELECT @@session.max_tmp_tables;
-
-SET @@session.max_tmp_tables = 2;
-SELECT @@session.max_tmp_tables;
-
-SET @@session.max_tmp_tables = 65536;
-SELECT @@session.max_tmp_tables;
-
-SET @@session.max_tmp_tables = 4294967295;
-SELECT @@session.max_tmp_tables;
-
-SET @@session.max_tmp_tables = 4294967294;
-SELECT @@session.max_tmp_tables;
-
-
---echo '#------------------FN_DYNVARS_086_05-----------------------#'
-##########################################################
-# Change the value of max_tmp_tables to an invalid value #
-##########################################################
-
-SET @@global.max_tmp_tables = -1024;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 4294967296;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = -1;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 429496729500;
-SELECT @@global.max_tmp_tables;
---Error ER_PARSE_ERROR
-SET @@global.max_tmp_tables = 65530.34.;
-SELECT @@global.max_tmp_tables;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_tmp_tables = test;
-SELECT @@global.max_tmp_tables;
-
-SET @@session.max_tmp_tables = 4294967296;
-SELECT @@session.max_tmp_tables;
-SET @@session.max_tmp_tables = -1;
-SELECT @@session.max_tmp_tables;
-SET @@session.max_tmp_tables = 429496729500;
-SELECT @@session.max_tmp_tables;
-SET @@session.max_tmp_tables = -001;
-SELECT @@session.max_tmp_tables;
---Error ER_PARSE_ERROR
-SET @@session.max_tmp_tables = 65530.34.;
-SET @@session.max_tmp_tables = 10737418241;
-SELECT @@session.max_tmp_tables;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.max_tmp_tables = test;
-SELECT @@session.max_tmp_tables;
-
-
---echo '#------------------FN_DYNVARS_086_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.max_tmp_tables = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_tmp_tables';
-
---echo '#------------------FN_DYNVARS_086_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.max_tmp_tables = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='max_tmp_tables';
-
-
---echo '#------------------FN_DYNVARS_086_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.max_tmp_tables = TRUE;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = FALSE;
-SELECT @@global.max_tmp_tables;
-
-
---echo '#---------------------FN_DYNVARS_086_09----------------------#'
-#################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-#################################################################################
-
-SET @@global.max_tmp_tables = 20;
-SELECT @@max_tmp_tables = @@global.max_tmp_tables;
-
-
---echo '#---------------------FN_DYNVARS_086_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@max_tmp_tables = 255;
-SELECT @@max_tmp_tables = @@local.max_tmp_tables;
-SELECT @@local.max_tmp_tables = @@session.max_tmp_tables;
-
-
---echo '#---------------------FN_DYNVARS_086_11----------------------#'
-#########################################################################
-#   Check if max_tmp_tables can be accessed with and without @@ sign    #
-#########################################################################
-
-
-SET max_tmp_tables = 102;
-SELECT @@max_tmp_tables;
---Error ER_UNKNOWN_TABLE
-SELECT local.max_tmp_tables;
---Error ER_UNKNOWN_TABLE
-SELECT session.max_tmp_tables;
---Error ER_BAD_FIELD_ERROR
-SELECT max_tmp_tables = @@session.max_tmp_tables;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.max_tmp_tables = @start_global_value;
-SELECT @@global.max_tmp_tables;
-SET @@session.max_tmp_tables = @start_session_value;
-SELECT @@session.max_tmp_tables;
-
-
-###################################################
-#                 END OF max_tmp_tables TESTS     #
-###################################################
-
diff --git a/mysql-test/include/max_write_lock_count_basic.inc b/mysql-test/include/max_write_lock_count_basic.inc
deleted file mode 100644
index 80d5b7cc747..00000000000
--- a/mysql-test/include/max_write_lock_count_basic.inc
+++ /dev/null
@@ -1,158 +0,0 @@
-############## mysql-test\t\max_write_lock_count_basic.test ###############
-#                                                                             #
-# Variable Name: max_write_lock_count                                         #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 4294967295                                                   #
-# Range:1-4294967295                                                          #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable max_write_lock_count     #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-##########################################
-#   START OF max_write_lock_count TESTS  #
-##########################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.max_write_lock_count;
-SELECT @start_global_value;
-
-
---echo '#--------------------FN_DYNVARS_088_01-------------------------#'
-############################################################
-#    Display the DEFAULT value of max_write_lock_count     #
-############################################################
-
-SET @@global.max_write_lock_count = 1000;
-SET @@global.max_write_lock_count = DEFAULT;
-SELECT @@global.max_write_lock_count;
-
-
---echo '#--------------------FN_DYNVARS_088_02-------------------------#'
-############################################################
-#     Check the DEFAULT value of max_write_lock_count      #
-############################################################
-
-SET @@global.max_write_lock_count = DEFAULT;
-SELECT @@global.max_write_lock_count = 4294967295;
-
-
---echo '#--------------------FN_DYNVARS_088_03-------------------------#'
-##############################################################################
-# Change the value of max_write_lock_count to a valid value for GLOBAL Scope #
-##############################################################################
-
-SET @@global.max_write_lock_count = 1;
-SELECT @@global.max_write_lock_count;
-SET @@global.max_write_lock_count = 2;
-SELECT @@global.max_write_lock_count;
-SET @@global.max_write_lock_count = 65536;
-SELECT @@global.max_write_lock_count;
-SET @@global.max_write_lock_count = 4294967295;
-SELECT @@global.max_write_lock_count;
-SET @@global.max_write_lock_count = 4294967294;
-SELECT @@global.max_write_lock_count;
-
-
-
---echo '#------------------FN_DYNVARS_088_04-----------------------#'
-################################################################
-# Change the value of max_write_lock_count to an invalid value #
-################################################################
-
-SET @@global.max_write_lock_count = -1024;
-SELECT @@global.max_write_lock_count;
-SET @@global.max_write_lock_count = 4294967296;
-SELECT @@global.max_write_lock_count;
-SET @@global.max_write_lock_count = -1;
-SELECT @@global.max_write_lock_count;
-SET @@global.max_write_lock_count = 429496729500;
-SELECT @@global.max_write_lock_count;
---Error ER_PARSE_ERROR
-SET @@global.max_write_lock_count = 65530.34.;
-SELECT @@global.max_write_lock_count;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_write_lock_count = test;
-SELECT @@global.max_write_lock_count;
-
-
-
---echo '#------------------FN_DYNVARS_088_05-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.max_write_lock_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='max_write_lock_count';
-
-
---echo '#------------------FN_DYNVARS_088_06-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.max_write_lock_count = TRUE;
-SELECT @@global.max_write_lock_count;
-SET @@global.max_write_lock_count = FALSE;
-SELECT @@global.max_write_lock_count;
-
-
---echo '#---------------------FN_DYNVARS_088_07----------------------#'
-#################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-#################################################################################
-
-SET @@global.max_write_lock_count = 20;
-SELECT @@max_write_lock_count = @@global.max_write_lock_count;
-
-
---echo '#---------------------FN_DYNVARS_088_08----------------------#'
-###############################################################################
-#   Check if max_write_lock_count can be accessed with and without @@ sign    #
-###############################################################################
-
-
-SET @@global.max_write_lock_count = 102;
-SELECT @@max_write_lock_count;
---Error ER_UNKNOWN_TABLE
-SELECT local.max_write_lock_count;
---Error ER_UNKNOWN_TABLE
-SELECT global.max_write_lock_count;
---Error ER_BAD_FIELD_ERROR
-SELECT max_write_lock_count = @@global.max_write_lock_count;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.max_write_lock_count = @start_global_value;
-SELECT @@global.max_write_lock_count;
-
-
-###################################################
-#           END OF max_write_lock_count TESTS     #
-###################################################
-
diff --git a/mysql-test/include/min_examined_row_limit_basic.inc b/mysql-test/include/min_examined_row_limit_basic.inc
deleted file mode 100644
index c032d4a9d6d..00000000000
--- a/mysql-test/include/min_examined_row_limit_basic.inc
+++ /dev/null
@@ -1,219 +0,0 @@
-############## mysql-test\t\min_examined_row_limit_basic.test ###############
-#                                                                             #
-# Variable Name: min_examined_row_limit                                       #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:  0                                                           #
-# Range:0-4294967295                                                          #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable min_examined_row_limit   #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-######################################################################
-#           START OF min_examined_row_limit TESTS                    #
-######################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.min_examined_row_limit;
-SELECT @start_global_value;
-SET @start_session_value = @@session.min_examined_row_limit;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_089_01-------------------------#'
-######################################################################
-#     Display the DEFAULT value of min_examined_row_limit            #
-######################################################################
-
-SET @@global.min_examined_row_limit = 100;
-SET @@global.min_examined_row_limit = DEFAULT;
-SELECT @@global.min_examined_row_limit;
-
-SET @@session.min_examined_row_limit = 200;
-SET @@session.min_examined_row_limit = DEFAULT;
-SELECT @@session.min_examined_row_limit;
-
-
---echo '#--------------------FN_DYNVARS_089_02-------------------------#'
-########################################################################
-#     Check the DEFAULT value of min_examined_row_limit              #
-########################################################################
-
-SET @@global.min_examined_row_limit = DEFAULT;
-SELECT @@global.min_examined_row_limit = 0;
-
-SET @@session.min_examined_row_limit = DEFAULT;
-SELECT @@session.min_examined_row_limit = 0;
-
-
---echo '#--------------------FN_DYNVARS_089_03-------------------------#'
-################################################################################
-# Change the value of min_examined_row_limit to a valid value for GLOBAL Scope #
-################################################################################
-
-SET @@global.min_examined_row_limit = 0;
-SELECT @@global.min_examined_row_limit;
-SET @@global.min_examined_row_limit = 1;
-SELECT @@global.min_examined_row_limit;
-SET @@global.min_examined_row_limit = 60020;
-SELECT @@global.min_examined_row_limit;
-SET @@global.min_examined_row_limit = 65535;
-SELECT @@global.min_examined_row_limit;
-SET @@global.min_examined_row_limit = 4294967295;
-SELECT @@global.min_examined_row_limit;
-SET @@global.min_examined_row_limit = 4294967294;
-SELECT @@global.min_examined_row_limit;
-
-
-
---echo '#--------------------FN_DYNVARS_089_04-------------------------#'
-###################################################################################
-# Change the value of min_examined_row_limit to a valid value for SESSION Scope #
-###################################################################################
- 
-SET @@session.min_examined_row_limit = 0;
-SELECT @@session.min_examined_row_limit;
-SET @@session.min_examined_row_limit = 1;
-SELECT @@session.min_examined_row_limit;
-SET @@session.min_examined_row_limit = 50050;
-SELECT @@session.min_examined_row_limit;
-SET @@session.min_examined_row_limit = 65535;
-SELECT @@session.min_examined_row_limit;
-SET @@session.min_examined_row_limit = 4294967295;
-SELECT @@session.min_examined_row_limit;
-SET @@session.min_examined_row_limit = 4294967294;
-SELECT @@session.min_examined_row_limit;
-
-
---echo '#------------------FN_DYNVARS_089_05-----------------------#'
-####################################################################
-# Change the value of min_examined_row_limit to an invalid value #
-####################################################################
-
-SET @@global.min_examined_row_limit = 429496726;
-SELECT @@global.min_examined_row_limit;
-SET @@global.min_examined_row_limit = -1024;
-SELECT @@global.min_examined_row_limit;
-SET @@global.min_examined_row_limit = 429496729500;
-SELECT @@global.min_examined_row_limit;
---Error ER_PARSE_ERROR
-SET @@global.min_examined_row_limit = 65530.34.;
-SELECT @@global.min_examined_row_limit;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.min_examined_row_limit = test;
-SELECT @@global.min_examined_row_limit;
-
-SET @@session.min_examined_row_limit = 4294967296;
-SELECT @@session.min_examined_row_limit;
-SET @@session.min_examined_row_limit = -1;
-SELECT @@session.min_examined_row_limit;
---Error ER_PARSE_ERROR
-SET @@session.min_examined_row_limit = 65530.34.;
-SET @@session.min_examined_row_limit = 4294967295021;
-SELECT @@session.min_examined_row_limit;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.min_examined_row_limit = test;
-SELECT @@session.min_examined_row_limit;
-
-
---echo '#------------------FN_DYNVARS_089_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.min_examined_row_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='min_examined_row_limit';
-
---echo '#------------------FN_DYNVARS_089_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.min_examined_row_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='min_examined_row_limit';
-
-
---echo '#------------------FN_DYNVARS_089_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.min_examined_row_limit = TRUE;
-SELECT @@global.min_examined_row_limit;
-SET @@global.min_examined_row_limit = FALSE;
-SELECT @@global.min_examined_row_limit;
-
-
---echo '#---------------------FN_DYNVARS_089_09----------------------#'
-#################################################################################### 
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-#################################################################################### 
-
-SET @@global.min_examined_row_limit = 10;
-SELECT @@min_examined_row_limit = @@global.min_examined_row_limit;
-
-
---echo '#---------------------FN_DYNVARS_089_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@min_examined_row_limit = 100;
-SELECT @@min_examined_row_limit = @@local.min_examined_row_limit;
-SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit;
-
-
---echo '#---------------------FN_DYNVARS_089_11----------------------#'
-###################################################################################  
-#   Check if min_examined_row_limit can be accessed with and without @@ sign    #
-###################################################################################
-
-SET min_examined_row_limit = 1;
-SELECT @@min_examined_row_limit;
---Error ER_UNKNOWN_TABLE
-SELECT local.min_examined_row_limit;
---Error ER_UNKNOWN_TABLE
-SELECT session.min_examined_row_limit;
---Error ER_BAD_FIELD_ERROR
-SELECT min_examined_row_limit = @@session.min_examined_row_limit;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.min_examined_row_limit = @start_global_value;
-SELECT @@global.min_examined_row_limit;
-SET @@session.min_examined_row_limit = @start_session_value;
-SELECT @@session.min_examined_row_limit;
-
-
-#############################################################
-#                 END OF min_examined_row_limit TESTS     #
-#############################################################
-
diff --git a/mysql-test/include/multi_range_count_basic.inc b/mysql-test/include/multi_range_count_basic.inc
deleted file mode 100644
index 47e8352196f..00000000000
--- a/mysql-test/include/multi_range_count_basic.inc
+++ /dev/null
@@ -1,219 +0,0 @@
-############## mysql-test\t\multi_range_count_basic.test ###############
-#                                                                             #
-# Variable Name: multi_range_count                                            #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:  256                                                         #
-# Range:1-4294967295                                                          #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable multi_range_count        #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-#################################################################
-#           START OF multi_range_count TESTS                    #
-#################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.multi_range_count;
-SELECT @start_global_value;
-SET @start_session_value = @@session.multi_range_count;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_090_01-------------------------#'
-#################################################################
-#     Display the DEFAULT value of multi_range_count            #
-#################################################################
-
-SET @@global.multi_range_count = 100;
-SET @@global.multi_range_count = DEFAULT;
-SELECT @@global.multi_range_count;
-
-SET @@session.multi_range_count = 200;
-SET @@session.multi_range_count = DEFAULT;
-SELECT @@session.multi_range_count;
-
-
---echo '#--------------------FN_DYNVARS_090_02-------------------------#'
-#################################################################
-#     Check the DEFAULT value of multi_range_count              #
-#################################################################
-
-SET @@global.multi_range_count = DEFAULT;
-SELECT @@global.multi_range_count = 256;
-
-SET @@session.multi_range_count = DEFAULT;
-SELECT @@session.multi_range_count = 256;
-
-
---echo '#--------------------FN_DYNVARS_090_03-------------------------#'
-###########################################################################
-# Change the value of multi_range_count to a valid value for GLOBAL Scope #
-###########################################################################
-
-SET @@global.multi_range_count = 1;
-SELECT @@global.multi_range_count;
-SET @@global.multi_range_count = 60020;
-SELECT @@global.multi_range_count;
-SET @@global.multi_range_count = 65535;
-SELECT @@global.multi_range_count;
-SET @@global.multi_range_count = 4294967295;
-SELECT @@global.multi_range_count;
-SET @@global.multi_range_count = 4294967294;
-SELECT @@global.multi_range_count;
-
-
-
---echo '#--------------------FN_DYNVARS_090_04-------------------------#'
-############################################################################
-# Change the value of multi_range_count to a valid value for SESSION Scope #
-############################################################################
- 
-SET @@session.multi_range_count = 1;
-SELECT @@session.multi_range_count;
-SET @@session.multi_range_count = 50050;
-SELECT @@session.multi_range_count;
-SET @@session.multi_range_count = 65535;
-SELECT @@session.multi_range_count;
-SET @@session.multi_range_count = 4294967295;
-SELECT @@session.multi_range_count;
-SET @@session.multi_range_count = 4294967294;
-SELECT @@session.multi_range_count;
-
-
---echo '#------------------FN_DYNVARS_090_05-----------------------#'
-#############################################################
-# Change the value of multi_range_count to an invalid value #
-#############################################################
-
-SET @@global.multi_range_count = 0;
-SELECT @@global.multi_range_count;
-SET @@global.multi_range_count = 4294967296;
-SELECT @@global.multi_range_count;
-SET @@global.multi_range_count = -1024;
-SELECT @@global.multi_range_count;
-SET @@global.multi_range_count = 429496729500;
-SELECT @@global.multi_range_count;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.multi_range_count = 65530.34;
-SELECT @@global.multi_range_count;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.multi_range_count = test;
-SELECT @@global.multi_range_count;
-
-SET @@session.multi_range_count = 0;
-SELECT @@session.multi_range_count;
-SET @@session.multi_range_count = 4294967296;
-SELECT @@session.multi_range_count;
-SET @@session.multi_range_count = -1;
-SELECT @@session.multi_range_count;
---Error ER_PARSE_ERROR
-SET @@session.multi_range_count = 65530.34.;
-SET @@session.multi_range_count = 4294967295021;
-SELECT @@session.multi_range_count;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.multi_range_count = test;
-SELECT @@session.multi_range_count;
-
-
---echo '#------------------FN_DYNVARS_090_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.multi_range_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='multi_range_count';
-
---echo '#------------------FN_DYNVARS_090_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.multi_range_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='multi_range_count';
-
-
---echo '#------------------FN_DYNVARS_090_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.multi_range_count = TRUE;
-SELECT @@global.multi_range_count;
-SET @@global.multi_range_count = FALSE;
-SELECT @@global.multi_range_count;
-
-
---echo '#---------------------FN_DYNVARS_090_09----------------------#'
-################################################################################# 
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-################################################################################# 
-
-SET @@global.multi_range_count = 10;
-SELECT @@multi_range_count = @@global.multi_range_count;
-
-
---echo '#---------------------FN_DYNVARS_090_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@multi_range_count = 100;
-SELECT @@multi_range_count = @@local.multi_range_count;
-SELECT @@local.multi_range_count = @@session.multi_range_count;
-
-
---echo '#---------------------FN_DYNVARS_090_11----------------------#'
-############################################################################  
-#   Check if multi_range_count can be accessed with and without @@ sign    #
-############################################################################
-
-SET multi_range_count = 1;
-SELECT @@multi_range_count;
---Error ER_UNKNOWN_TABLE
-SELECT local.multi_range_count;
---Error ER_UNKNOWN_TABLE
-SELECT session.multi_range_count;
---Error ER_BAD_FIELD_ERROR
-SELECT multi_range_count = @@session.multi_range_count;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.multi_range_count = @start_global_value;
-SELECT @@global.multi_range_count;
-SET @@session.multi_range_count = @start_session_value;
-SELECT @@session.multi_range_count;
-
-
-######################################################
-#                 END OF multi_range_count TESTS     #
-######################################################
-
diff --git a/mysql-test/include/myisam_max_sort_file_size_basic.inc b/mysql-test/include/myisam_max_sort_file_size_basic.inc
deleted file mode 100644
index 23f0607b439..00000000000
--- a/mysql-test/include/myisam_max_sort_file_size_basic.inc
+++ /dev/null
@@ -1,184 +0,0 @@
-
-############## mysql-test\t\myisam_max_sort_file_size_basic.test ################
-#                                                                              #
-# Variable Name: myisam_max_sort_file_size                                      #
-# Scope: GLOBAL & SESSION                                                      #
-# Access Type: Dynamic                                                         #
-# Data Type: Numeric                                                           #
-# Default Value: 1                                                             #
-# Range: 1 - 65536                                                             #
-#                                                                              #
-#                                                                              #
-# Creation Date: 2008-02-07                                                    #
-# Author:  Rizwan Maredia                                                      #
-#                                                                              #
-# Description: Test Cases of Dynamic System Variable myisam_max_sort_file_size  #
-#              that checks the behavior of this variable in the following ways #
-#              * Default Value                                                 #
-#              * Valid & Invalid values                                        #
-#              * Scope & Access method                                         #
-#              * Data Integrity                                                #
-#                                                                              #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
-#  server-system-variables.html                                                #
-#                                                                              #
-################################################################################
-
---source include/load_sysvars.inc
-
-###################################################################
-#           START OF myisam_max_sort_file_size TESTS              #
-###################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.myisam_max_sort_file_size;
-SELECT @start_global_value;
-
---echo '#--------------------FN_DYNVARS_094_01-------------------------#'
-###################################################################
-#     Display the DEFAULT value of myisam_max_sort_file_size      #
-###################################################################
-
-SET @@global.myisam_max_sort_file_size = 500000;
-SET @@global.myisam_max_sort_file_size = DEFAULT;
-SELECT @@global.myisam_max_sort_file_size;
-
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
---echo '#--------------------FN_DYNVARS_094_02-------------------------#'
-###################################################################
-#     Check the DEFAULT value of myisam_max_sort_file_size         #
-###################################################################
-
-SET @@global.myisam_max_sort_file_size = DEFAULT;
-SELECT @@global.myisam_max_sort_file_size = 2147483648;
-
---echo '#--------------------FN_DYNVARS_094_03-------------------------#'
-##################################################################################
-# Change the value of myisam_max_sort_file_size to a valid value for GLOBAL Scope #
-##################################################################################
-
-SET @@global.myisam_max_sort_file_size = 0;
-SELECT @@global.myisam_max_sort_file_size;
-SET @@global.myisam_max_sort_file_size = 1024;
-SELECT @@global.myisam_max_sort_file_size;
-SET @@global.myisam_max_sort_file_size = 123456789;
-SELECT @@global.myisam_max_sort_file_size;
-SET @@global.myisam_max_sort_file_size = 2147483648*2;
-SELECT @@global.myisam_max_sort_file_size;
-SET @@global.myisam_max_sort_file_size = 2147483648*1024;
-SELECT @@global.myisam_max_sort_file_size;
-SELECT @@global.myisam_max_sort_file_size;
-SET @@global.myisam_max_sort_file_size = 2147483648*2147483648;
-
---echo '#--------------------FN_DYNVARS_094_04-------------------------#'
-#################################################################################
-#           Check if variable can be access with session scope                  #
-#################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET @@myisam_max_sort_file_size = 2;
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.myisam_max_sort_file_size = 3;
-
---Error ER_GLOBAL_VARIABLE
-SET @@local.myisam_max_sort_file_size = 4;
-
-
-
---echo '#------------------FN_DYNVARS_094_05-----------------------#'
-####################################################################
-# Change the value of myisam_max_sort_file_size to an invalid value #
-####################################################################
-
-SET @@global.myisam_max_sort_file_size = -1;
-SELECT @@global.myisam_max_sort_file_size;
-SET @@global.myisam_max_sort_file_size = -2147483648;
-SELECT @@global.myisam_max_sort_file_size;
-SET @@global.myisam_max_sort_file_size = -2147483649;
-SELECT @@global.myisam_max_sort_file_size;
---Error ER_PARSE_ERROR
-SET @@global.myisam_max_sort_file_size = 65530.34.;
-SELECT @@global.myisam_max_sort_file_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.myisam_max_sort_file_size = 2147483649.56;
-SELECT @@global.myisam_max_sort_file_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.myisam_max_sort_file_size = 1G;
-
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-
---echo '#------------------FN_DYNVARS_094_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-SET @@global.myisam_max_sort_file_size = 3000;
-SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='myisam_max_sort_file_size';
-
-
---echo '#------------------FN_DYNVARS_094_07-----------------------#'
-###########################################################################
-#  Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES  #
-###########################################################################
-
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='myisam_max_sort_file_size';
-
-
---echo '#------------------FN_DYNVARS_094_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.myisam_max_sort_file_size = TRUE;
-SELECT @@global.myisam_max_sort_file_size;
-SET @@global.myisam_max_sort_file_size = FALSE;
-SELECT @@global.myisam_max_sort_file_size;
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-#################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-################################################################################# 
-
-
-SET @@global.myisam_max_sort_file_size = 512;
-SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size;
-
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-##################################################################################
-#   Check if myisam_max_sort_file_size can be accessed without @@ sign and scope #
-##################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET myisam_max_sort_file_size = 2048;
---Error ER_BAD_FIELD_ERROR
-SELECT myisam_max_sort_file_size;
-
-SELECT @@myisam_max_sort_file_size;
-
-#verifying another syntax for setting value#
-SET global myisam_max_sort_file_size = 64;
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.myisam_max_sort_file_size = @start_global_value;
-SELECT @@global.myisam_max_sort_file_size;
-
-########################################################
-#              END OF myisam_max_sort_file_size TESTS  #
-########################################################
-
diff --git a/mysql-test/include/myisam_repair_threads_basic.inc b/mysql-test/include/myisam_repair_threads_basic.inc
deleted file mode 100644
index 8485e79ff03..00000000000
--- a/mysql-test/include/myisam_repair_threads_basic.inc
+++ /dev/null
@@ -1,242 +0,0 @@
-############## mysql-test\t\myisam_repair_threads_basic.test ##################
-#                                                                             #
-# Variable Name: myisam_repair_threads                                        #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 1                                                            #
-# Range:  1-4294967295                                                        #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Sharique Abdullah                                                      #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable myisam_repair_threads    #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-######################################################################
-#           START OF myisam_repair_threads  TESTS                    #
-######################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.myisam_repair_threads;
-SELECT @start_global_value;
-SET @start_session_value = @@session.myisam_repair_threads;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_005_01-------------------------#'
-#################################################################
-#     Display the DEFAULT value of myisam_block_size            #
-#################################################################
-
-SET @@global.myisam_repair_threads  = 100;
-SET @@global.myisam_repair_threads  = DEFAULT;
-SELECT @@global.myisam_repair_threads ;
-
-SET @@session.myisam_repair_threads  = 200;
-SET @@session.myisam_repair_threads  = DEFAULT;
-SELECT @@session.myisam_repair_threads ;
-
-
---echo '#--------------------FN_DYNVARS_005_02-------------------------#'
-######################################################################
-#     Check the DEFAULT value of myisam_repair_threads               #
-######################################################################
-
-SET @@global.myisam_repair_threads  = DEFAULT;
-SELECT @@global.myisam_repair_threads  = 1;
-
-SET @@session.myisam_repair_threads  = DEFAULT;
-SELECT @@session.myisam_repair_threads  = 1;
-
-
---echo '#--------------------FN_DYNVARS_005_03-------------------------#'
-###############################################################################
-# Change the value of myisam_repair_threads  to a valid value for GLOBAL Scope#
-###############################################################################
-
-SET @@global.myisam_repair_threads  = 1;
-SELECT @@global.myisam_repair_threads ;
-
-SET @@global.myisam_repair_threads  = 4294967295;
-SELECT @@global.myisam_repair_threads ;
-
-SET @@global.myisam_repair_threads  = 655354;
-SELECT @@global.myisam_repair_threads ;
-
-
---echo '#--------------------FN_DYNVARS_005_04-------------------------#'
-###############################################################################
-# Change the value of myisam_repair_threads  to a valid value for SESSION
-# Scope 
-###############################################################################
- 
-SET @@session.myisam_repair_threads  = 1;
-SELECT @@session.myisam_repair_threads ;
-
-SET @@session.myisam_repair_threads  = 4294967295;
-SELECT @@session.myisam_repair_threads ;
-
-SET @@session.myisam_repair_threads  = 655345;
-SELECT @@session.myisam_repair_threads ;
-
-
-
-
---echo '#------------------FN_DYNVARS_005_05-----------------------#'
-##################################################################
-# Change the value of myisam_repair_threads  to an invalid value #
-##################################################################
-
-SET @@global.myisam_repair_threads  = 0;
-SELECT @@global.myisam_repair_threads ;
-
-SET @@global.myisam_repair_threads  = -1024;
-SELECT @@global.myisam_repair_threads ;
-
-SET @@global.myisam_repair_threads  = 429496729533;
-SELECT @@global.myisam_repair_threads ;
-
-
---Error ER_PARSE_ERROR
-SET @@global.myisam_repair_threads  = 65530.34.;
-SELECT @@global.myisam_repair_threads ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.myisam_repair_threads  = test;
-SELECT @@global.myisam_repair_threads ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.myisam_repair_threads  = "test";
-SELECT @@global.myisam_repair_threads ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.myisam_repair_threads  = 'test';
-SELECT @@global.myisam_repair_threads ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.myisam_repair_threads  = ON;
-SELECT @@global.myisam_repair_threads ;
-
-
-SET @@session.myisam_repair_threads  = 0;
-SELECT @@session.myisam_repair_threads ;
-
-SET @@session.myisam_repair_threads  = -2;
-SELECT @@session.myisam_repair_threads ;
-
---Error ER_PARSE_ERROR
-
-SET @@session.myisam_repair_threads  = 65530.34.;
-SELECT @@session.myisam_repair_threads ;
-
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.myisam_repair_threads  = test;
-SELECT @@session.myisam_repair_threads ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.myisam_repair_threads  = "test";
-SELECT @@session.myisam_repair_threads ;
-
-
---echo '#------------------FN_DYNVARS_005_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.myisam_repair_threads  = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='myisam_repair_threads ';
-
---echo '#------------------FN_DYNVARS_005_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.myisam_repair_threads  = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='myisam_repair_threads ';
-
-
---echo '#------------------FN_DYNVARS_005_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.myisam_repair_threads  = TRUE;
-SELECT @@global.myisam_repair_threads ;
-SET @@global.myisam_repair_threads  = FALSE;
-SELECT @@global.myisam_repair_threads ;
-
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-###############################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable #
-###############################################################################
-
-SET @@global.myisam_repair_threads  = 10;
-SELECT @@myisam_repair_threads  = @@global.myisam_repair_threads ;
-
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to
-#    same session variable  #
-########################################################################################################
-
-SET @@myisam_repair_threads  = 100;
-SELECT @@myisam_repair_threads  = @@local.myisam_repair_threads ;
-SELECT @@local.myisam_repair_threads  = @@session.myisam_repair_threads ;
-
-
---echo '#---------------------FN_DYNVARS_001_11----------------------#'
-###################################################################################  
-#   Check if myisam_repair_threads  can be accessed with and without @@ sign    #
-###################################################################################
-
-SET myisam_repair_threads  = 1;
-SELECT @@myisam_repair_threads ;
---Error ER_UNKNOWN_TABLE
-
-SELECT local.myisam_repair_threads ;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.myisam_repair_threads ;
-
---Error ER_BAD_FIELD_ERROR
-SELECT myisam_repair_threads  = @@session.myisam_repair_threads ;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.myisam_repair_threads  = @start_global_value;
-SELECT @@global.myisam_repair_threads ;
-SET @@session.myisam_repair_threads  = @start_session_value;
-SELECT @@session.myisam_repair_threads ;
-
-
-#############################################################
-#                 END OF myisam_repair_threads  TESTS     #
-#############################################################
-
diff --git a/mysql-test/include/myisam_sort_buffer_size_basic.inc b/mysql-test/include/myisam_sort_buffer_size_basic.inc
deleted file mode 100644
index 8e36d8a2c70..00000000000
--- a/mysql-test/include/myisam_sort_buffer_size_basic.inc
+++ /dev/null
@@ -1,240 +0,0 @@
-############## mysql-test\t\myisam_sort_buffer_size_basic.test ###############
-#                                                                             #
-# Variable Name: myisam_sort_buffer_size                                     #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                        #
-# Default Value:                                                              #
-# Range:                                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Rizwan                                                     #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable myisam_sort_buffer_size #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-########################################################################
-#           START OF myisam_sort_buffer_size   TESTS                    #
-########################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.myisam_sort_buffer_size ;
-SELECT @start_global_value;
-SET @start_session_value = @@session.myisam_sort_buffer_size ;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_005_01-------------------------#'
-########################################################################
-#     Display the DEFAULT value of myisam_block_size            #
-########################################################################
-
-SET @@global.myisam_sort_buffer_size   = 100;
-SET @@global.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size  ;
-
-SET @@session.myisam_sort_buffer_size   = 200;
-SET @@session.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size  ;
-
-
---echo '#--------------------FN_DYNVARS_005_02-------------------------#'
-########################################################################
-#     Check the DEFAULT value of myisam_sort_buffer_size                #
-########################################################################
-
-SET @@global.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@global.myisam_sort_buffer_size   = 8388608;
-
-SET @@session.myisam_sort_buffer_size   = DEFAULT;
-SELECT @@session.myisam_sort_buffer_size   = 8388608;
-
-
---echo '#--------------------FN_DYNVARS_005_03-------------------------#'
-##################################################################################
-# Change the value of myisam_sort_buffer_size   to a valid value for GLOBAL Scope #
-##################################################################################
-
-SET @@global.myisam_sort_buffer_size   = 4;
-SELECT @@global.myisam_sort_buffer_size  ;
-
-SET @@global.myisam_sort_buffer_size   = 4294967295;
-SELECT @@global.myisam_sort_buffer_size  ;
-
-SET @@global.myisam_sort_buffer_size   = 655354;
-SELECT @@global.myisam_sort_buffer_size  ;
-
-
---echo '#--------------------FN_DYNVARS_005_04-------------------------#'
-###################################################################################
-# Change the value of myisam_sort_buffer_size   to a valid value for SESSION Scope #
-###################################################################################
- 
-SET @@session.myisam_sort_buffer_size   = 4;
-SELECT @@session.myisam_sort_buffer_size  ;
-
-SET @@session.myisam_sort_buffer_size   = 4294967295;
-SELECT @@session.myisam_sort_buffer_size  ;
-
-SET @@session.myisam_sort_buffer_size   = 655345;
-SELECT @@session.myisam_sort_buffer_size  ;
-
-
-
-
---echo '#------------------FN_DYNVARS_005_05-----------------------#'
-####################################################################
-# Change the value of myisam_sort_buffer_size   to an invalid value #
-####################################################################
-
-SET @@global.myisam_sort_buffer_size   = 0;
-SELECT @@global.myisam_sort_buffer_size  ;
-
-SET @@global.myisam_sort_buffer_size   = -1024;
-SELECT @@global.myisam_sort_buffer_size  ;
-
-SET @@global.myisam_sort_buffer_size   = 429496729533;
-SELECT @@global.myisam_sort_buffer_size  ;
-
-
---Error ER_PARSE_ERROR
-SET @@global.myisam_sort_buffer_size   = 65530.34.;
-SELECT @@global.myisam_sort_buffer_size  ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.myisam_sort_buffer_size   = test;
-SELECT @@global.myisam_sort_buffer_size  ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.myisam_sort_buffer_size   = "test";
-SELECT @@global.myisam_sort_buffer_size  ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.myisam_sort_buffer_size   = 'test';
-SELECT @@global.myisam_sort_buffer_size  ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.myisam_sort_buffer_size   = ON;
-SELECT @@global.myisam_sort_buffer_size  ;
-
-
-SET @@session.myisam_sort_buffer_size   = 0;
-SELECT @@session.myisam_sort_buffer_size  ;
-
-SET @@session.myisam_sort_buffer_size   = -2;
-SELECT @@session.myisam_sort_buffer_size  ;
-
---Error ER_PARSE_ERROR
-
-SET @@session.myisam_sort_buffer_size   = 65530.34.;
-SELECT @@session.myisam_sort_buffer_size  ;
-
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.myisam_sort_buffer_size   = test;
-SELECT @@session.myisam_sort_buffer_size  ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.myisam_sort_buffer_size   = "test";
-SELECT @@session.myisam_sort_buffer_size  ;
-
-
---echo '#------------------FN_DYNVARS_005_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.myisam_sort_buffer_size   = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
-
---echo '#------------------FN_DYNVARS_005_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.myisam_sort_buffer_size   = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
-
-
---echo '#------------------FN_DYNVARS_005_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.myisam_sort_buffer_size   = TRUE;
-SELECT @@global.myisam_sort_buffer_size  ;
-SET @@global.myisam_sort_buffer_size   = FALSE;
-SELECT @@global.myisam_sort_buffer_size  ;
-
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-#################################################################################### 
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-#################################################################################### 
-
-SET @@global.myisam_sort_buffer_size   = 10;
-SELECT @@myisam_sort_buffer_size   = @@global.myisam_sort_buffer_size  ;
-
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@myisam_sort_buffer_size   = 100;
-SELECT @@myisam_sort_buffer_size   = @@local.myisam_sort_buffer_size  ;
-SELECT @@local.myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
-
-
---echo '#---------------------FN_DYNVARS_001_11----------------------#'
-###################################################################################  
-#   Check if myisam_sort_buffer_size   can be accessed with and without @@ sign    #
-###################################################################################
-
-SET myisam_sort_buffer_size   = 1;
-SELECT @@myisam_sort_buffer_size  ;
---Error ER_UNKNOWN_TABLE
-
-SELECT local.myisam_sort_buffer_size  ;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.myisam_sort_buffer_size  ;
-
---Error ER_BAD_FIELD_ERROR
-SELECT myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.myisam_sort_buffer_size   = @start_global_value;
-SELECT @@global.myisam_sort_buffer_size  ;
-SET @@session.myisam_sort_buffer_size   = @start_session_value;
-SELECT @@session.myisam_sort_buffer_size  ;
-
-
-#############################################################
-#                 END OF myisam_sort_buffer_size   TESTS     #
-#############################################################
-
diff --git a/mysql-test/include/net_retry_count_basic.inc b/mysql-test/include/net_retry_count_basic.inc
deleted file mode 100644
index 537d8eea6c6..00000000000
--- a/mysql-test/include/net_retry_count_basic.inc
+++ /dev/null
@@ -1,217 +0,0 @@
-############## mysql-test\t\net_retry_count_basic.test ###############
-#                                                                             #
-# Variable Name: net_retry_count                                              #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:10                                                            #
-# Range: 1-4294967295                                                         #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable net_retry_count          #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-###############################################################
-#           START OF net_retry_count TESTS                    #
-###############################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.net_retry_count;
-SELECT @start_global_value;
-SET @start_session_value = @@session.net_retry_count;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_111_01-------------------------#'
-###############################################################
-#     Display the DEFAULT value of net_retry_count            #
-###############################################################
-
-SET @@global.net_retry_count = 100;
-SET @@global.net_retry_count = DEFAULT;
-SELECT @@global.net_retry_count;
-
-SET @@session.net_retry_count = 200;
-SET @@session.net_retry_count = DEFAULT;
-SELECT @@session.net_retry_count;
-
-
---echo '#--------------------FN_DYNVARS_111_02-------------------------#'
-###############################################################
-#     Check the DEFAULT value of net_retry_count              #
-###############################################################
-
-SET @@global.net_retry_count = DEFAULT;
-SELECT @@global.net_retry_count = 10;
-
-SET @@session.net_retry_count = DEFAULT;
-SELECT @@session.net_retry_count = 10;
-
-
---echo '#--------------------FN_DYNVARS_111_03-------------------------#'
-#########################################################################
-# Change the value of net_retry_count to a valid value for GLOBAL Scope #
-#########################################################################
-
-SET @@global.net_retry_count = 1;
-SELECT @@global.net_retry_count;
-SET @@global.net_retry_count = 2;
-SELECT @@global.net_retry_count;
-SET @@global.net_retry_count = 4294967295;
-SELECT @@global.net_retry_count;
-SET @@global.net_retry_count = 4294967294;
-SELECT @@global.net_retry_count;
-SET @@global.net_retry_count = 65536;
-SELECT @@global.net_retry_count;
-
---echo '#--------------------FN_DYNVARS_111_04-------------------------#'
-##########################################################################
-# Change the value of net_retry_count to a valid value for SESSION Scope #
-##########################################################################
- 
-SET @@session.net_retry_count = 1;
-SELECT @@session.net_retry_count;
-SET @@session.net_retry_count = 2;
-SELECT @@session.net_retry_count;
-SET @@session.net_retry_count = 65535;
-SELECT @@session.net_retry_count;
-SET @@session.net_retry_count = 4294967295;
-SELECT @@session.net_retry_count;
-SET @@session.net_retry_count = 4294967294;
-SELECT @@session.net_retry_count;
-
---echo '#------------------FN_DYNVARS_111_05-----------------------#'
-###########################################################
-# Change the value of net_retry_count to an invalid value #
-###########################################################
-
-SET @@global.net_retry_count = 0;
-SELECT @@global.net_retry_count;
-SET @@global.net_retry_count = -1024;
-SELECT @@global.net_retry_count;
-SET @@global.net_retry_count = 4294967296;
-SELECT @@global.net_retry_count;
-SET @@global.net_retry_count = 429496729500;
-SELECT @@global.net_retry_count;
---Error ER_PARSE_ERROR
-SET @@global.net_retry_count = 65530.34.;
-SELECT @@global.net_retry_count;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.net_retry_count = test;
-SELECT @@global.net_retry_count;
-
-SET @@session.net_retry_count = 0;
-SELECT @@session.net_retry_count;
-SET @@session.net_retry_count = -2;
-SELECT @@session.net_retry_count;
---Error ER_PARSE_ERROR
-SET @@session.net_retry_count = 65530.34.;
-SET @@session.net_retry_count = 6555015425;
-SELECT @@session.net_retry_count;
-SET @@session.net_retry_count = 4294967296;
-SELECT @@session.net_retry_count;
-
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.net_retry_count = test;
-SELECT @@session.net_retry_count;
-
-
---echo '#------------------FN_DYNVARS_111_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.net_retry_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='net_retry_count';
-
---echo '#------------------FN_DYNVARS_111_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.net_retry_count = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='net_retry_count';
-
-
---echo '#------------------FN_DYNVARS_111_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.net_retry_count = TRUE;
-SELECT @@global.net_retry_count;
-SET @@global.net_retry_count = FALSE;
-SELECT @@global.net_retry_count;
-
-
---echo '#---------------------FN_DYNVARS_111_09----------------------#'
-################################################################################# 
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-################################################################################# 
-
-SET @@global.net_retry_count = 10;
-SELECT @@net_retry_count = @@global.net_retry_count;
-
-
---echo '#---------------------FN_DYNVARS_111_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@net_retry_count = 100;
-SELECT @@net_retry_count = @@local.net_retry_count;
-SELECT @@local.net_retry_count = @@session.net_retry_count;
-
-
---echo '#---------------------FN_DYNVARS_111_11----------------------#'
-##########################################################################
-#   Check if net_retry_count can be accessed with and without @@ sign    #
-##########################################################################
-
-SET net_retry_count = 1;
-SELECT @@net_retry_count;
---Error ER_UNKNOWN_TABLE
-SELECT local.net_retry_count;
---Error ER_UNKNOWN_TABLE
-SELECT session.net_retry_count;
---Error ER_BAD_FIELD_ERROR
-SELECT net_retry_count = @@session.net_retry_count;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.net_retry_count = @start_global_value;
-SELECT @@global.net_retry_count;
-SET @@session.net_retry_count = @start_session_value;
-SELECT @@session.net_retry_count;
-
-
-####################################################
-#                 END OF net_retry_count TESTS     #
-####################################################
-
diff --git a/mysql-test/include/query_alloc_block_size_basic.inc b/mysql-test/include/query_alloc_block_size_basic.inc
deleted file mode 100644
index 208fe6b3da4..00000000000
--- a/mysql-test/include/query_alloc_block_size_basic.inc
+++ /dev/null
@@ -1,225 +0,0 @@
-############## mysql-test\t\query_alloc_block_size_basic.test ###############
-#                                                                             #
-# Variable Name: query_alloc_block_size                                       #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:  8192                                                        #
-# Range: 1024-4294967295                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable query_alloc_block_size   #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-###################################################################
-#           START OF query_alloc_block_size TESTS                    #
-###################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.query_alloc_block_size;
-SELECT @start_global_value;
-SET @start_session_value = @@session.query_alloc_block_size;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_130_01-------------------------#'
-###################################################################
-#     Display the DEFAULT value of query_alloc_block_size            #
-###################################################################
-
-SET @@global.query_alloc_block_size = 10000;
-SET @@global.query_alloc_block_size = DEFAULT;
-SELECT @@global.query_alloc_block_size;
-
-SET @@session.query_alloc_block_size = 20000;
-SET @@session.query_alloc_block_size = DEFAULT;
-SELECT @@session.query_alloc_block_size;
-
-
---echo '#--------------------FN_DYNVARS_130_02-------------------------#'
-###################################################################
-#     Check the DEFAULT value of query_alloc_block_size              #
-###################################################################
-
-SET @@global.query_alloc_block_size = DEFAULT;
-SELECT @@global.query_alloc_block_size = 8192;
-
-SET @@session.query_alloc_block_size = DEFAULT;
-SELECT @@session.query_alloc_block_size = 8192;
-
-
---echo '#--------------------FN_DYNVARS_130_03-------------------------#'
-#############################################################################
-# Change the value of query_alloc_block_size to a valid value for GLOBAL Scope #
-#############################################################################
-
-SET @@global.query_alloc_block_size = 1024;
-SELECT @@global.query_alloc_block_size;
-SET @@global.query_alloc_block_size = 1025;
-SELECT @@global.query_alloc_block_size;
-SET @@global.query_alloc_block_size = 4294967295;
-SELECT @@global.query_alloc_block_size;
-SET @@global.query_alloc_block_size = 4294967294;
-SELECT @@global.query_alloc_block_size;
-SET @@global.query_alloc_block_size = 65536;
-SELECT @@global.query_alloc_block_size;
-
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
-
---echo '#--------------------FN_DYNVARS_130_04-------------------------#'
-#################################################################################
-# Change the value of query_alloc_block_size to a valid value for SESSION Scope #
-#################################################################################
- 
-SET @@session.query_alloc_block_size = 1024;
-SELECT @@session.query_alloc_block_size;
-SET @@session.query_alloc_block_size = 1025;
-SELECT @@session.query_alloc_block_size;
-SET @@session.query_alloc_block_size = 4294967295;
-SELECT @@session.query_alloc_block_size;
-SET @@session.query_alloc_block_size = 4294967294;
-SELECT @@session.query_alloc_block_size;
-SET @@session.query_alloc_block_size = 655536;
-SELECT @@session.query_alloc_block_size;
-
---echo '#------------------FN_DYNVARS_130_05-----------------------#'
-##################################################################
-# Change the value of query_alloc_block_size to an invalid value #
-##################################################################
-
-SET @@global.query_alloc_block_size = 64;
-SELECT @@global.query_alloc_block_size;
-SET @@global.query_alloc_block_size = -1;
-SELECT @@global.query_alloc_block_size;
-SET @@global.query_alloc_block_size = 1023;
-SELECT @@global.query_alloc_block_size;
-SET @@global.query_alloc_block_size = 4294967296;
-SELECT @@global.query_alloc_block_size;
---Error ER_PARSE_ERROR
-SET @@global.query_alloc_block_size = 65530.34.;
-SELECT @@global.query_alloc_block_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_alloc_block_size = test;
-SELECT @@global.query_alloc_block_size;
-
-SET @@session.query_alloc_block_size = 64;
-SELECT @@session.query_alloc_block_size;
-SET @@session.query_alloc_block_size = -2;
-SELECT @@session.query_alloc_block_size;
---Error ER_PARSE_ERROR
-SET @@session.query_alloc_block_size = 65530.34.;
-SET @@session.query_alloc_block_size = 1023;
-SELECT @@session.query_alloc_block_size;
-SET @@session.query_alloc_block_size = 4294967296;
-SELECT @@session.query_alloc_block_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.query_alloc_block_size = test;
-SELECT @@session.query_alloc_block_size;
-
---echo '#------------------FN_DYNVARS_130_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-#SET @@global.query_alloc_block_size = 1;
-#SET @@session.query_alloc_block_size = 12;
---echo 'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement';
-
-SET @@global.query_alloc_block_size = 1;
-SET @@session.query_alloc_block_size = 12;
-
-SELECT @@global.query_alloc_block_size = 
-VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_alloc_block_size';
-
-
---echo '#------------------FN_DYNVARS_130_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.query_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='query_alloc_block_size';
-
-
---echo '#------------------FN_DYNVARS_130_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.query_alloc_block_size = TRUE;
-SELECT @@global.query_alloc_block_size;
-SET @@global.query_alloc_block_size = FALSE;
-SELECT @@global.query_alloc_block_size;
-
-
---echo '#---------------------FN_DYNVARS_130_09----------------------#'
-#################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-################################################################################# 
-
-SET @@global.query_alloc_block_size = 2048;
-SELECT @@query_alloc_block_size = @@global.query_alloc_block_size;
-
-
---echo '#---------------------FN_DYNVARS_130_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@query_alloc_block_size = 5000;
-SELECT @@query_alloc_block_size = @@local.query_alloc_block_size;
-SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size;
-
-
---echo '#---------------------FN_DYNVARS_130_11----------------------#'
-##############################################################################
-#   Check if query_alloc_block_size can be accessed with and without @@ sign    #
-##############################################################################
-
-SET query_alloc_block_size = 1024;
-SELECT @@query_alloc_block_size;
---Error ER_UNKNOWN_TABLE
-SELECT local.query_alloc_block_size;
---Error ER_UNKNOWN_TABLE
-SELECT session.query_alloc_block_size;
---Error ER_BAD_FIELD_ERROR
-SELECT query_alloc_block_size = @@session.query_alloc_block_size;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.query_alloc_block_size = @start_global_value;
-SELECT @@global.query_alloc_block_size;
-SET @@session.query_alloc_block_size = @start_session_value;
-SELECT @@session.query_alloc_block_size;
-
-
-########################################################
-#              END OF query_alloc_block_size TESTS     #
-########################################################
-
diff --git a/mysql-test/include/query_cache_limit_basic.inc b/mysql-test/include/query_cache_limit_basic.inc
deleted file mode 100644
index 2eb4a597eef..00000000000
--- a/mysql-test/include/query_cache_limit_basic.inc
+++ /dev/null
@@ -1,178 +0,0 @@
-############## mysql-test\t\query_cache_limit_basic.test ###############
-#                                                                             #
-# Variable Name: query_cache_limit                                            #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:  1048576                                                     #
-# Min value:     0                                                            #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable query_cache_limit        #
-#              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_query_cache.inc
---source include/load_sysvars.inc
-
-######################################################################## 
-#                    START OF query_cache_limit TESTS                  #
-######################################################################## 
-
-
-######################################################################## 
-# Saving initial value of query_cache_limit in a temporary variable    #
-######################################################################## 
-
-SET @start_value = @@global.query_cache_limit;
-SELECT @start_value;
-
-
---echo '#--------------------FN_DYNVARS_131_01------------------------#'
-######################################################################## 
-#              Display the DEFAULT value of query_cache_limit          #
-######################################################################## 
-
-SET @@global.query_cache_limit = 99;
-SET @@global.query_cache_limit = DEFAULT;
-SELECT @@global.query_cache_limit;
-
-
---echo '#---------------------FN_DYNVARS_131_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.query_cache_limit = @start_value;
-SELECT @@global.query_cache_limit = 1048576;
-
-
---echo '#--------------------FN_DYNVARS_131_03------------------------#'
-######################################################################## 
-#        Change the value of query_cache_limit to a valid value         #
-######################################################################## 
-
-SET @@global.query_cache_limit = 0;
-SELECT @@global.query_cache_limit;
-SET @@global.query_cache_limit = 1;
-SELECT @@global.query_cache_limit;
-SET @@global.query_cache_limit = 1048576;
-SELECT @@global.query_cache_limit;
-SET @@global.query_cache_limit = 1048575;
-SELECT @@global.query_cache_limit;
-
-
---echo '#--------------------FN_DYNVARS_131_04-------------------------#'
-########################################################################### 
-#         Change the value of query_cache_limit to invalid value           #
-########################################################################### 
-
-SET @@global.query_cache_limit = -1;
-SELECT @@global.query_cache_limit;
-SET @@global.query_cache_limit = 4294967296;
-SELECT @@global.query_cache_limit;
-SET @@global.query_cache_limit = 10240022115;
-SELECT @@global.query_cache_limit;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_cache_limit = 10000.01;
-SELECT @@global.query_cache_limit;
-SET @@global.query_cache_limit = -1024;
-SELECT @@global.query_cache_limit;
-SET @@global.query_cache_limit = 42949672950;
-SELECT @@global.query_cache_limit;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_cache_limit = ON;
-SELECT @@global.query_cache_limit;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_cache_limit = 'test';
-SELECT @@global.query_cache_limit;
-
-
---echo '#-------------------FN_DYNVARS_131_05----------------------------#'
-########################################################################### 
-#       Test if accessing session query_cache_limit gives error            #
-########################################################################### 
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.query_cache_limit = 0;
-SELECT @@query_cache_limit;
-
-
---echo '#----------------------FN_DYNVARS_131_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.query_cache_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_limit';
-
-SELECT @@query_cache_limit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_limit';
-
-
---echo '#---------------------FN_DYNVARS_131_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.query_cache_limit = TRUE;
-SELECT @@global.query_cache_limit;
-SET @@global.query_cache_limit = FALSE;
-SELECT @@global.query_cache_limit;
-
-
---echo '#---------------------FN_DYNVARS_131_08----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@global.query_cache_limit = 1;
-SELECT @@query_cache_limit = @@global.query_cache_limit;
-
-
---echo '#---------------------FN_DYNVARS_131_09----------------------#'
-##########################################################################  
-#   Check if query_cache_limit can be accessed with and without @@ sign   #
-##########################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET query_cache_limit = 1;
-SELECT @@query_cache_limit;
---Error ER_PARSE_ERROR
-SET local.query_cache_limit = 1;
---Error ER_UNKNOWN_TABLE
-SELECT local.query_cache_limit;
---Error ER_PARSE_ERROR
-SET global.query_cache_limit = 1;
---Error ER_UNKNOWN_TABLE
-SELECT global.query_cache_limit;
---Error ER_BAD_FIELD_ERROR
-SELECT query_cache_limit = @@session.query_cache_limit;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.query_cache_limit = @start_value;
-SELECT @@global.query_cache_limit;
-
-
-######################################################################## 
-#              END OF query_cache_limit TESTS                           #
-######################################################################## 
diff --git a/mysql-test/include/query_cache_min_res_unit_basic.inc b/mysql-test/include/query_cache_min_res_unit_basic.inc
deleted file mode 100644
index 1b65e035b18..00000000000
--- a/mysql-test/include/query_cache_min_res_unit_basic.inc
+++ /dev/null
@@ -1,187 +0,0 @@
-############## mysql-test\t\query_cache_min_res_unit_basic.test ###############
-#                                                                             #
-# Variable Name: query_cache_min_res_unit                                     #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:1024                                                          #
-# Min Value:0                                                                 #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman Rawala                                                      #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable query_cache_min_res_unit #
-#              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_query_cache.inc
---source include/load_sysvars.inc
-
-########################################################################
-
-
-######################################################################## 
-#             START OF query_cache_min_res_unit TESTS                  #
-######################################################################## 
-
-
-############################################################################### 
-# Saving initial value of query_cache_min_res_unit in a temporary variable    #
-############################################################################### 
-
-SET @start_value = @@global.query_cache_min_res_unit;
-SELECT @start_value;
-
-
---echo '#--------------------FN_DYNVARS_132_01------------------------#'
-############################################################################### 
-#              Display the DEFAULT value of query_cache_min_res_unit          #
-############################################################################### 
-
-SET @@global.query_cache_min_res_unit = 99;
-SET @@global.query_cache_min_res_unit = DEFAULT;
-SELECT @@global.query_cache_min_res_unit;
-
-
---echo '#---------------------FN_DYNVARS_132_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.query_cache_min_res_unit = @start_value;
-SELECT @@global.query_cache_min_res_unit = 4096;
-
-
---echo '#--------------------FN_DYNVARS_132_03------------------------#'
-################################################################################ 
-#        Change the value of query_cache_min_res_unit to a valid value         #
-################################################################################ 
-
-SET @@global.query_cache_min_res_unit = 0;
-SELECT @@global.query_cache_min_res_unit;
-SET @@global.query_cache_min_res_unit = 1;
-SELECT @@global.query_cache_min_res_unit;
---echo 'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512';
-SET @@global.query_cache_min_res_unit = 512;
-SELECT @@global.query_cache_min_res_unit;
-SET @@global.query_cache_min_res_unit = 513;
-SELECT @@global.query_cache_min_res_unit;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.query_cache_min_res_unit = 1048576;
-SELECT @@global.query_cache_min_res_unit;
-SET @@global.query_cache_min_res_unit = 1048575;
-SELECT @@global.query_cache_min_res_unit;
-
-
---echo '#--------------------FN_DYNVARS_132_04-------------------------#'
-################################################################################### 
-#         Change the value of query_cache_min_res_unit to invalid value           #
-################################################################################### 
-
-SET @@global.query_cache_min_res_unit = -1;
-SELECT @@global.query_cache_min_res_unit;
-SET @@global.query_cache_min_res_unit = 4294967296;
-SELECT @@global.query_cache_min_res_unit;
-SET @@global.query_cache_min_res_unit = 511;
-SELECT @@global.query_cache_min_res_unit;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_cache_min_res_unit = 10000.01;
-SELECT @@global.query_cache_min_res_unit;
-SET @@global.query_cache_min_res_unit = -1024;
-SELECT @@global.query_cache_min_res_unit;
-SET @@global.query_cache_min_res_unit = 42949672950;
-SELECT @@global.query_cache_min_res_unit;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_cache_min_res_unit = ON;
-SELECT @@global.query_cache_min_res_unit;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_cache_min_res_unit = 'test';
-SELECT @@global.query_cache_min_res_unit;
-
-
---echo '#-------------------FN_DYNVARS_132_05----------------------------#'
-################################################################################### 
-#       Test if accessing session query_cache_min_res_unit gives error            #
-################################################################################### 
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.query_cache_min_res_unit = 0;
-SELECT @@query_cache_min_res_unit;
-
-
---echo '#----------------------FN_DYNVARS_132_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_min_res_unit';
-
-SELECT @@query_cache_min_res_unit = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_min_res_unit';
-
-
---echo '#---------------------FN_DYNVARS_132_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.query_cache_min_res_unit = TRUE;
-SELECT @@global.query_cache_min_res_unit;
-SET @@global.query_cache_min_res_unit = FALSE;
-SELECT @@global.query_cache_min_res_unit;
-
-
---echo '#---------------------FN_DYNVARS_132_08----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@global.query_cache_min_res_unit = 1;
-SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit;
-
-
---echo '#---------------------FN_DYNVARS_132_09----------------------#'
-##################################################################################  
-#   Check if query_cache_min_res_unit can be accessed with and without @@ sign   #
-##################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET query_cache_min_res_unit = 1;
-SELECT @@query_cache_min_res_unit;
---Error ER_PARSE_ERROR
-SET local.query_cache_min_res_unit = 1;
---Error ER_UNKNOWN_TABLE
-SELECT local.query_cache_min_res_unit;
---Error ER_PARSE_ERROR
-SET global.query_cache_min_res_unit = 1;
---Error ER_UNKNOWN_TABLE
-SELECT global.query_cache_min_res_unit;
---Error ER_BAD_FIELD_ERROR
-SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.query_cache_min_res_unit = @start_value;
-SELECT @@global.query_cache_min_res_unit;
-
-
-######################################################################## 
-#              END OF query_cache_min_res_unit TESTS                   #
-######################################################################## 
diff --git a/mysql-test/include/query_cache_size_basic.inc b/mysql-test/include/query_cache_size_basic.inc
deleted file mode 100644
index 1a3f9e1efe2..00000000000
--- a/mysql-test/include/query_cache_size_basic.inc
+++ /dev/null
@@ -1,175 +0,0 @@
-############## mysql-test\t\query_cache_size_basic.test ###############
-#                                                                             #
-# Variable Name: query_cache_size                                             #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:  0                                                           #
-# Range:     -                                                                #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable query_cache_size         #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/have_query_cache.inc
---source include/load_sysvars.inc
-
-######################################################################## 
-#             START OF query_cache_size TESTS                  #
-######################################################################## 
-
-
-############################################################################### 
-# Saving initial value of query_cache_size in a temporary variable    #
-############################################################################### 
-
-SET @start_value = @@global.query_cache_size;
-SELECT @start_value;
-
---echo '#--------------------FN_DYNVARS_133_01------------------------#'
-############################################################################### 
-#              Display the DEFAULT value of query_cache_size          #
-############################################################################### 
-
-SET @@global.query_cache_size = 99;
-SET @@global.query_cache_size = DEFAULT;
-SELECT @@global.query_cache_size;
-
---echo '#---------------------FN_DYNVARS_133_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size = 0;
-
---echo '#--------------------FN_DYNVARS_133_03------------------------#'
-################################################################################ 
-#        Change the value of query_cache_size to a valid value         #
-################################################################################ 
-
-SET @@global.query_cache_size = 0;
-SELECT @@global.query_cache_size;
-SET @@global.query_cache_size = 1;
-SELECT @@global.query_cache_size;
-
-SET @@global.query_cache_size = 512;
-SELECT @@global.query_cache_size;
-SET @@global.query_cache_size = 1024;
-SELECT @@global.query_cache_size;
---echo : 'Bug#34880: Warnings are coming on assinging valid values to variable
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.query_cache_size = 1048576;
-SELECT @@global.query_cache_size;
-SET @@global.query_cache_size = 1048575;
-SELECT @@global.query_cache_size;
-
---echo '#--------------------FN_DYNVARS_133_04-------------------------#'
-################################################################################### 
-#         Change the value of query_cache_size to invalid value           #
-################################################################################### 
-
-SET @@global.query_cache_size = -1;
-SELECT @@global.query_cache_size;
-SET @@global.query_cache_size = 4294967296;
-SELECT @@global.query_cache_size;
-SET @@global.query_cache_size = 511;
-SELECT @@global.query_cache_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_cache_size = 10000.01;
-SELECT @@global.query_cache_size;
-SET @@global.query_cache_size = -1024;
-SELECT @@global.query_cache_size;
-SET @@global.query_cache_size = 42949672950;
-SELECT @@global.query_cache_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_cache_size = ON;
-SELECT @@global.query_cache_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_cache_size = 'test';
-SELECT @@global.query_cache_size;
-
---echo '#-------------------FN_DYNVARS_133_05----------------------------#'
-################################################################################### 
-#       Test if accessing session query_cache_size gives error            #
-################################################################################### 
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.query_cache_size = 0;
-SELECT @@query_cache_size;
-
---echo '#----------------------FN_DYNVARS_133_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.query_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='query_cache_size';
-
-SELECT @@query_cache_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='query_cache_size';
-
---echo '#---------------------FN_DYNVARS_133_07----------------------#'
-################################################################### 
-#      Check if TRUE and FALSE values can be used on variable     #
-################################################################### 
-
-SET @@global.query_cache_size = TRUE;
-SELECT @@global.query_cache_size;
-SET @@global.query_cache_size = FALSE;
-SELECT @@global.query_cache_size;
-
---echo '#---------------------FN_DYNVARS_133_08----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@global.query_cache_size = 1;
-SELECT @@query_cache_size = @@global.query_cache_size;
-
---echo '#---------------------FN_DYNVARS_133_09----------------------#'
-##################################################################################  
-#   Check if query_cache_size can be accessed with and without @@ sign   #
-##################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET query_cache_size = 1;
-SELECT @@query_cache_size;
---Error ER_PARSE_ERROR
-SET local.query_cache_size = 1;
---Error ER_UNKNOWN_TABLE
-SELECT local.query_cache_size;
---Error ER_PARSE_ERROR
-SET global.query_cache_size = 1;
---Error ER_UNKNOWN_TABLE
-SELECT global.query_cache_size;
---Error ER_BAD_FIELD_ERROR
-SELECT query_cache_size = @@session.query_cache_size;
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.query_cache_size = @start_value;
-SELECT @@global.query_cache_size;
-
-######################################################################## 
-#              END OF query_cache_size TESTS                   #
-######################################################################## 
-
diff --git a/mysql-test/include/query_prealloc_size_basic.inc b/mysql-test/include/query_prealloc_size_basic.inc
deleted file mode 100644
index ac005b696fa..00000000000
--- a/mysql-test/include/query_prealloc_size_basic.inc
+++ /dev/null
@@ -1,247 +0,0 @@
-################# mysql-test\t\query_prealloc_size_basic.test ##################
-#                                                                              #
-# Variable Name: query_prealloc_size                                           #
-# Scope: GLOBAL | SESSION                                                      #
-# Access Type: Dynamic                                                         #
-# Data Type: numeric                                                           #
-# Default Value:  8192                                                         #
-# Range:  8192-4294967295                                                      #
-#                                                                              #
-#                                                                              #
-# Creation Date: 2008-02-07                                                    #
-# Author:  Rizwan                                                              #
-#                                                                              #
-# Description: Test Cases of Dynamic System Variable query_prealloc_size       #
-#              that checks the behavior of this variable in the following ways #
-#              * Default Value                                                 #
-#              * Valid & Invalid values                                        #
-#              * Scope & Access method                                         #
-#              * Data Integrity                                                #
-#                                                                              #
-# Reference:                                                                   #
-#      http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html     #
-#                                                                              #
-# Last Modification:                                                           #
-# 2008-07-14 hhunger removed values for 64 bit platforms.                      #
-#                                                                              #
-################################################################################
-
---source include/load_sysvars.inc
-
-########################################################################
-#              START OF query_prealloc_size   TESTS                    #
-########################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.query_prealloc_size ;
-SELECT @start_global_value;
-SET @start_session_value = @@session.query_prealloc_size ;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_005_01-------------------------#'
-########################################################################
-#            Display the DEFAULT value of myisam_block_size            #
-########################################################################
-
-SET @@global.query_prealloc_size   = 100;
-SET @@global.query_prealloc_size   = DEFAULT;
-SELECT @@global.query_prealloc_size  ;
-
-SET @@session.query_prealloc_size   = 200;
-SET @@session.query_prealloc_size   = DEFAULT;
-SELECT @@session.query_prealloc_size  ;
-
-
---echo '#--------------------FN_DYNVARS_005_02-------------------------#'
-########################################################################
-#        Check the DEFAULT value of query_prealloc_size                #
-########################################################################
-
-SET @@global.query_prealloc_size   = DEFAULT;
-SELECT @@global.query_prealloc_size   = 8192;
-
-SET @@session.query_prealloc_size   = DEFAULT;
-SELECT @@session.query_prealloc_size   = 8192;
-
-
---echo '#--------------------FN_DYNVARS_005_03-------------------------#'
-################################################################################
-# Change the value of query_prealloc_size   to a valid value for GLOBAL Scope  #
-################################################################################
-
-SET @@global.query_prealloc_size   = 8192;
-SELECT @@global.query_prealloc_size  ;
-
-# Due to problems with 64 bit machines having less than 6 GB main memory.
-#SET @@global.query_prealloc_size   = 4294967295;
-#SELECT @@global.query_prealloc_size  ;
-
-SET @@global.query_prealloc_size   = 655354;
-SELECT @@global.query_prealloc_size  ;
-
-
---echo '#--------------------FN_DYNVARS_005_04-------------------------#'
-##################################################################################
-# Change the value of query_prealloc_size   to a valid value for SESSION Scope   #
-##################################################################################
-
-SET @@session.query_prealloc_size   = 8192;
-SELECT @@session.query_prealloc_size  ;
-
-# Due to problems with 64 bit machines having less than 6 GB main memory.
-#SET @@session.query_prealloc_size   = 4294967295;
-#SELECT @@session.query_prealloc_size  ;
-
-SET @@session.query_prealloc_size   = 655345;
-SELECT @@session.query_prealloc_size  ;
-
-
-
-
---echo '#------------------FN_DYNVARS_005_05-----------------------#'
-####################################################################
-#  Change the value of query_prealloc_size   to an invalid value   #
-####################################################################
-
-SET @@global.query_prealloc_size   = 0;
-SELECT @@global.query_prealloc_size  ;
-
-SET @@global.query_prealloc_size   = -1024;
-SELECT @@global.query_prealloc_size  ;
-
-# Due to problems with 64 bit machines having less than 6 GB main memory.
-#SET @@global.query_prealloc_size   = 429496729533;
-#SELECT @@global.query_prealloc_size  ;
-
-
---Error ER_PARSE_ERROR
-SET @@global.query_prealloc_size   = 65530.34.;
-SELECT @@global.query_prealloc_size  ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_prealloc_size   = test;
-SELECT @@global.query_prealloc_size  ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_prealloc_size   = "test";
-SELECT @@global.query_prealloc_size  ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_prealloc_size   = 'test';
-SELECT @@global.query_prealloc_size  ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.query_prealloc_size   = ON;
-SELECT @@global.query_prealloc_size  ;
-
-
-SET @@session.query_prealloc_size   = 0;
-SELECT @@session.query_prealloc_size  ;
-
-SET @@session.query_prealloc_size   = -2;
-SELECT @@session.query_prealloc_size  ;
-
---Error ER_PARSE_ERROR
-
-SET @@session.query_prealloc_size   = 65530.34.;
-SELECT @@session.query_prealloc_size  ;
-
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.query_prealloc_size   = test;
-SELECT @@session.query_prealloc_size  ;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.query_prealloc_size   = "test";
-SELECT @@session.query_prealloc_size  ;
-
-
---echo '#------------------FN_DYNVARS_005_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.query_prealloc_size   = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='query_prealloc_size  ';
-
---echo '#------------------FN_DYNVARS_005_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.query_prealloc_size   = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='query_prealloc_size  ';
-
-
---echo '#------------------FN_DYNVARS_005_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.query_prealloc_size   = TRUE;
-SELECT @@global.query_prealloc_size  ;
-SET @@global.query_prealloc_size   = FALSE;
-SELECT @@global.query_prealloc_size  ;
-
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-################################################################################
-# Check if accessing variable with and without GLOBAL point to same variable   #
-################################################################################
-
-SET @@global.query_prealloc_size   = 10;
-SELECT @@query_prealloc_size   = @@global.query_prealloc_size  ;
-
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-##############################################################################
-# Check if accessing variable with SESSION,LOCAL and without SCOPE points to #
-# to the same session variable                                               #
-##############################################################################
-
-SET @@query_prealloc_size   = 100;
-SELECT @@query_prealloc_size   = @@local.query_prealloc_size  ;
-SELECT @@local.query_prealloc_size   = @@session.query_prealloc_size  ;
-
-
---echo '#---------------------FN_DYNVARS_001_11----------------------#'
-################################################################################
-#    Check if query_prealloc_size   can be accessed with and without @@ sign   #
-################################################################################
-
-SET query_prealloc_size   = 1;
-SELECT @@query_prealloc_size  ;
---Error ER_UNKNOWN_TABLE
-
-SELECT local.query_prealloc_size  ;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.query_prealloc_size  ;
-
---Error ER_BAD_FIELD_ERROR
-SELECT query_prealloc_size   = @@session.query_prealloc_size  ;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.query_prealloc_size   = @start_global_value;
-SELECT @@global.query_prealloc_size  ;
-SET @@session.query_prealloc_size   = @start_session_value;
-SELECT @@session.query_prealloc_size  ;
-
-
-#############################################################
-#                 END OF query_prealloc_size   TESTS        #
-#############################################################
-
diff --git a/mysql-test/include/range_alloc_block_size_basic.inc b/mysql-test/include/range_alloc_block_size_basic.inc
deleted file mode 100644
index 37692cc8c35..00000000000
--- a/mysql-test/include/range_alloc_block_size_basic.inc
+++ /dev/null
@@ -1,208 +0,0 @@
-############## mysql-test\t\range_alloc_block_size_basic.test ###############
-#                                                                             #
-# Variable Name: range_alloc_block_size                                       #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:2048 	                                                      #
-# Max value: 4294967295                                                       #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable range_alloc_block_size   #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-######################################################################
-#           START OF range_alloc_block_size TESTS                    #
-######################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.range_alloc_block_size;
-SELECT @start_global_value;
-SET @start_session_value = @@session.range_alloc_block_size;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_137_01-------------------------#'
-######################################################################
-#     Display the DEFAULT value of range_alloc_block_size            #
-######################################################################
-
-SET @@global.range_alloc_block_size = 100;
-SET @@global.range_alloc_block_size = DEFAULT;
-SELECT @@global.range_alloc_block_size;
-
-SET @@session.range_alloc_block_size = 200;
-SET @@session.range_alloc_block_size = DEFAULT;
-SELECT @@session.range_alloc_block_size;
-
-
---echo '#--------------------FN_DYNVARS_137_02-------------------------#'
-######################################################################
-#     Check the DEFAULT value of range_alloc_block_size              #
-######################################################################
-
-SET @@global.range_alloc_block_size = DEFAULT;
-SELECT @@global.range_alloc_block_size = 2048;
-
-SET @@session.range_alloc_block_size = DEFAULT;
-SELECT @@session.range_alloc_block_size = 2048;
-
-
---echo '#--------------------FN_DYNVARS_137_03-------------------------#'
-################################################################################
-# Change the value of range_alloc_block_size to a valid value for GLOBAL Scope #
-################################################################################
-
-SET @@global.range_alloc_block_size = 2048;
-SELECT @@global.range_alloc_block_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-SET @@global.range_alloc_block_size = 4294967295;
-SELECT @@global.range_alloc_block_size;
-SET @@global.range_alloc_block_size = 4294967294;
-SELECT @@global.range_alloc_block_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
-
---echo '#--------------------FN_DYNVARS_137_04-------------------------#'
-###################################################################################
-# Change the value of range_alloc_block_size to a valid value for SESSION Scope #
-###################################################################################
- 
-SET @@session.range_alloc_block_size = 2048;
-SELECT @@session.range_alloc_block_size;
-SET @@session.range_alloc_block_size = 4294967295;
-SELECT @@session.range_alloc_block_size;
-SET @@session.range_alloc_block_size = 4294967294;
-SELECT @@session.range_alloc_block_size;
-
-
---echo '#------------------FN_DYNVARS_137_05-----------------------#'
-##################################################################
-# Change the value of range_alloc_block_size to an invalid value #
-##################################################################
-
-SET @@global.range_alloc_block_size = 0;
-SELECT @@global.range_alloc_block_size;
-SET @@global.range_alloc_block_size = -1024;
-SELECT @@global.range_alloc_block_size;
-SET @@global.range_alloc_block_size = 42949672951;
-SELECT @@global.range_alloc_block_size;
---Error ER_PARSE_ERROR
-SET @@global.range_alloc_block_size = 65530.34.;
-SELECT @@global.range_alloc_block_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.range_alloc_block_size = test;
-SELECT @@global.range_alloc_block_size;
-
-SET @@session.range_alloc_block_size = 0;
-SELECT @@session.range_alloc_block_size;
-SET @@session.range_alloc_block_size = -2;
-SELECT @@session.range_alloc_block_size;
---Error ER_PARSE_ERROR
-SET @@session.range_alloc_block_size = 65530.34.;
-SET @@session.range_alloc_block_size = 4294967296;
-SELECT @@session.range_alloc_block_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.range_alloc_block_size = test;
-SELECT @@session.range_alloc_block_size;
-
-
---echo '#------------------FN_DYNVARS_137_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.range_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='range_alloc_block_size';
-
---echo '#------------------FN_DYNVARS_137_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.range_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='range_alloc_block_size';
-
-
---echo '#------------------FN_DYNVARS_137_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.range_alloc_block_size = TRUE;
-SELECT @@global.range_alloc_block_size;
-SET @@global.range_alloc_block_size = FALSE;
-SELECT @@global.range_alloc_block_size;
-
-
---echo '#---------------------FN_DYNVARS_137_09----------------------#'
-#################################################################################### 
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-#################################################################################### 
-
-SET @@global.range_alloc_block_size = 10;
-SELECT @@range_alloc_block_size = @@global.range_alloc_block_size;
-
-
---echo '#---------------------FN_DYNVARS_137_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@range_alloc_block_size = 100;
-SELECT @@range_alloc_block_size = @@local.range_alloc_block_size;
-SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size;
-
-
---echo '#---------------------FN_DYNVARS_137_11----------------------#'
-###################################################################################  
-#   Check if range_alloc_block_size can be accessed with and without @@ sign    #
-###################################################################################
-
-SET range_alloc_block_size = 1;
-SELECT @@range_alloc_block_size;
---Error ER_UNKNOWN_TABLE
-SELECT local.range_alloc_block_size;
---Error ER_UNKNOWN_TABLE
-SELECT session.range_alloc_block_size;
---Error ER_BAD_FIELD_ERROR
-SELECT range_alloc_block_size = @@session.range_alloc_block_size;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.range_alloc_block_size = @start_global_value;
-SELECT @@global.range_alloc_block_size;
-SET @@session.range_alloc_block_size = @start_session_value;
-SELECT @@session.range_alloc_block_size;
-
-
-#############################################################
-#                 END OF range_alloc_block_size TESTS     #
-#############################################################
-
diff --git a/mysql-test/include/rpl_recovery_rank_basic.inc b/mysql-test/include/rpl_recovery_rank_basic.inc
deleted file mode 100644
index f9ae3968b31..00000000000
--- a/mysql-test/include/rpl_recovery_rank_basic.inc
+++ /dev/null
@@ -1,171 +0,0 @@
-############## mysql-test\t\rpl_recovery_rank_basic.test #######################
-#                                                                              #
-# Variable Name: rpl_recovery_rank                                             #
-# Scope: GLOBAL & SESSION                                                      #
-# Access Type: Dynamic                                                         #
-# Data Type: Numeric                                                           #
-# Default Value: 1                                                             #
-# Range: 1 - 65536                                                             #
-#                                                                              #
-#                                                                              #
-# Creation Date: 2008-02-07                                                    #
-# Author:  Rizwan Maredia                                                      #
-#                                                                              #
-# Description: Test Cases of Dynamic System Variable rpl_recovery_rank         #
-#              that checks the behavior of this variable in the following ways #
-#              * Default Value                                                 #
-#              * Valid & Invalid values                                        #
-#              * Scope & Access method                                         #
-#              * Data Integrity                                                #
-#                                                                              #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
-#  server-system-variables.html                                                #
-#                                                                              #
-################################################################################
-
---source include/load_sysvars.inc
-
-###################################################################
-#           START OF rpl_recovery_rank TESTS                      #
-###################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.rpl_recovery_rank;
-SELECT @start_global_value;
-
---echo '#--------------------FN_DYNVARS_142_01-------------------------#'
-###################################################################
-#     Check the DEFAULT value of rpl_recovery_rank               #
-###################################################################
-
-SET @@global.rpl_recovery_rank = 500000;
-SET @@global.rpl_recovery_rank = DEFAULT;
-SELECT @@global.rpl_recovery_rank;
-
---echo '#--------------------FN_DYNVARS_142_02-------------------------#'
-##################################################################################
-# Change the value of rpl_recovery_rank to a valid value for GLOBAL Scope        #
-##################################################################################
-
-SET @@global.rpl_recovery_rank = 0;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 1024;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 123456789;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 2147483648*2;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 2147483648*1024;
-SELECT @@global.rpl_recovery_rank;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 2147483648*2147483648;
-SELECT @@global.rpl_recovery_rank;
-
-
---echo '#--------------------FN_DYNVARS_142_03-------------------------#'
-#################################################################################
-#           Check if variable can be access with session scope                  #
-#################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET @@rpl_recovery_rank = 2;
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.rpl_recovery_rank = 3;
-
---Error ER_GLOBAL_VARIABLE
-SET @@local.rpl_recovery_rank = 4;
-
-
-
---echo '#------------------FN_DYNVARS_142_04-----------------------#'
-####################################################################
-# Change the value of rpl_recovery_rank to an invalid value        #
-####################################################################
-
-SET @@global.rpl_recovery_rank = -1;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = -2147483648;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = -2147483649;
-SELECT @@global.rpl_recovery_rank;
---Error ER_PARSE_ERROR
-SET @@global.rpl_recovery_rank = 65530.34.;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.rpl_recovery_rank = 2147483649.56;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.rpl_recovery_rank = 1G;
-
-
---echo '#------------------FN_DYNVARS_142_05-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-SET @@global.rpl_recovery_rank = 3000;
-SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-
-
---echo '#------------------FN_DYNVARS_142_06-----------------------#'
-###########################################################################
-#  Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES  #
-###########################################################################
-
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-
-
---echo '#------------------FN_DYNVARS_142_07-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.rpl_recovery_rank = TRUE;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = FALSE;
-SELECT @@global.rpl_recovery_rank;
-
-
---echo '#---------------------FN_DYNVARS_001_08----------------------#'
-#################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-################################################################################# 
-
-
-SET @@global.rpl_recovery_rank = 512;
-SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-##################################################################################
-#   Check if rpl_recovery_rank can be accessed without @@ sign and scope         #
-##################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET rpl_recovery_rank = 2048;
---Error ER_BAD_FIELD_ERROR
-SELECT rpl_recovery_rank;
-
-SELECT @@rpl_recovery_rank;
-
-#verifying another another syntax for setting value
-SET global rpl_recovery_rank = 64;
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.rpl_recovery_rank = @start_global_value;
-SELECT @@global.rpl_recovery_rank;
-
-########################################################
-#              END OF rpl_recovery_rank TESTS          #
-########################################################
-
diff --git a/mysql-test/include/server_id_basic.inc b/mysql-test/include/server_id_basic.inc
deleted file mode 100644
index 47afadb5016..00000000000
--- a/mysql-test/include/server_id_basic.inc
+++ /dev/null
@@ -1,190 +0,0 @@
-############## mysql-test\t\server_id_basic.test ################
-#                                                                              #
-# Variable Name: server_id                                                     #
-# Scope: GLOBAL & SESSION                                                      #
-# Access Type: Dynamic                                                         #
-# Data Type: Numeric                                                           #
-# Default Value: 1                                                             #
-# Range: 1 - 65536                                                             #
-#                                                                              #
-#                                                                              #
-# Creation Date: 2008-02-07                                                    #
-# Author:  Rizwan Maredia                                                      #
-#                                                                              #
-# Description: Test Cases of Dynamic System Variable server_id  #
-#              that checks the behavior of this variable in the following ways #
-#              * Default Value                                                 #
-#              * Valid & Invalid values                                        #
-#              * Scope & Access method                                         #
-#              * Data Integrity                                                #
-#                                                                              #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
-#  server-system-variables.html                                                #
-#                                                                              #
-################################################################################
-
---source include/load_sysvars.inc
-
-###################################################################
-#           START OF server_id TESTS              #
-###################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-let $save_general_log= `SELECT @@global.general_log`;
-SET @@global.general_log= 0;
-SET @start_global_value = @@global.server_id;
-SELECT @start_global_value;
-
---echo '#--------------------FN_DYNVARS_144_01-------------------------#'
-###################################################################
-#     Display the DEFAULT value of server_id      #
-###################################################################
-
-SET @@global.server_id = 500000;
-SET @@global.server_id = DEFAULT;
-SELECT @@global.server_id;
-
---echo '#--------------------FN_DYNVARS_144_02-------------------------#'
-###################################################################
-#     Check the DEFAULT value of server_id         #
-###################################################################
-
-SET @@global.server_id = DEFAULT;
-SELECT @@global.server_id = 0;
-
---echo '#--------------------FN_DYNVARS_144_03-------------------------#'
-##################################################################################
-# Change the value of server_id to a valid value for GLOBAL Scope #
-##################################################################################
-
-SET @@global.server_id = 0;
-SELECT @@global.server_id;
-SET @@global.server_id = 1;
-SELECT @@global.server_id;
-SET @@global.server_id = 15;
-SELECT @@global.server_id;
-SET @@global.server_id = 1024;
-SELECT @@global.server_id;
-SET @@global.server_id = 123456789;
-SELECT @@global.server_id;
-SET @@global.server_id = 2147483648;
-SELECT @@global.server_id;
-SET @@global.server_id = 2147483648*2-1;
-SELECT @@global.server_id;
-
-
---echo '#--------------------FN_DYNVARS_144_04-------------------------#'
-#################################################################################
-#           Check if variable can be access with session scope                  #
-#################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET @@server_id = 2;
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.server_id = 3;
-
---Error ER_GLOBAL_VARIABLE
-SET @@local.server_id = 4;
-
-
-
---echo '#------------------FN_DYNVARS_144_05-----------------------#'
-####################################################################
-# Change the value of server_id to an invalid value #
-####################################################################
-
-SET @@global.server_id = -1;
-SELECT @@global.server_id;
-
-SET @@global.server_id = -2147483648;
-SELECT @@global.server_id;
-
-SET @@global.server_id = 2147483649*2;
-SELECT @@global.server_id;
-
---Error ER_PARSE_ERROR
-SET @@global.server_id = 65530.34.;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.server_id = '125';
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.server_id = 7483649.56;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.server_id = 1G;
-
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
-
---echo '#------------------FN_DYNVARS_144_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-SET @@global.server_id = 3000;
-SELECT @@global.server_id = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='server_id';
-
-
---echo '#------------------FN_DYNVARS_144_07-----------------------#'
-###########################################################################
-#  Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES  #
-###########################################################################
-
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='server_id';
-
-
---echo '#------------------FN_DYNVARS_144_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.server_id = TRUE;
-SELECT @@global.server_id;
-SET @@global.server_id = FALSE;
-SELECT @@global.server_id;
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-#################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-################################################################################# 
-
-
-SET @@global.server_id = 512;
-SELECT @@server_id = @@global.server_id;
-
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-##################################################################################
-#   Check if server_id can be accessed without @@ sign and scope #
-##################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET server_id = 2048;
---Error ER_BAD_FIELD_ERROR
-SELECT server_id;
-
-SELECT @@server_id;
-
-#verifying another another syntax for setting value
-SET global server_id = 99;
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.server_id = @start_global_value;
-SELECT @@global.server_id;
-
-eval SET @@global.general_log= $save_general_log;
-########################################################
-#              END OF server_id TESTS  #
-########################################################
-
diff --git a/mysql-test/include/slave_transaction_retries_basic.inc b/mysql-test/include/slave_transaction_retries_basic.inc
deleted file mode 100644
index 6bbed3b1982..00000000000
--- a/mysql-test/include/slave_transaction_retries_basic.inc
+++ /dev/null
@@ -1,188 +0,0 @@
-############# mysql-test\t\slave_transaction_retries_basic.test ###############
-#                                                                             #
-# Variable Name: slave_transaction_retries                                    #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 10                                                           #
-# Range:                                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Rizwan                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable slave_transaction_retries#
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-###################################################################
-#           START OF slave_transaction_retries TESTS              #
-###################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.slave_transaction_retries;
-SELECT @start_global_value;
-
---echo '#--------------------FN_DYNVARS_149_01-------------------------#'
-###################################################################
-#     Display the DEFAULT value of slave_transaction_retries      #
-###################################################################
-
-SET @@global.slave_transaction_retries = 50;
-SET @@global.slave_transaction_retries = DEFAULT;
-SELECT @@global.slave_transaction_retries;
-
---echo '#--------------------FN_DYNVARS_149_02-------------------------#'
-###################################################################
-#     Check the DEFAULT value of slave_transaction_retries         #
-###################################################################
-
-SET @@global.slave_transaction_retries = DEFAULT;
-SELECT @@global.slave_transaction_retries = 10;
-
---echo '#--------------------FN_DYNVARS_149_03-------------------------#'
-################################################################################
-# Change the value of slave_transaction_retries to a valid value for
-# GLOBAL Scope 
-################################################################################
-
-SET @@global.slave_transaction_retries = 0;
-SELECT @@global.slave_transaction_retries;
-SET @@global.slave_transaction_retries = 1;
-SELECT @@global.slave_transaction_retries;
-SET @@global.slave_transaction_retries = 15;
-SELECT @@global.slave_transaction_retries;
-SET @@global.slave_transaction_retries = 1024;
-SELECT @@global.slave_transaction_retries;
-SET @@global.slave_transaction_retries = 2147483648;
-SELECT @@global.slave_transaction_retries;
-SET @@global.slave_transaction_retries = 2147483648*2-1;
-SELECT @@global.slave_transaction_retries;
-SET @@global.slave_transaction_retries = 2147483649*2;
-SELECT @@global.slave_transaction_retries;
-SET @@global.slave_transaction_retries = 4294967295;
-SELECT @@global.slave_transaction_retries;
-
---echo '#--------------------FN_DYNVARS_149_04-------------------------#'
-###############################################################################
-#           Check if variable can be access with session scope                #
-###############################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET @@slave_transaction_retries = 2;
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.slave_transaction_retries = 3;
-
---Error ER_GLOBAL_VARIABLE
-SET @@local.slave_transaction_retries = 4;
-
-
-
---echo '#------------------FN_DYNVARS_149_05-----------------------#'
-####################################################################
-# Change the value of slave_transaction_retries to an invalid value#
-####################################################################
-
-SET @@global.slave_transaction_retries = -1;
-SELECT @@global.slave_transaction_retries;
-
-SET @@global.slave_transaction_retries = 2147483649*2147483649;
-SELECT @@global.slave_transaction_retries;
-
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
---Error ER_PARSE_ERROR
-SET @@global.slave_transaction_retries = 65530.34.;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.slave_transaction_retries = '100';
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.slave_transaction_retries = 7483649.56;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.slave_transaction_retries = ON;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.slave_transaction_retries = OFF;
-
---echo '#------------------FN_DYNVARS_149_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-SET @@global.slave_transaction_retries = 3000;
-SELECT @@global.slave_transaction_retries = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='slave_transaction_retries';
-
-
---echo '#------------------FN_DYNVARS_149_07-----------------------#'
-###########################################################################
-#  Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES  #
-###########################################################################
-
-SELECT count(VARIABLE_VALUE) 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='slave_transaction_retries';
-
-
---echo '#------------------FN_DYNVARS_149_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.slave_transaction_retries = TRUE;
-SELECT @@global.slave_transaction_retries;
-SET @@global.slave_transaction_retries = FALSE;
-SELECT @@global.slave_transaction_retries;
-
-
---echo '#---------------------FN_DYNVARS_149_09----------------------#'
-###############################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable #
-###############################################################################
-
-
-SET @@global.slave_transaction_retries = 60*60;
-SELECT @@slave_transaction_retries = @@global.slave_transaction_retries;
-
-
---echo '#---------------------FN_DYNVARS_149_10----------------------#'
-###############################################################################
-#   Check if slave_transaction_retries can be accessed without @@ sign
-#   and scope 
-###############################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET slave_transaction_retries = 2048;
---Error ER_BAD_FIELD_ERROR
-SELECT slave_transaction_retries;
-
-SELECT @@slave_transaction_retries;
-
-#verifying another another syntax for setting value
-SET global slave_transaction_retries = 99;
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.slave_transaction_retries = @start_global_value;
-SELECT @@global.slave_transaction_retries;
-
-########################################################
-#              END OF slave_transaction_retries TESTS  #
-########################################################
-
diff --git a/mysql-test/include/sort_buffer_size_basic.inc b/mysql-test/include/sort_buffer_size_basic.inc
deleted file mode 100644
index 4dbae7c8847..00000000000
--- a/mysql-test/include/sort_buffer_size_basic.inc
+++ /dev/null
@@ -1,213 +0,0 @@
-############## mysql-test\t\sort_buffer_size_basic.test #######################
-#                                                                             #
-# Variable Name: sort_buffer_size                                             #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 2097144                                                      #
-# Range:max value:4294967295                                                  #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable sort_buffer_size         #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-########################################################################
-
-
-######################################################################
-#           START OF sort_buffer_size TESTS                    #
-######################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-# due to difference when running on Windows (bug filed)
---source include/not_windows.inc
-
-SET @start_global_value = @@global.sort_buffer_size;
-SELECT @start_global_value;
-SET @start_session_value = @@session.sort_buffer_size;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_151_01-------------------------#'
-######################################################################
-#     Display the DEFAULT value of sort_buffer_size            #
-######################################################################
-
-SET @@global.sort_buffer_size = 1000;
-SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
-
-SET @@session.sort_buffer_size = 2000;
-SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
-
-
---echo '#--------------------FN_DYNVARS_151_02-------------------------#'
-######################################################################
-#     Check the DEFAULT value of sort_buffer_size              #
-######################################################################
-
-SET @@global.sort_buffer_size = DEFAULT;
-SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
-
-SET @@session.sort_buffer_size = DEFAULT;
-SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
-
-
---echo '#--------------------FN_DYNVARS_151_03-------------------------#'
-################################################################################
-# Change the value of sort_buffer_size to a valid value for GLOBAL Scope #
-################################################################################
-
-SET @@global.sort_buffer_size = 32776;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-SET @@global.sort_buffer_size = 32777;
-SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
-SET @@global.sort_buffer_size = 4294967295;
-SELECT @@global.sort_buffer_size;
-SET @@global.sort_buffer_size = 4294967294;
-SELECT @@global.sort_buffer_size;
---echo 'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
-
---echo '#--------------------FN_DYNVARS_151_04-------------------------#'
-###################################################################################
-# Change the value of sort_buffer_size to a valid value for SESSION Scope #
-###################################################################################
- 
-SET @@session.sort_buffer_size = 32776;
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-SET @@session.sort_buffer_size = 32777;
-SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
-SET @@session.sort_buffer_size = 4294967295;
-SELECT @@session.sort_buffer_size;
-SET @@session.sort_buffer_size = 4294967294;
-SELECT @@session.sort_buffer_size;
-
-
---echo '#------------------FN_DYNVARS_151_05-----------------------#'
-##################################################################
-# Change the value of sort_buffer_size to an invalid value #
-##################################################################
-
-SET @@global.sort_buffer_size = 32775;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-SET @@global.sort_buffer_size = -1024;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-SET @@global.sort_buffer_size = 4294967296;
-SELECT @@global.sort_buffer_size;
---Error ER_PARSE_ERROR
-SET @@global.sort_buffer_size = 65530.34.;
-SELECT @@global.sort_buffer_size;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.sort_buffer_size = test;
-SELECT @@global.sort_buffer_size;
-
-SET @@session.sort_buffer_size = 32775;
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
-SET @@session.sort_buffer_size = -2;
-SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
---Error ER_PARSE_ERROR
-SET @@session.sort_buffer_size = 65530.34.;
-SET @@session.sort_buffer_size = 4294967296;
-SELECT @@session.sort_buffer_size;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.sort_buffer_size = test;
-SELECT @@session.sort_buffer_size;
-
-
---echo '#------------------FN_DYNVARS_151_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
-
---echo '#------------------FN_DYNVARS_151_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
-
-
---echo '#------------------FN_DYNVARS_151_08-----------------------#'
-####################################################################
-#     Check if TRUE and FALSE values can be used on variable       #
-####################################################################
-
-SET @@global.sort_buffer_size = TRUE;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-SET @@global.sort_buffer_size = FALSE;
-SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
-echo 'Bug: Errors should be displayed on assigning TRUE/FALSE to variable';
-
-
---echo '#---------------------FN_DYNVARS_151_09----------------------#'
-#################################################################################### 
-#  Check if accessing variable with and without GLOBAL point to same variable   #
-#################################################################################### 
-
-SET @@global.sort_buffer_size = 9000;
-SELECT @@sort_buffer_size = @@global.sort_buffer_size;
-
-
---echo '#---------------------FN_DYNVARS_151_10----------------------#'
-########################################################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
-########################################################################################################
-
-SET @@sort_buffer_size = 9000;
-SELECT @@sort_buffer_size = @@local.sort_buffer_size;
-SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
-
-
---echo '#---------------------FN_DYNVARS_151_11----------------------#'
-###################################################################################  
-#   Check if sort_buffer_size can be accessed with and without @@ sign    #
-###################################################################################
-
-SET sort_buffer_size = 9100;
-SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
-SELECT @@sort_buffer_size;
---Error ER_UNKNOWN_TABLE
-SELECT local.sort_buffer_size;
---Error ER_UNKNOWN_TABLE
-SELECT session.sort_buffer_size;
---Error ER_BAD_FIELD_ERROR
-SELECT sort_buffer_size = @@session.sort_buffer_size;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.sort_buffer_size = @start_global_value;
-SELECT @@global.sort_buffer_size;
-SET @@session.sort_buffer_size = @start_session_value;
-SELECT @@session.sort_buffer_size;
-
-
-#############################################################
-#                 END OF sort_buffer_size TESTS     #
-#############################################################
diff --git a/mysql-test/include/sync_binlog_basic.inc b/mysql-test/include/sync_binlog_basic.inc
deleted file mode 100644
index b66509bbb5e..00000000000
--- a/mysql-test/include/sync_binlog_basic.inc
+++ /dev/null
@@ -1,156 +0,0 @@
-#################### mysql-test\t\sync_binlog_basic.test ######################
-#                                                                             #
-# Variable Name: sync_binlog                                                  #
-# Scope: GLOBAL                                                               #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 0                                                            #
-# Range: 0 - 4294967295                                                       #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Salman Rawala                                                      #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable sync_binlog              #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-##################################################################
-#                    START OF sync_binlog TESTS                  #
-##################################################################
-
-
-##################################################################
-# Saving initial value of sync_binlog in a temporary variable    #
-##################################################################
-
-SET @start_value = @@global.sync_binlog;
-SELECT @start_value;
-
-
---echo '#--------------------FN_DYNVARS_168_01------------------------#'
-##################################################################
-#              Display the DEFAULT value of sync_binlog          #
-################################################################## 
-
-SET @@global.sync_binlog = 99;
-SET @@global.sync_binlog = DEFAULT;
-SELECT @@global.sync_binlog;
-
-
---echo '#---------------------FN_DYNVARS_168_02-------------------------#'
-############################################### 
-#     Verify default value of variable        #
-############################################### 
-
-SET @@global.sync_binlog = @start_value;
-SELECT @@global.sync_binlog = 0;
-
-
---echo '#--------------------FN_DYNVARS_168_03------------------------#'
-###################################################################
-#        Change the value of sync_binlog to a valid value         #
-###################################################################
-
-SET @@global.sync_binlog = 0;
-SELECT @@global.sync_binlog;
-SET @@global.sync_binlog = 1;
-SELECT @@global.sync_binlog;
-SET @@global.sync_binlog = 4294967295;
-SELECT @@global.sync_binlog;
-SET @@global.sync_binlog = 4294967294;
-SELECT @@global.sync_binlog;
-SET @@global.sync_binlog = 65536;
-SELECT @@global.sync_binlog;
-
-
---echo '#--------------------FN_DYNVARS_168_04-------------------------#'
-######################################################################
-#         Change the value of sync_binlog to invalid value           #
-######################################################################
-
-SET @@global.sync_binlog = -1;
-SELECT @@global.sync_binlog;
-SET @@global.sync_binlog = 4294967296;
-SELECT @@global.sync_binlog;
-SET @@global.sync_binlog = 10240022115;
-SELECT @@global.sync_binlog;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.sync_binlog = 10000.01;
-SELECT @@global.sync_binlog;
-SET @@global.sync_binlog = -1024;
-SELECT @@global.sync_binlog;
-SET @@global.sync_binlog = 42949672950;
-SELECT @@global.sync_binlog;
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.sync_binlog = ON;
-SELECT @@global.sync_binlog;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.sync_binlog = 'test';
-SELECT @@global.sync_binlog;
-
-
---echo '#-------------------FN_DYNVARS_168_05----------------------------#'
-########################################################################### 
-#       Test if accessing session sync_binlog gives error            #
-########################################################################### 
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.sync_binlog = 0;
-SELECT @@sync_binlog;
-
-
---echo '#----------------------FN_DYNVARS_168_06------------------------#'
-############################################################################## 
-# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
-##############################################################################
-
-SELECT @@global.sync_binlog = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='sync_binlog';
-
-
-
---echo '#---------------------FN_DYNVARS_168_07----------------------#'
-##########################################################################  
-#   Check if sync_binlog can be accessed with and without @@ sign   #
-##########################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET sync_binlog = 1;
-SELECT @@sync_binlog;
---Error ER_PARSE_ERROR
-SET local.sync_binlog = 1;
---Error ER_UNKNOWN_TABLE
-SELECT local.sync_binlog;
---Error ER_PARSE_ERROR
-SET global.sync_binlog = 1;
---Error ER_UNKNOWN_TABLE
-SELECT global.sync_binlog;
---Error ER_BAD_FIELD_ERROR
-SELECT sync_binlog = @@session.sync_binlog;
-
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@global.sync_binlog = @start_value;
-SELECT @@global.sync_binlog;
-
-
-######################################################################## 
-#              END OF sync_binlog TESTS                           #
-######################################################################## 
diff --git a/mysql-test/include/timestamp_basic.inc b/mysql-test/include/timestamp_basic.inc
deleted file mode 100644
index d7ad620ec26..00000000000
--- a/mysql-test/include/timestamp_basic.inc
+++ /dev/null
@@ -1,162 +0,0 @@
-################## mysql-test\t\timestamp_basic.test ##########################
-#                                                                             #
-# Variable Name: timestamp                                                    #
-# Scope: SESSION                                                              #
-# Access Type: Dynamic                                                        #
-# Data Type: string                                                           #
-# Default Value:                                                              #
-# Range:                                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Rizwan                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable timestamp                #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-#######################################################################
-#                    START OF timestamp TESTS                         #
-#######################################################################
-
-
-#######################################################################
-#      Saving initial value of timestamp in a temporary variable      #
-#######################################################################
-
-SET @session_start_value = @@session.timestamp;
-
---echo '#--------------------FN_DYNVARS_001_01------------------------#'
-########################################################################
-#                    Display the DEFAULT value of timestamp            #
-########################################################################
-
-
-SET @@timestamp = DEFAULT;
-#SELECT @@timestamp;
-
---echo 'timestamp does not have any DEFAULT value'
-
---echo '#---------------------FN_DYNVARS_001_02-------------------------#'
-##############################################################
-#     see if accessable using global scope                   #
-##############################################################
-
---Error ER_LOCAL_VARIABLE
-SET @@global.timestamp = "1000";
-
-
---echo '#--------------------FN_DYNVARS_001_03------------------------#'
-######################################################################## 
-#              Change the value of timestamp to a valid value          #
-######################################################################## 
-
-SET @@timestamp = 0;
-#SELECT @@timestamp;
-
---echo 'Setting 0 resets timestamp to session default timestamp'
-
-SET @@timestamp = 123456789123456;
-SELECT @@timestamp;
-SET @@timestamp = 60*60*60*60*365;
-SELECT @@timestamp;
-SET @@timestamp = -1000000000;
-SELECT @@timestamp;
-
-SET @temp_ts = @@timestamp - @@timestamp;
-SELECT @temp_ts;
-
---echo '#--------------------FN_DYNVARS_001_04-------------------------#'
-########################################################################### 
-#               Change the value of timestamp to invalid value            #
-########################################################################### 
-
-# for session scope
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@timestamp = "100";
---echo 'Bug# 34836: Documentation says its a string variable but infact its numeric'
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@timestamp = " ";
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@timestamp = 1.1;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@timestamp = 9999999999999999999999;
-
-
-
---echo '#----------------------FN_DYNVARS_001_06------------------------#'
-######################################################################### 
-#     Check if the value in SESSION Table matches value in variable     #
-#########################################################################
-
-SELECT @@timestamp = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='timestamp';
-
---echo '#---------------------FN_DYNVARS_001_08-------------------------#'
-############################################################################# 
-#        Check if ON, OFF, TRUE and FALSE values can be used on variable    #
-############################################################################# 
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@timestamp = OFF;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@timestamp = ON;
-
-SET @@timestamp = TRUE;
-SELECT @@timestamp;
-
-SET @@timestamp = FALSE;
-#SELECT @@timestamp;
-
-
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-#############################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE points
-#    to same session variable
-#############################################################################
-
-SET @@timestamp = 123456;
-SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
-SET @@timestamp = 654321;
-SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
-
-
---echo '#---------------------FN_DYNVARS_001_11----------------------#'
-#####################################################################  
-#   Check if timestamp can be accessed with and without @@ sign    #
-#####################################################################
-
-SET timestamp = 1;
-SELECT @@timestamp;
---Error ER_UNKNOWN_TABLE
-SELECT local.timestamp;
---Error ER_UNKNOWN_TABLE
-SELECT session.timestamp;
---Error ER_BAD_FIELD_ERROR
-SELECT timestamp = @@session.timestamp;
-
-##############################  
-#   Restore initial value    #
-##############################
-
-SET @@timestamp = @session_start_value;
-
-#######################################################################
-#                    END OF timestamp TESTS                           #
-#######################################################################
-
diff --git a/mysql-test/include/tmp_table_size_basic.inc b/mysql-test/include/tmp_table_size_basic.inc
deleted file mode 100644
index 7f69bcd1f8c..00000000000
--- a/mysql-test/include/tmp_table_size_basic.inc
+++ /dev/null
@@ -1,233 +0,0 @@
-############## mysql-test\t\tmp_table_size_basic.test #########################
-#                                                                             #
-# Variable Name: tmp_table_size                                               #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 33554432                                                     #
-# Range: 1024-4294967295                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-13                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable tmp_table_size           #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html#option_mysqld_tmp_table_size                  #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-##############################################################
-#           START OF tmp_table_size TESTS                    #
-##############################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.tmp_table_size;
-SELECT @start_global_value;
-SET @start_session_value = @@session.tmp_table_size;
-SELECT @start_session_value;
-
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
---echo '#--------------------FN_DYNVARS_005_01-------------------------#'
-##############################################################
-#     Display the DEFAULT value of tmp_table_size            #
-##############################################################
-
-SET @@global.tmp_table_size = 100;
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size;
-
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-SET @@session.tmp_table_size = 200;
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size;
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
-
---echo '#--------------------FN_DYNVARS_005_02-------------------------#'
-########################################################################
-#     Check the DEFAULT value of tmp_table_size              #
-########################################################################
-
-SET @@global.tmp_table_size = DEFAULT;
-SELECT @@global.tmp_table_size = 33554432;
-
-SET @@session.tmp_table_size = DEFAULT;
-SELECT @@session.tmp_table_size = 33554432;
-
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
---echo '#--------------------FN_DYNVARS_005_03-------------------------#'
-########################################################################
-# Change the value of tmp_table_size to a valid value for GLOBAL Scope #
-########################################################################
-
-SET @@global.tmp_table_size = 1024;
-SELECT @@global.tmp_table_size;
-SET @@global.tmp_table_size = 60020;
-SELECT @@global.tmp_table_size;
-SET @@global.tmp_table_size = 4294967295;
-SELECT @@global.tmp_table_size;
-
-
---echo '#--------------------FN_DYNVARS_005_04-------------------------#'
-#########################################################################
-# Change the value of tmp_table_size to a valid value for SESSION Scope #
-#########################################################################
- 
-SET @@session.tmp_table_size = 1024;
-SELECT @@session.tmp_table_size;
-
-SET @@session.tmp_table_size =4294967295;
-SELECT @@session.tmp_table_size;
-SET @@session.tmp_table_size = 65535;
-SELECT @@session.tmp_table_size;
-
-
---echo '#------------------FN_DYNVARS_005_05-----------------------#'
-##########################################################
-# Change the value of tmp_table_size to an invalid value #
-##########################################################
-
-SET @@global.tmp_table_size = 0;
-SELECT @@global.tmp_table_size;
-
-SET @@global.tmp_table_size = -1024;
-SELECT @@global.tmp_table_size;
-
-SET @@global.tmp_table_size = 1000;
-SELECT @@global.tmp_table_size;
-
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.tmp_table_size = ON;
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.tmp_table_size = OFF;
-
-
-SET @@global.tmp_table_size = True;
-SELECT @@global.tmp_table_size;
-
-SET @@global.tmp_table_size = False;
-SELECT @@global.tmp_table_size;
---echo 'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.tmp_table_size = 65530.34;
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.tmp_table_size ="Test";
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.tmp_table_size = ON;
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.tmp_table_size = OFF;
-
-SET @@session.tmp_table_size = True;
-SELECT @@session.tmp_table_size;
-
-SET @@session.tmp_table_size = False;
-SELECT @@session.tmp_table_size;
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.tmp_table_size = "Test";
-
-SET @@session.tmp_table_size = 12345678901;
-SELECT @@session.tmp_table_size;
-
-
---echo '#------------------FN_DYNVARS_005_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.tmp_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='tmp_table_size';
-
---echo '#------------------FN_DYNVARS_005_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.tmp_table_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='tmp_table_size';
-
-
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-########################################################################
-#  Check if global and session variables are independent of each other #
-########################################################################
-
-SET @@global.tmp_table_size = 1024;
-SET @@tmp_table_size = 4294967295;
-SELECT @@tmp_table_size = @@global.tmp_table_size;
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-##################################################################
-#    Check if accessing variable with SESSION,LOCAL and without  #
-#    SCOPE points to same session variable                       #
-##################################################################
-
-SET @@tmp_table_size = 100;
-SELECT @@tmp_table_size = @@local.tmp_table_size;
-SELECT @@local.tmp_table_size = @@session.tmp_table_size;
-
-
---echo '#---------------------FN_DYNVARS_001_11----------------------#'
-#########################################################################
-#   Check if tmp_table_size can be accessed with and without @@ sign    #
-#########################################################################
-
-SET tmp_table_size = 1027;
-SELECT @@tmp_table_size;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.tmp_table_size;
-
---Error ER_UNKNOWN_TABLE
-SELECT global.tmp_table_size;
-
---Error ER_BAD_FIELD_ERROR
-SELECT tmp_table_size = @@session.tmp_table_size;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.tmp_table_size = @start_global_value;
-SELECT @@global.tmp_table_size;
-SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.tmp_table_size;
-
-
-###################################################
-#                 END OF tmp_table_size TESTS     #
-###################################################
-
diff --git a/mysql-test/include/transaction_alloc_block_size_basic.inc b/mysql-test/include/transaction_alloc_block_size_basic.inc
deleted file mode 100644
index c14383b86c6..00000000000
--- a/mysql-test/include/transaction_alloc_block_size_basic.inc
+++ /dev/null
@@ -1,240 +0,0 @@
-############## mysql-test\t\transaction_alloc_block_size_basic.test ###########
-#                                                                             #
-# Variable Name: transaction_alloc_block_size                                 #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 8192                                                         #
-# Range: 1024-4294967295                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-14                                                   #
-# Author:  Salman                                                             #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable                          #
-#              transaction_alloc_block_size                                   #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-########################################################################
-#           START OF transaction_alloc_block_size TESTS                #
-########################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.transaction_alloc_block_size;
-SELECT @start_global_value;
-SET @start_session_value = @@session.transaction_alloc_block_size;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_005_01-------------------------#'
-########################################################################
-#     Display the DEFAULT value of transaction_alloc_block_size        #
-########################################################################
-
-SET @@global.transaction_alloc_block_size = 100;
-SET @@global.transaction_alloc_block_size = DEFAULT;
-SELECT @@global.transaction_alloc_block_size;
-
-
-SET @@session.transaction_alloc_block_size = 200;
-SET @@session.transaction_alloc_block_size = DEFAULT;
-SELECT @@session.transaction_alloc_block_size;
-
-
-
---echo '#--------------------FN_DYNVARS_005_02-------------------------#'
-########################################################################
-#     Check the DEFAULT value of transaction_alloc_block_size          #
-########################################################################
-
-SET @@global.transaction_alloc_block_size = DEFAULT;
-SELECT @@global.transaction_alloc_block_size = 8192;
-
-SET @@session.transaction_alloc_block_size = DEFAULT;
-SELECT @@session.transaction_alloc_block_size = 8192;
-
-
---echo '#--------------------FN_DYNVARS_005_03-------------------------#'
-##################################################################
-# Change the value of variable to a valid value for GLOBAL Scope #
-##################################################################
-
-SET @@global.transaction_alloc_block_size = 1024;
-SELECT @@global.transaction_alloc_block_size;
-
-SET @@global.transaction_alloc_block_size = 60020;
-SELECT @@global.transaction_alloc_block_size;
-
-SET @@global.transaction_alloc_block_size = 4294967295;
-SELECT @@global.transaction_alloc_block_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
---echo '#--------------------FN_DYNVARS_005_04-------------------------#'
-###################################################################
-# Change the value of variable to a valid value for SESSION Scope #
-###################################################################
- 
-SET @@session.transaction_alloc_block_size = 1024;
-SELECT @@session.transaction_alloc_block_size;
-
-SET @@session.transaction_alloc_block_size =4294967295;
-SELECT @@session.transaction_alloc_block_size;
-
-SET @@session.transaction_alloc_block_size = 65535;
-SELECT @@session.transaction_alloc_block_size;
---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
-
-
---echo '#------------------FN_DYNVARS_005_05-----------------------#'
-########################################################################
-# Change the value of transaction_alloc_block_size to an invalid value #
-########################################################################
-
-SET @@global.transaction_alloc_block_size = 0;
-SELECT @@global.transaction_alloc_block_size;
-
-SET @@global.transaction_alloc_block_size = -1024;
-SELECT @@global.transaction_alloc_block_size;
-
-
-SET @@global.transaction_alloc_block_size = 123456789201;
-SELECT @@global.transaction_alloc_block_size;
-
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.transaction_alloc_block_size = ON;
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.transaction_alloc_block_size = OFF;
-
-
-SET @@global.transaction_alloc_block_size = True;
-SELECT @@global.transaction_alloc_block_size;
-
-SET @@global.transaction_alloc_block_size = False;
-SELECT @@global.transaction_alloc_block_size;
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.transaction_alloc_block_size = 65530.34;
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.transaction_alloc_block_size ="Test";
-
-SET @@global.transaction_alloc_block_size = 1000;
-SELECT @@global.transaction_alloc_block_size;
-
-SET @@session.transaction_alloc_block_size = 12345678901;
-SELECT @@session.transaction_alloc_block_size;
-
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.transaction_alloc_block_size = ON;
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.transaction_alloc_block_size = OFF;
-
-SET @@session.transaction_alloc_block_size = True;
-SELECT @@session.transaction_alloc_block_size;
-
-SET @@session.transaction_alloc_block_size = False;
-SELECT @@session.transaction_alloc_block_size;
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.transaction_alloc_block_size = "Test";
-
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.transaction_alloc_block_size = 'test';
-
---echo '#------------------FN_DYNVARS_005_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='transaction_alloc_block_size';
-
---echo '#------------------FN_DYNVARS_005_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='transaction_alloc_block_size';
-
-
---echo '#---------------------FN_DYNVARS_001_08----------------------#'
-###########################################################################
-#  Check if global and session variable are independent of each other     #
-###########################################################################
-
-SET @@transaction_alloc_block_size = 1024;
-SET @@global.transaction_alloc_block_size = 4294967295;
-SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
- 
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-########################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE  #
-#    points to same session variable                                   #
-########################################################################
-
-SET @@transaction_alloc_block_size = 100;
-SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size;
-SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size;
-
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-################################################################
-#   Check if variable can be accessed with and without @@ sign #
-################################################################
-
-SET transaction_alloc_block_size = 1027;
-SELECT @@transaction_alloc_block_size;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.transaction_alloc_block_size;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.transaction_alloc_block_size;
-
---Error ER_BAD_FIELD_ERROR
-SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.transaction_alloc_block_size = @start_global_value;
-SELECT @@global.transaction_alloc_block_size;
-SET @@session.tmp_table_size = @start_session_value;
-SELECT @@session.transaction_alloc_block_size;
-
-
-#############################################################
-#             END OF transaction_alloc_block_size TESTS     #
-#############################################################
-
diff --git a/mysql-test/include/transaction_prealloc_size_basic.inc b/mysql-test/include/transaction_prealloc_size_basic.inc
deleted file mode 100644
index 1ca302a19e0..00000000000
--- a/mysql-test/include/transaction_prealloc_size_basic.inc
+++ /dev/null
@@ -1,229 +0,0 @@
-############## mysql-test\t\transaction_prealloc_size_basic.test ##############
-#                                                                             #
-# Variable Name: transaction_prealloc_size                                    #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value: 4096                                                         #
-# Range:                                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-14                                                   #
-# Author: Sharique Abdullah                                                       #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable transaction_prealloc_size#
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html#option_mysqld_transaction_prealloc_size       #
-#                                                                             #
-###############################################################################
-
---source include/load_sysvars.inc
-
-########################################################################
-#           START OF transaction_prealloc_size TESTS                   #
-########################################################################
-
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.transaction_prealloc_size;
-SELECT @start_global_value;
-SET @start_session_value = @@session.transaction_prealloc_size;
-SELECT @start_session_value;
-
---echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
-
---echo '#--------------------FN_DYNVARS_005_01-------------------------#'
-########################################################################
-#     Display the DEFAULT value of transaction_prealloc_size           #
-########################################################################
-
-SET @@global.transaction_prealloc_size = 100;
-SET @@global.transaction_prealloc_size = DEFAULT;
-SELECT @@global.transaction_prealloc_size;
-
-
-SET @@session.transaction_prealloc_size = 200;
-SET @@session.transaction_prealloc_size = DEFAULT;
-SELECT @@session.transaction_prealloc_size;
-
---echo '#--------------------FN_DYNVARS_005_02-------------------------#'
-########################################################################
-#     Check the DEFAULT value of transaction_prealloc_size             #
-########################################################################
-
-SET @@global.transaction_prealloc_size = DEFAULT;
-SELECT @@global.transaction_prealloc_size = 4096;
-
-SET @@session.transaction_prealloc_size = DEFAULT;
-SELECT @@session.transaction_prealloc_size = 4096;
-
---echo '#--------------------FN_DYNVARS_005_03-------------------------#'
-##################################################################
-# Change the value of variable to a valid value for GLOBAL Scope #
-##################################################################
-
-SET @@global.transaction_prealloc_size = 1024;
-SELECT @@global.transaction_prealloc_size;
-
-SET @@global.transaction_prealloc_size = 60020;
-SELECT @@global.transaction_prealloc_size;
-
-SET @@global.transaction_prealloc_size = 4294966272;
-SELECT @@global.transaction_prealloc_size;
-
-
---echo '#--------------------FN_DYNVARS_005_04-------------------------#'
-###################################################################
-# Change the value of variable to a valid value for SESSION Scope #
-###################################################################
- 
-SET @@session.transaction_prealloc_size = 1024;
-SELECT @@session.transaction_prealloc_size;
-
-SET @@session.transaction_prealloc_size =4294966272;
-SELECT @@session.transaction_prealloc_size;
-SET @@session.transaction_prealloc_size = 65535;
-SELECT @@session.transaction_prealloc_size;
-
-
---echo '#------------------FN_DYNVARS_005_05-----------------------#'
-#####################################################################
-# Change the value of transaction_prealloc_size to an invalid value #
-#####################################################################
-
-SET @@global.transaction_prealloc_size = 0;
-SELECT @@global.transaction_prealloc_size;
-
-SET @@global.transaction_prealloc_size = -1024;
-SELECT @@global.transaction_prealloc_size;
-
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.transaction_prealloc_size = ON;
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.transaction_prealloc_size = OFF;
-
-
-SET @@global.transaction_prealloc_size = True;
-SELECT @@global.transaction_prealloc_size;
-
-SET @@global.transaction_prealloc_size = False;
-SELECT @@global.transaction_prealloc_size;
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.transaction_prealloc_size = 65530.34;
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.transaction_prealloc_size ="Test";
-
-SET @@global.transaction_prealloc_size = 1000;
-SELECT @@global.transaction_prealloc_size;
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.transaction_prealloc_size = ON;
-
-
--- Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.transaction_prealloc_size = OFF;
-
-SET @@session.transaction_prealloc_size = True;
-SELECT @@session.transaction_prealloc_size;
-
-SET @@session.transaction_prealloc_size = False;
-SELECT @@session.transaction_prealloc_size;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.transaction_prealloc_size = "Test";
-
-SET @@session.transaction_prealloc_size = 123456789031;
-SELECT @@session.transaction_prealloc_size;
-
-
---echo '#------------------FN_DYNVARS_005_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-
-SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='transaction_prealloc_size';
-
---echo '#------------------FN_DYNVARS_005_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
-WHERE VARIABLE_NAME='transaction_prealloc_size';
-
-
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-###########################################################################
-#  Check if global and session variable are independent of each other     #
-###########################################################################
-
-SET @@global.transaction_prealloc_size = 1024;
-SET @@global.transaction_prealloc_size = 10;
-
-SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
- 
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-########################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE  #
-#    points to same session variable                                   #
-########################################################################
-
-SET @@transaction_prealloc_size = 100;
-SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size;
-SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size;
-
-
---echo '#---------------------FN_DYNVARS_001_11----------------------#'
-###############################################################################
-# Check if transaction_prealloc_size can be accessed with and without @@ sign #
-###############################################################################
-
-SET transaction_prealloc_size = 1027;
-SELECT @@transaction_prealloc_size;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.transaction_prealloc_size;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.transaction_prealloc_size;
-
---Error ER_BAD_FIELD_ERROR
-SELECT transaction_prealloc_size = @@session.transaction_prealloc_size;
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.transaction_prealloc_size = @start_global_value;
-SELECT @@global.transaction_prealloc_size;
-SET @@session.transaction_prealloc_size = @start_session_value;
-SELECT @@session.transaction_prealloc_size;
-
-
-#############################################################
-#                 END OF transaction_prealloc_size TESTS     #
-#############################################################
-

From 7a6d7491b5cc0eced2f769d4683f4a9f2461dd82 Mon Sep 17 00:00:00 2001
From: Horst Hunger <horst@mysql.com>
Date: Tue, 22 Jul 2008 19:00:27 +0200
Subject: [PATCH 07/33] Fix for bug#37708: Deleted the removed tests.

---
 mysql-test/t/disabled.def | 82 ---------------------------------------
 1 file changed, 82 deletions(-)

diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index c058992d795..ada7cb3aa97 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -12,88 +12,6 @@
 federated_transactions   : Bug#29523 Transactions do not work
 csv_alter_table      : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables
 thread_cache_size_func : Bug#36733 main.thread_cache_size_func fails randomly
-binlog_cache_size_basic_32            : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-bulk_insert_buffer_size_basic_32      : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-delayed_insert_limit_basic_32         : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-delayed_queue_size_basic_32           : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-innodb_concurrency_tickets_basic_32   : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-innodb_max_purge_lag_basic_32         : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-innodb_sync_spin_loops_basic_32       : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-join_buffer_size_basic_32             : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-key_buffer_size_basic_32              : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-key_cache_age_threshold_basic_32      : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-key_cache_block_size_basic_32         : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-key_cache_division_limit_basic_32     : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-log_warnings_basic_32                 : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_binlog_cache_size_basic_32        : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_connect_errors_basic_32           : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_heap_table_size_basic_32          : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_seeks_for_key_basic_32            : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_tmp_tables_basic_32               : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_write_lock_count_basic_32         : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-min_examined_row_limit_basic_32       : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-multi_range_count_basic_32            : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-myisam_max_sort_file_size_basic_32    : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-myisam_repair_threads_basic_32        : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-myisam_sort_buffer_size_basic_32      : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-net_retry_count_basic_32              : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-query_alloc_block_size_basic_32       : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-query_cache_limit_basic_32            : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-query_cache_min_res_unit_basic_32     : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-query_cache_size_basic_32             : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-query_prealloc_size_basic_32          : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-range_alloc_block_size_basic_32       : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-rpl_recovery_rank_basic_32            : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-server_id_basic_32                    : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-slave_transaction_retries_basic_32    : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-sort_buffer_size_basic_32             : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-sync_binlog_basic_32                  : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-timestamp_basic_32                    : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-tmp_table_size_basic_32               : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-transaction_alloc_block_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-transaction_prealloc_size_basic_32    : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-wait_timeout_basic_32                 : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-binlog_cache_size_basic_64            : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-bulk_insert_buffer_size_basic_64      : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-delayed_insert_limit_basic_64         : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-delayed_queue_size_basic_64           : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-innodb_concurrency_tickets_basic_64   : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-innodb_max_purge_lag_basic_64         : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-innodb_sync_spin_loops_basic_64       : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-join_buffer_size_basic_64             : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-key_buffer_size_basic_64              : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-key_cache_age_threshold_basic_64      : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-key_cache_block_size_basic_64         : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-key_cache_division_limit_basic_64     : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-log_warnings_basic_64                 : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_binlog_cache_size_basic_64        : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_connect_errors_basic_64           : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_heap_table_size_basic_64          : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_seeks_for_key_basic_64            : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_tmp_tables_basic_64               : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-max_write_lock_count_basic_64         : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-min_examined_row_limit_basic_64       : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-multi_range_count_basic_64            : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-myisam_max_sort_file_size_basic_64    : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-myisam_repair_threads_basic_64        : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-myisam_sort_buffer_size_basic_64      : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-net_retry_count_basic_64              : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-query_alloc_block_size_basic_64       : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-query_cache_limit_basic_64            : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-query_cache_min_res_unit_basic_64     : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-query_cache_size_basic_64             : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-query_prealloc_size_basic_64          : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-range_alloc_block_size_basic_64       : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-rpl_recovery_rank_basic_64            : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-server_id_basic_64                    : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-slave_transaction_retries_basic_64    : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-sort_buffer_size_basic_64             : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-sync_binlog_basic_64                  : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-timestamp_basic_64                    : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-tmp_table_size_basic_64               : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-transaction_alloc_block_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-transaction_prealloc_size_basic_64    : Bug #36522: Some tests of system variables have diffs on 64bit platorms
-wait_timeout_basic_64                 : Bug #36522: Some tests of system variables have diffs on 64bit platorms
 log_tables.test                       : Bug #37798: main.log_tables fails randomly on powermacg5 and windows
 slow_query_log_func.test              : Bug #37962: *_func tests containing sleeps/race conditions
 

From 62b41dddd9ec15478b29c1b4c52cf9baedb85ef2 Mon Sep 17 00:00:00 2001
From: Horst Hunger <horst@mysql.com>
Date: Wed, 23 Jul 2008 08:51:04 +0200
Subject: [PATCH 08/33] fix of bug#37708: removed a forgotten include file.

---
 mysql-test/include/wait_timeout_basic.inc | 218 ----------------------
 1 file changed, 218 deletions(-)
 delete mode 100644 mysql-test/include/wait_timeout_basic.inc

diff --git a/mysql-test/include/wait_timeout_basic.inc b/mysql-test/include/wait_timeout_basic.inc
deleted file mode 100644
index b6e19e235ba..00000000000
--- a/mysql-test/include/wait_timeout_basic.inc
+++ /dev/null
@@ -1,218 +0,0 @@
-############## mysql-test\t\wait_timeout_basic.test ###########################
-#                                                                             #
-# Variable Name: wait_timeout                                                 #
-# Scope: GLOBAL | SESSION                                                     #
-# Access Type: Dynamic                                                        #
-# Data Type: numeric                                                          #
-# Default Value:                                                              #
-# Range:                                                                      #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author:  Sharique Abdullah                                                      #
-#                                                                             #
-# Description: Test Cases of Dynamic System Variable wait_timeout             #
-#              that checks the behavior of this variable in the following ways#
-#              * Default Value                                                #
-#              * Valid & Invalid values                                       #
-#              * Scope & Access method                                        #
-#              * Data Integrity                                               #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html#option_mysqld_wait_timeouts                   #
-#                                                                             #
-###############################################################################
-# Due to differnces between linux and windows in the results
-
---source include/not_windows.inc
---source include/load_sysvars.inc
-
-############################################################
-#           START OF wait_timeout TESTS                    #
-############################################################
-
-#############################################################
-#                 Save initial value                        #
-#############################################################
-
-SET @start_global_value = @@global.wait_timeout;
-SET @start_session_value = @@session.wait_timeout;
-
---echo '#--------------------FN_DYNVARS_005_01-------------------------#'
-############################################################
-#     Display the DEFAULT value of wait_timeout            #
-############################################################
-
-SET @@global.wait_timeout = 100;
-SET @@global.wait_timeout = DEFAULT;
-SELECT @@global.wait_timeout;
-
-SET @@session.wait_timeout = 200;
-SET @@session.wait_timeout = DEFAULT;
-SELECT @@session.wait_timeout;
-
-
---echo '#--------------------FN_DYNVARS_005_02-------------------------#'
-############################################################
-#     Check the DEFAULT value of wait_timeout              #
-############################################################
-
-SET @@global.wait_timeout = DEFAULT;
-SELECT @@global.wait_timeout = @default_wait_timeout;
-
-SET @@session.wait_timeout = DEFAULT;
-SELECT @@session.wait_timeout = @default_wait_timeout;
-
-
-
---echo '#--------------------FN_DYNVARS_005_03-------------------------#'
-######################################################################
-# Change the value of wait_timeout to a valid value for GLOBAL Scope #
-######################################################################
-
-#SET @@global.wait_timeout= @min_wait_timeout;
-SET @@global.wait_timeout= 1;
-SELECT @@global.wait_timeout;
-
-SET @@global.wait_timeout = 60020;
-SELECT @@global.wait_timeout;
-
-#SET @@global.wait_timeout = @max_wait_timeout;
-SET @@global.wait_timeout = 31536000;
-SELECT @@global.wait_timeout = @max_wait_timeout;
-
-
---echo '#--------------------FN_DYNVARS_005_04-------------------------#'
-#######################################################################
-# Change the value of wait_timeout to a valid value for SESSION Scope #
-#######################################################################
-#SET @@session.wait_timeout = @min_wait_timeout;
-#SELECT @@session.wait_timeout;
-
-SET @@session.wait_timeout =6000;
-SELECT @@session.wait_timeout;
-
-#SET @@session.wait_timeout = @max_wait_timeout;
-#SELECT @@session.wait_timeout = @max_wait_timeout;
-
-
---echo '#------------------FN_DYNVARS_005_05-----------------------#'
-########################################################
-# Change the value of wait_timeout to an invalid value #
-########################################################
-
-SET @@global.wait_timeout = 0;
-SET @@global.wait_timeout = -1024;
-
---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.wait_timeout = ON;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.wait_timeout = OFF;
-
-SET @@global.wait_timeout = True;
-SELECT @@global.wait_timeout;
-
-SET @@global.wait_timeout = False;
-SELECT @@global.wait_timeout;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.wait_timeout = 65530.34;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.wait_timeout ="Test";
-
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.wait_timeout = ON;
-
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.wait_timeout = OFF;
-
-SET @@session.wait_timeout = True;
-SELECT @@session.wait_timeout;
-
-SET @@session.wait_timeout = False;
-SELECT @@session.wait_timeout;
-
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.wait_timeout = "Test";
-
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.wait_timeout = 'test';
-
-SET @@session.wait_timeout = 123456789031;
-SELECT @@session.wait_timeout = @max_wait_timeout;
-
-
---echo '#------------------FN_DYNVARS_005_06-----------------------#'
-####################################################################
-#   Check if the value in GLOBAL Table matches value in variable   #
-####################################################################
-
-SELECT @@global.wait_timeout = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='wait_timeout';
-
---echo '#------------------FN_DYNVARS_005_07-----------------------#'
-####################################################################
-#  Check if the value in SESSION Table matches value in variable   #
-####################################################################
-
-SELECT @@session.wait_timeout = VARIABLE_VALUE 
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='wait_timeout';
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-###########################################################################
-#  Check if global and session variable are independent of each other     #
-###########################################################################
-
-SET @@global.wait_timeout = 30000;
-SET @@global.wait_timeout = 40000;
-SELECT @@wait_timeout = @@global.wait_timeout;
-
---echo '#---------------------FN_DYNVARS_001_10----------------------#'
-########################################################################
-#    Check if accessing variable with SESSION,LOCAL and without SCOPE  #
-#    points to same session variable                                   #
-########################################################################
-
-SET @@wait_timeout = 100;
-SELECT @@wait_timeout = @@local.wait_timeout;
-SELECT @@local.wait_timeout = @@session.wait_timeout;
-
---echo '#---------------------FN_DYNVARS_001_11----------------------#'
-#######################################################################
-#   Check if wait_timeout can be accessed with and without @@ sign    #
-#######################################################################
-
-SET wait_timeout = 1027;
-SELECT @@wait_timeout;
-
-
---Error ER_UNKNOWN_TABLE
-SELECT local.wait_timeout;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.wait_timeout;
-
---Error ER_BAD_FIELD_ERROR
-SELECT wait_timeout = @@session.wait_timeout;
-
-
-####################################
-#     Restore initial value        #
-####################################
-
-SET @@global.wait_timeout = @start_global_value;
-SET @@session.wait_timeout = @start_session_value;
-
-#################################################
-#                 END OF wait_timeout TESTS     #
-#################################################

From 436f1dc49cbb635e5b44ab1d625e3ef6d8d3e4e6 Mon Sep 17 00:00:00 2001
From: Georgi Kodinov <kgeorge@mysql.com>
Date: Wed, 23 Jul 2008 14:25:00 +0300
Subject: [PATCH 09/33] Bug#37830 : ORDER BY ASC/DESC - no difference

Range scan in descending order for c <= <col> <= c type of
ranges was ignoring the DESC flag.
However some engines like InnoDB have the primary key parts
as a suffix for every secondary key.
When such primary key suffix is used for ordering ignoring
the DESC is not valid.
But we generally would like to do this because it's faster.

Fixed by performing only reverse scan if the primary key is used.
Removed some dead code in the process.
---
 mysql-test/r/innodb_mysql.result | 15 ++++++++
 mysql-test/t/innodb_mysql.test   | 18 +++++++++
 sql/opt_range.cc                 | 66 ++++++--------------------------
 sql/opt_range.h                  |  4 +-
 sql/sql_select.cc                | 59 +++++++++++++++++-----------
 5 files changed, 83 insertions(+), 79 deletions(-)

diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index b487cfd9a4b..47fa331c9ab 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -1246,4 +1246,19 @@ set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
 set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
 set global innodb_commit_concurrency=0;
 set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
+CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b))
+ENGINE=InnoDB;
+INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
+INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
+EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	t1_b	t1_b	5	NULL	4	Using where
+SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
+a	b	c
+8	1	1
+7	1	1
+6	1	1
+5	1	1
+4	1	1
+DROP TABLE t1;
 End of 5.0 tests
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index 59ee7c274bb..e15d1aee08a 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -996,4 +996,22 @@ set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
 set global innodb_commit_concurrency=0;
 set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
 
+#
+# Bug #37830: ORDER BY ASC/DESC - no difference
+#
+
+CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b))
+ ENGINE=InnoDB;
+
+INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
+INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
+
+# should be range access
+EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
+
+# should produce '8 7 6 5 4' for a
+SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
+
+DROP TABLE t1;
+
 --echo End of 5.0 tests
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 95cda371673..7587db4e329 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -7099,7 +7099,8 @@ bool QUICK_RANGE_SELECT::row_in_ranges()
 
 QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q,
                                      uint used_key_parts_arg)
- : QUICK_RANGE_SELECT(*q), rev_it(rev_ranges)
+ : QUICK_RANGE_SELECT(*q), rev_it(rev_ranges), 
+  used_key_parts (used_key_parts_arg)
 {
   QUICK_RANGE *r;
 
@@ -7141,10 +7142,11 @@ int QUICK_SELECT_DESC::get_next()
     int result;
     if (last_range)
     {						// Already read through key
-      result = ((last_range->flag & EQ_RANGE)
-		? file->index_next_same(record, (byte*) last_range->min_key,
-					last_range->min_length) :
-		file->index_prev(record));
+      result = ((last_range->flag & EQ_RANGE && 
+                 used_key_parts <= head->key_info[index].key_parts) ? 
+                file->index_next_same(record, (byte*) last_range->min_key,
+                                      last_range->min_length) :
+                file->index_prev(record));
       if (!result)
       {
 	if (cmp_prev(*rev_it.ref()) == 0)
@@ -7168,7 +7170,9 @@ int QUICK_SELECT_DESC::get_next()
       continue;
     }
 
-    if (last_range->flag & EQ_RANGE)
+    if (last_range->flag & EQ_RANGE &&
+        used_key_parts <= head->key_info[index].key_parts)
+
     {
       result= file->index_read(record, (byte*) last_range->max_key,
                                last_range->max_length, HA_READ_KEY_EXACT);
@@ -7176,6 +7180,8 @@ int QUICK_SELECT_DESC::get_next()
     else
     {
       DBUG_ASSERT(last_range->flag & NEAR_MAX ||
+                  (last_range->flag & EQ_RANGE && 
+                   used_key_parts > head->key_info[index].key_parts) ||
                   range_reads_after_key(last_range));
       result=file->index_read(record, (byte*) last_range->max_key,
 			      last_range->max_length,
@@ -7273,54 +7279,6 @@ bool QUICK_SELECT_DESC::range_reads_after_key(QUICK_RANGE *range_arg)
 }
 
 
-/* TRUE if we are reading over a key that may have a NULL value */
-
-#ifdef NOT_USED
-bool QUICK_SELECT_DESC::test_if_null_range(QUICK_RANGE *range_arg,
-					   uint used_key_parts)
-{
-  uint offset, end;
-  KEY_PART *key_part = key_parts,
-           *key_part_end= key_part+used_key_parts;
-
-  for (offset= 0,  end = min(range_arg->min_length, range_arg->max_length) ;
-       offset < end && key_part != key_part_end ;
-       offset+= key_part++->store_length)
-  {
-    if (!memcmp((char*) range_arg->min_key+offset,
-		(char*) range_arg->max_key+offset,
-		key_part->store_length))
-      continue;
-
-    if (key_part->null_bit && range_arg->min_key[offset])
-      return 1;				// min_key is null and max_key isn't
-    // Range doesn't cover NULL. This is ok if there is no more null parts
-    break;
-  }
-  /*
-    If the next min_range is > NULL, then we can use this, even if
-    it's a NULL key
-    Example:  SELECT * FROM t1 WHERE a = 2 AND b >0 ORDER BY a DESC,b DESC;
-
-  */
-  if (key_part != key_part_end && key_part->null_bit)
-  {
-    if (offset >= range_arg->min_length || range_arg->min_key[offset])
-      return 1;					// Could be null
-    key_part++;
-  }
-  /*
-    If any of the key parts used in the ORDER BY could be NULL, we can't
-    use the key to sort the data.
-  */
-  for (; key_part != key_part_end ; key_part++)
-    if (key_part->null_bit)
-      return 1;					// Covers null part
-  return 0;
-}
-#endif
-
-
 void QUICK_RANGE_SELECT::add_info_string(String *str)
 {
   KEY *key_info= head->key_info + index;
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 3a737323eb7..8856223b371 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -667,12 +667,10 @@ public:
   int get_type() { return QS_TYPE_RANGE_DESC; }
 private:
   bool range_reads_after_key(QUICK_RANGE *range);
-#ifdef NOT_USED
-  bool test_if_null_range(QUICK_RANGE *range, uint used_key_parts);
-#endif
   int reset(void) { rev_it.rewind(); return QUICK_RANGE_SELECT::reset(); }
   List<QUICK_RANGE> rev_ranges;
   List_iterator<QUICK_RANGE> rev_it;
+  uint used_key_parts;
 };
 
 
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 60ba7591726..bcc5f30180f 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -12088,26 +12088,25 @@ part_of_refkey(TABLE *table,Field *field)
 }
 
 
-/*****************************************************************************
-  Test if one can use the key to resolve ORDER BY
+/**
+  Test if a key can be used to resolve ORDER BY
 
-  SYNOPSIS
-    test_if_order_by_key()
-    order		Sort order
-    table		Table to sort
-    idx			Index to check
-    used_key_parts	Return value for used key parts.
+  used_key_parts is set to correct key parts used if return value != 0
+  (On other cases, used_key_part may be changed).
+  Note that the value may actually be greater than the number of index 
+  key parts. This can happen for storage engines that have the primary 
+  key parts as a suffix for every secondary key.
 
+  @param      order		Sort order
+  @param      table		Table to sort
+  @param      idx		Index to check
+  @param[out] used_key_parts	Return value for used key parts.
 
-  NOTES
-    used_key_parts is set to correct key parts used if return value != 0
-    (On other cases, used_key_part may be changed)
-
-  RETURN
-    1   key is ok.
-    0   Key can't be used
-    -1  Reverse key can be used
-*****************************************************************************/
+  @return indication if the key can be used for sorting
+    @retval 1   key can be used for reading data in order.
+    @retval 0   Key can't be used
+    @retval -1  Reverse read on the key can be used
+*/
 
 static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
 				uint *used_key_parts)
@@ -12172,11 +12171,27 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
     reverse=flag;				// Remember if reverse
     key_part++;
   }
-  *used_key_parts= on_primary_key ? table->key_info[idx].key_parts :
-    (uint) (key_part - table->key_info[idx].key_part);
-  if (reverse == -1 && !(table->file->index_flags(idx, *used_key_parts-1, 1) &
-                         HA_READ_PREV))
-    reverse= 0;                                 // Index can't be used
+  if (on_primary_key)
+  {
+    uint used_key_parts_secondary= table->key_info[idx].key_parts;
+    uint used_key_parts_pk=
+      (uint) (key_part - table->key_info[table->s->primary_key].key_part);
+    *used_key_parts= used_key_parts_pk + used_key_parts_secondary;
+
+    if (reverse == -1 &&
+        (!(table->file->index_flags(idx, used_key_parts_secondary - 1, 1) &
+           HA_READ_PREV) ||
+         !(table->file->index_flags(table->s->primary_key,
+                                    used_key_parts_pk - 1, 1) & HA_READ_PREV)))
+      reverse= 0;                               // Index can't be used
+  }
+  else
+  {
+    *used_key_parts= (uint) (key_part - table->key_info[idx].key_part);
+    if (reverse == -1 && 
+        !(table->file->index_flags(idx, *used_key_parts-1, 1) & HA_READ_PREV))
+      reverse= 0;                               // Index can't be used
+  }
   DBUG_RETURN(reverse);
 }
 

From c199b9d51dbc72d0590a9d76dfc5113e01650b49 Mon Sep 17 00:00:00 2001
From: Horst Hunger <horst@mysql.com>
Date: Wed, 23 Jul 2008 16:06:44 +0200
Subject: [PATCH 10/33] Final fix for bug#36522 in 5.1. This new fix was
 necessary due to fix of bug 37708.

---
 mysql-test/suite/sys_vars/README              |   3 +
 .../sys_vars/inc/binlog_cache_size_basic.inc  | 154 +++++++++++
 .../inc/bulk_insert_buffer_size_basic.inc     | 203 +++++++++++++++
 .../inc/delayed_insert_limit_basic.inc        | 167 ++++++++++++
 .../sys_vars/inc/delayed_queue_size_basic.inc | 163 ++++++++++++
 .../inc/innodb_concurrency_tickets_basic.inc  | 147 +++++++++++
 .../inc/innodb_max_purge_lag_basic.inc        | 147 +++++++++++
 .../inc/innodb_sync_spin_loops_basic.inc      | 142 ++++++++++
 .../sys_vars/inc/join_buffer_size_basic.inc   | 216 ++++++++++++++++
 .../sys_vars/inc/key_buffer_size_basic.inc    | 187 ++++++++++++++
 .../inc/key_cache_age_threshold_basic.inc     | 180 +++++++++++++
 .../inc/key_cache_block_size_basic.inc        | 185 +++++++++++++
 .../inc/key_cache_division_limit_basic.inc    | 184 +++++++++++++
 .../suite/sys_vars/inc/log_warnings_basic.inc | 210 +++++++++++++++
 .../inc/max_binlog_cache_size_basic.inc       | 187 ++++++++++++++
 .../sys_vars/inc/max_connect_errors_basic.inc | 182 +++++++++++++
 .../inc/max_heap_table_size_basic.inc         | 222 ++++++++++++++++
 .../sys_vars/inc/max_seeks_for_key_basic.inc  | 213 +++++++++++++++
 .../sys_vars/inc/max_tmp_tables_basic.inc     | 227 ++++++++++++++++
 .../inc/max_write_lock_count_basic.inc        | 158 ++++++++++++
 .../inc/min_examined_row_limit_basic.inc      | 219 ++++++++++++++++
 .../sys_vars/inc/multi_range_count_basic.inc  | 219 ++++++++++++++++
 .../inc/myisam_max_sort_file_size_basic.inc   | 184 +++++++++++++
 .../inc/myisam_repair_threads_basic.inc       | 242 ++++++++++++++++++
 .../inc/myisam_sort_buffer_size_basic.inc     | 240 +++++++++++++++++
 .../sys_vars/inc/net_retry_count_basic.inc    | 217 ++++++++++++++++
 .../inc/query_alloc_block_size_basic.inc      | 225 ++++++++++++++++
 .../sys_vars/inc/query_cache_limit_basic.inc  | 178 +++++++++++++
 .../inc/query_cache_min_res_unit_basic.inc    | 187 ++++++++++++++
 .../sys_vars/inc/query_cache_size_basic.inc   | 175 +++++++++++++
 .../inc/query_prealloc_size_basic.inc         | 241 +++++++++++++++++
 .../inc/range_alloc_block_size_basic.inc      | 208 +++++++++++++++
 .../sys_vars/inc/rpl_recovery_rank_basic.inc  | 171 +++++++++++++
 .../suite/sys_vars/inc/server_id_basic.inc    | 190 ++++++++++++++
 .../inc/slave_transaction_retries_basic.inc   | 188 ++++++++++++++
 .../sys_vars/inc/sort_buffer_size_basic.inc   | 213 +++++++++++++++
 .../suite/sys_vars/inc/sync_binlog_basic.inc  | 156 +++++++++++
 .../suite/sys_vars/inc/timestamp_basic.inc    | 162 ++++++++++++
 .../sys_vars/inc/tmp_table_size_basic.inc     | 233 +++++++++++++++++
 .../transaction_alloc_block_size_basic.inc    | 240 +++++++++++++++++
 .../inc/transaction_prealloc_size_basic.inc   | 229 +++++++++++++++++
 .../suite/sys_vars/inc/wait_timeout_basic.inc | 218 ++++++++++++++++
 .../r/binlog_cache_size_basic_32.result       | 102 ++++++++
 .../r/binlog_cache_size_basic_64.result       | 100 ++++++++
 .../r/bulk_insert_buffer_size_basic_32.result | 154 +++++++++++
 .../r/bulk_insert_buffer_size_basic_64.result | 150 +++++++++++
 .../r/delayed_insert_limit_basic_32.result    | 112 ++++++++
 .../r/delayed_insert_limit_basic_64.result    | 110 ++++++++
 .../r/delayed_queue_size_basic_32.result      | 110 ++++++++
 .../r/delayed_queue_size_basic_64.result      | 108 ++++++++
 ...innodb_concurrency_tickets_basic_32.result | 100 ++++++++
 ...innodb_concurrency_tickets_basic_64.result |  98 +++++++
 .../r/innodb_max_purge_lag_basic_32.result    |  94 +++++++
 .../r/innodb_max_purge_lag_basic_64.result    |  92 +++++++
 .../r/innodb_sync_spin_loops_basic_32.result  |  94 +++++++
 .../r/innodb_sync_spin_loops_basic_64.result  |  92 +++++++
 .../r/join_buffer_size_basic_32.result        | 198 ++++++++++++++
 .../r/join_buffer_size_basic_64.result        | 194 ++++++++++++++
 .../r/key_buffer_size_basic_32.result         | 111 ++++++++
 .../r/key_buffer_size_basic_64.result         | 111 ++++++++
 .../r/key_cache_age_threshold_basic_32.result | 126 +++++++++
 .../r/key_cache_age_threshold_basic_64.result | 126 +++++++++
 .../r/key_cache_block_size_basic_32.result    | 142 ++++++++++
 .../r/key_cache_block_size_basic_64.result    | 142 ++++++++++
 .../key_cache_division_limit_basic_32.result  | 139 ++++++++++
 .../key_cache_division_limit_basic_64.result  | 139 ++++++++++
 .../sys_vars/r/log_warnings_basic_32.result   | 162 ++++++++++++
 .../sys_vars/r/log_warnings_basic_64.result   | 158 ++++++++++++
 .../r/max_binlog_cache_size_basic_32.result   | 145 +++++++++++
 .../r/max_binlog_cache_size_basic_64.result   | 141 ++++++++++
 .../r/max_connect_errors_basic_32.result      | 137 ++++++++++
 .../r/max_connect_errors_basic_64.result      | 133 ++++++++++
 .../r/max_heap_table_size_basic_32.result     | 196 ++++++++++++++
 .../r/max_heap_table_size_basic_64.result     | 196 ++++++++++++++
 .../r/max_seeks_for_key_basic_32.result       | 180 +++++++++++++
 .../r/max_seeks_for_key_basic_64.result       | 176 +++++++++++++
 .../sys_vars/r/max_tmp_tables_basic_32.result | 197 ++++++++++++++
 .../sys_vars/r/max_tmp_tables_basic_64.result | 187 ++++++++++++++
 .../r/max_write_lock_count_basic_32.result    | 108 ++++++++
 .../r/max_write_lock_count_basic_64.result    | 104 ++++++++
 .../r/min_examined_row_limit_basic_32.result  | 180 +++++++++++++
 .../r/min_examined_row_limit_basic_64.result  | 174 +++++++++++++
 .../r/multi_range_count_basic_32.result       | 192 ++++++++++++++
 .../r/multi_range_count_basic_64.result       | 184 +++++++++++++
 .../myisam_max_sort_file_size_basic_32.result | 114 +++++++++
 .../myisam_max_sort_file_size_basic_64.result | 114 +++++++++
 .../r/myisam_repair_threads_basic_32.result   | 180 +++++++++++++
 .../r/myisam_repair_threads_basic_64.result   | 178 +++++++++++++
 .../r/myisam_sort_buffer_size_basic_32.result | 184 +++++++++++++
 .../r/myisam_sort_buffer_size_basic_64.result | 182 +++++++++++++
 .../r/net_retry_count_basic_32.result         | 192 ++++++++++++++
 .../r/net_retry_count_basic_64.result         | 184 +++++++++++++
 .../r/query_alloc_block_size_basic_32.result  | 203 +++++++++++++++
 .../r/query_alloc_block_size_basic_64.result  | 199 ++++++++++++++
 .../r/query_cache_limit_basic_32.result       | 126 +++++++++
 .../r/query_cache_limit_basic_64.result       | 120 +++++++++
 .../query_cache_min_res_unit_basic_32.result  | 134 ++++++++++
 .../query_cache_min_res_unit_basic_64.result  | 130 ++++++++++
 .../r/query_cache_size_basic_32.result        | 138 ++++++++++
 .../r/query_cache_size_basic_64.result        | 134 ++++++++++
 .../r/query_prealloc_size_basic_32.result     | 192 ++++++++++++++
 .../r/query_prealloc_size_basic_64.result     | 190 ++++++++++++++
 .../r/range_alloc_block_size_basic_32.result  | 182 +++++++++++++
 .../r/range_alloc_block_size_basic_64.result  | 178 +++++++++++++
 .../r/rpl_recovery_rank_basic_32.result       | 110 ++++++++
 .../r/rpl_recovery_rank_basic_64.result       | 104 ++++++++
 .../sys_vars/r/server_id_basic_32.result      | 117 +++++++++
 .../sys_vars/r/server_id_basic_64.result      | 115 +++++++++
 .../slave_transaction_retries_basic_32.result | 119 +++++++++
 .../slave_transaction_retries_basic_64.result | 115 +++++++++
 .../r/sort_buffer_size_basic_32.result        | 193 ++++++++++++++
 .../r/sort_buffer_size_basic_64.result        | 189 ++++++++++++++
 .../sys_vars/r/sync_binlog_basic_32.result    | 105 ++++++++
 .../sys_vars/r/sync_binlog_basic_64.result    | 105 ++++++++
 .../sys_vars/r/timestamp_basic_32.result      |  73 ++++++
 .../sys_vars/r/timestamp_basic_64.result      |  73 ++++++
 .../sys_vars/r/tmp_table_size_basic_32.result | 172 +++++++++++++
 .../sys_vars/r/tmp_table_size_basic_64.result | 172 +++++++++++++
 ...ansaction_alloc_block_size_basic_32.result | 180 +++++++++++++
 ...ansaction_alloc_block_size_basic_64.result | 176 +++++++++++++
 .../transaction_prealloc_size_basic_32.result | 172 +++++++++++++
 .../transaction_prealloc_size_basic_64.result | 170 ++++++++++++
 .../sys_vars/r/wait_timeout_basic_32.result   | 129 ++++++++++
 .../sys_vars/r/wait_timeout_basic_64.result   | 129 ++++++++++
 .../t/binlog_cache_size_basic_32.test         |   9 +
 .../t/binlog_cache_size_basic_64.test         |   9 +
 .../t/bulk_insert_buffer_size_basic_32.test   |   9 +
 .../t/bulk_insert_buffer_size_basic_64.test   |   9 +
 .../t/delayed_insert_limit_basic_32.test      |   9 +
 .../t/delayed_insert_limit_basic_64.test      |   9 +
 .../t/delayed_queue_size_basic_32.test        |   9 +
 .../t/delayed_queue_size_basic_64.test        |   9 +
 .../innodb_concurrency_tickets_basic_32.test  |   9 +
 .../innodb_concurrency_tickets_basic_64.test  |   9 +
 .../t/innodb_max_purge_lag_basic_32.test      |   9 +
 .../t/innodb_max_purge_lag_basic_64.test      |   9 +
 .../t/innodb_sync_spin_loops_basic_32.test    |   9 +
 .../t/innodb_sync_spin_loops_basic_64.test    |   9 +
 .../sys_vars/t/join_buffer_size_basic_32.test |   9 +
 .../sys_vars/t/join_buffer_size_basic_64.test |   9 +
 .../sys_vars/t/key_buffer_size_basic_32.test  |   9 +
 .../sys_vars/t/key_buffer_size_basic_64.test  |   9 +
 .../t/key_cache_age_threshold_basic_32.test   |   9 +
 .../t/key_cache_age_threshold_basic_64.test   |   9 +
 .../t/key_cache_block_size_basic_32.test      |   9 +
 .../t/key_cache_block_size_basic_64.test      |   9 +
 .../t/key_cache_division_limit_basic_32.test  |   9 +
 .../t/key_cache_division_limit_basic_64.test  |   9 +
 .../sys_vars/t/log_warnings_basic_32.test     |   9 +
 .../sys_vars/t/log_warnings_basic_64.test     |   9 +
 .../t/max_binlog_cache_size_basic_32.test     |   9 +
 .../t/max_binlog_cache_size_basic_64.test     |   9 +
 .../t/max_connect_errors_basic_32.test        |   9 +
 .../t/max_connect_errors_basic_64.test        |   9 +
 .../t/max_heap_table_size_basic_32.test       |   9 +
 .../t/max_heap_table_size_basic_64.test       |   9 +
 .../t/max_seeks_for_key_basic_32.test         |   9 +
 .../t/max_seeks_for_key_basic_64.test         |   9 +
 .../sys_vars/t/max_tmp_tables_basic_32.test   |   9 +
 .../sys_vars/t/max_tmp_tables_basic_64.test   |   9 +
 .../t/max_write_lock_count_basic_32.test      |   9 +
 .../t/max_write_lock_count_basic_64.test      |   9 +
 .../t/min_examined_row_limit_basic_32.test    |   9 +
 .../t/min_examined_row_limit_basic_64.test    |   9 +
 .../t/multi_range_count_basic_32.test         |   9 +
 .../t/multi_range_count_basic_64.test         |   9 +
 .../t/myisam_max_sort_file_size_basic_32.test |   9 +
 .../t/myisam_max_sort_file_size_basic_64.test |   9 +
 .../t/myisam_repair_threads_basic_32.test     |   9 +
 .../t/myisam_repair_threads_basic_64.test     |   9 +
 .../t/myisam_sort_buffer_size_basic_32.test   |   9 +
 .../t/myisam_sort_buffer_size_basic_64.test   |   9 +
 .../sys_vars/t/net_retry_count_basic_32.test  |   9 +
 .../sys_vars/t/net_retry_count_basic_64.test  |   9 +
 .../t/query_alloc_block_size_basic_32.test    |   9 +
 .../t/query_alloc_block_size_basic_64.test    |   9 +
 .../t/query_cache_limit_basic_32.test         |   9 +
 .../t/query_cache_limit_basic_64.test         |   9 +
 .../t/query_cache_min_res_unit_basic_32.test  |   9 +
 .../t/query_cache_min_res_unit_basic_64.test  |   9 +
 .../sys_vars/t/query_cache_size_basic_32.test |   9 +
 .../sys_vars/t/query_cache_size_basic_64.test |   9 +
 .../t/query_prealloc_size_basic_32.test       |   9 +
 .../t/query_prealloc_size_basic_64.test       |   9 +
 .../t/range_alloc_block_size_basic_32.test    |   9 +
 .../t/range_alloc_block_size_basic_64.test    |   9 +
 .../t/rpl_recovery_rank_basic_32.test         |   9 +
 .../t/rpl_recovery_rank_basic_64.test         |   9 +
 .../suite/sys_vars/t/server_id_basic_32.test  |   9 +
 .../suite/sys_vars/t/server_id_basic_64.test  |   9 +
 .../t/slave_transaction_retries_basic_32.test |   9 +
 .../t/slave_transaction_retries_basic_64.test |   9 +
 .../sys_vars/t/sort_buffer_size_basic_32.test |   9 +
 .../sys_vars/t/sort_buffer_size_basic_64.test |   9 +
 .../sys_vars/t/sync_binlog_basic_32.test      |   9 +
 .../sys_vars/t/sync_binlog_basic_64.test      |   9 +
 .../suite/sys_vars/t/timestamp_basic_32.test  |   9 +
 .../suite/sys_vars/t/timestamp_basic_64.test  |   9 +
 .../sys_vars/t/tmp_table_size_basic_32.test   |   9 +
 .../sys_vars/t/tmp_table_size_basic_64.test   |   9 +
 ...transaction_alloc_block_size_basic_32.test |   9 +
 ...transaction_alloc_block_size_basic_64.test |   9 +
 .../t/transaction_prealloc_size_basic_32.test |   9 +
 .../t/transaction_prealloc_size_basic_64.test |   9 +
 .../sys_vars/t/wait_timeout_basic_32.test     |   9 +
 .../sys_vars/t/wait_timeout_basic_64.test     |   9 +
 206 files changed, 20616 insertions(+)
 create mode 100644 mysql-test/suite/sys_vars/README
 create mode 100644 mysql-test/suite/sys_vars/inc/binlog_cache_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/log_warnings_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/multi_range_count_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/server_id_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/timestamp_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc
 create mode 100644 mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/log_warnings_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/server_id_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/server_id_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/timestamp_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/timestamp_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result
 create mode 100644 mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result
 create mode 100644 mysql-test/suite/sys_vars/t/binlog_cache_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/binlog_cache_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/delayed_queue_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/delayed_queue_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/join_buffer_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/join_buffer_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/log_warnings_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/log_warnings_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_connect_errors_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_connect_errors_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_tmp_tables_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_tmp_tables_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_write_lock_count_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/max_write_lock_count_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/multi_range_count_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/multi_range_count_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/net_retry_count_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/net_retry_count_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/query_cache_limit_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/query_cache_limit_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/query_cache_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/query_cache_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/server_id_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/server_id_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/sort_buffer_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/sort_buffer_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/timestamp_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/timestamp_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test
 create mode 100644 mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test
 create mode 100644 mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test

diff --git a/mysql-test/suite/sys_vars/README b/mysql-test/suite/sys_vars/README
new file mode 100644
index 00000000000..a84f00f1f62
--- /dev/null
+++ b/mysql-test/suite/sys_vars/README
@@ -0,0 +1,3 @@
+Some of these tests allocate more than 4GB RAM.
+So, assure that the machine on which the suite will be executed has more than 4GB RAM.
+
diff --git a/mysql-test/suite/sys_vars/inc/binlog_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/binlog_cache_size_basic.inc
new file mode 100644
index 00000000000..323e19c4d66
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/binlog_cache_size_basic.inc
@@ -0,0 +1,154 @@
+################# mysql-test\t\binlog_cache_size_basic.test ####################
+#                                                                              #
+# Variable Name: binlog_cache_size                                             #
+# Scope: GLOBAL                                                                #
+# Access Type: Dynamic                                                         #
+# Data Type: Numeric                                                           #
+# Default Value: 32768                                                         #
+# Range: 4096 - 4294967295                                                     #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-04-28                                                    #
+# Author:  Salman Rawala/Horst Hunger                                          #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable "binlog_cache_size"       #
+#              that checks behavior of this variable in the following ways     #
+#              * Default Value                                                 #
+#              * Valid & Invalid values                                        #
+#              * Scope & Access method                                         #
+#              * Data Integrity                          .                     #
+#                                                                              #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
+#         server-system-variables.html#option_mysqld_binlog_cache_size         #
+#                                                                              #
+################################################################################
+
+#################################################################
+#           START OF binlog_cache_size TESTS                    #
+#################################################################
+
+#########################################################################
+# Saving initial value of binlog_cache_size in a temporary variable     #
+#########################################################################
+
+SET @start_value = @@global.binlog_cache_size;
+SELECT @start_value;
+
+--echo '#--------------------FN_DYNVARS_006_01------------------------#'
+######################################################################### 
+#              Display the DEFAULT value of binlog_cache_size           #
+######################################################################### 
+
+SET @@global.binlog_cache_size = 100;
+SET @@global.binlog_cache_size = DEFAULT;
+SELECT @@global.binlog_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_006_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.binlog_cache_size = @start_value;
+SELECT @@global.binlog_cache_size = 32768;
+
+
+--echo '#--------------------FN_DYNVARS_006_03------------------------#'
+#########################################################################
+#        Change the value of binlog_cache_size to a valid value         #
+#########################################################################
+
+SET @@global.binlog_cache_size = 4096;
+SELECT @@global.binlog_cache_size;
+SET @@global.binlog_cache_size = 4294967295;
+SELECT @@global.binlog_cache_size;
+SET @@global.binlog_cache_size = 10000;
+SELECT @@global.binlog_cache_size;
+SET @@global.binlog_cache_size = 21221204;
+SELECT @@global.binlog_cache_size;
+echo 'Bug: Invalid values are coming in variable on assigning valid values';
+
+
+--echo '#--------------------FN_DYNVARS_006_04-------------------------#'
+############################################################################
+#         Change the value of binlog_cache_size to invalid value           #
+############################################################################ 
+
+SET @@global.binlog_cache_size = 1024;
+SELECT @@global.binlog_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.binlog_cache_size = 10000.01;
+SET @@global.binlog_cache_size = -1024;
+SELECT @@global.binlog_cache_size;
+SET @@global.binlog_cache_size = 42949672950;
+SELECT @@global.binlog_cache_size;
+echo 'Bug: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.binlog_cache_size = ON;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.binlog_cache_size = 'test';
+
+
+--echo '#-------------------FN_DYNVARS_006_05----------------------------#'
+############################################################################
+#       Test if accessing session binlog_cache_size gives error            #
+############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.binlog_cache_size = 0;
+
+
+--echo '#----------------------FN_DYNVARS_006_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL Tables matches values in variable             #
+##############################################################################
+
+SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size';
+
+--echo '#---------------------FN_DYNVARS_006_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.binlog_cache_size = TRUE;
+SELECT @@global.binlog_cache_size;
+SET @@global.binlog_cache_size = FALSE;
+SELECT @@global.binlog_cache_size;
+echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
+
+--echo '#---------------------FN_DYNVARS_006_08----------------------#'
+###############################################################################
+#    Check if accessing variable without SCOPE points to same global variable #
+###############################################################################
+
+SET @@global.binlog_cache_size = 1;
+SELECT @@binlog_cache_size = @@global.binlog_cache_size;
+
+--echo '#---------------------FN_DYNVARS_006_09----------------------#'
+###########################################################################
+#   Check if binlog_cache_size can be accessed with and without @@ sign   #
+###########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET binlog_cache_size = 1;
+--Error ER_PARSE_ERROR
+SET global.binlog_cache_size = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT global.binlog_cache_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT binlog_cache_size = @@session.binlog_cache_size;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.binlog_cache_size = @start_value;
+SELECT @@global.binlog_cache_size;
+
+
+###########################################################
+#              END OF binlog_cache_size TESTS             #
+###########################################################
diff --git a/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc
new file mode 100644
index 00000000000..56ffbace173
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc
@@ -0,0 +1,203 @@
+############## mysql-test\t\bulk_insert_buffer_size_basic.test #################
+#                                                                              #
+# Variable Name: bulk_insert_buffer_size                                       #
+# Scope: GLOBAL & SESSION                                                      #
+# Access Type: Dynamic                                                         #
+# Data Type: Numeric                                                           #
+# Default Value: 8388608                                                       #
+# Range: 0 - 4294967295                                                        #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-02-07                                                    #
+# Author:  Salman Rawala                                                       #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable "bulk_insert_buffer_size" #
+#              that checks behavior of this variable in the following ways     #
+#              * Default Value                                                 #
+#              * Valid & Invalid values                                        #
+#              * Scope & Access method                                         #
+#              * Data Integrity                          .                     #
+#                                                                              #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           # 
+#   server-system-variables.html#option_mysqld_bulk_insert_buffer_size         #
+#                                                                              #
+################################################################################
+
+--source include/load_sysvars.inc
+
+#######################################################################
+#           START OF bulk_insert_buffer_size TESTS                    #
+#######################################################################
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.bulk_insert_buffer_size;
+SELECT @start_global_value;
+SET @start_session_value = @@session.bulk_insert_buffer_size;
+SELECT @start_session_value;
+
+--echo '#--------------------FN_DYNVARS_007_01-------------------------#'
+#######################################################################
+#     Display the DEFAULT value of bulk_insert_buffer_size            #
+#######################################################################
+
+SET @@global.bulk_insert_buffer_size = 100;
+SET @@global.bulk_insert_buffer_size = DEFAULT;
+SELECT @@global.bulk_insert_buffer_size;
+
+SET @@session.bulk_insert_buffer_size = 200;
+SET @@session.bulk_insert_buffer_size = DEFAULT;
+SELECT @@session.bulk_insert_buffer_size;
+
+
+--echo '#--------------------FN_DYNVARS_007_02-------------------------#'
+#######################################################################
+#     Check the DEFAULT value of bulk_insert_buffer_size              #
+#######################################################################
+
+SET @@global.bulk_insert_buffer_size = @start_global_value;
+SELECT @@global.bulk_insert_buffer_size = 8388608;
+
+SET @@session.bulk_insert_buffer_size = @start_session_value;
+SELECT @@session.bulk_insert_buffer_size = 8388608;
+
+
+--echo '#--------------------FN_DYNVARS_007_03-------------------------#'
+###############################################################################
+#Change the value of bulk_insert_buffer_size to valid values for GLOBAL Scope #
+###############################################################################
+
+SET @@global.bulk_insert_buffer_size = 0;
+SELECT @@global.bulk_insert_buffer_size;
+SET @@global.bulk_insert_buffer_size = 1;
+SELECT @@global.bulk_insert_buffer_size;
+SET @@global.bulk_insert_buffer_size = 4294967295;
+SELECT @@global.bulk_insert_buffer_size;
+SET @@global.bulk_insert_buffer_size = 429496;
+SELECT @@global.bulk_insert_buffer_size;
+
+
+--echo '#--------------------FN_DYNVARS_007_04-------------------------#'
+###############################################################################
+#Change the value of bulk_insert_buffer_size to valid values for SESSION Scope#
+###############################################################################
+
+SET @@session.bulk_insert_buffer_size = 0;
+SELECT @@session.bulk_insert_buffer_size;
+SET @@session.bulk_insert_buffer_size = 1;
+SELECT @@session.bulk_insert_buffer_size;
+SET @@session.bulk_insert_buffer_size = 4294967295;
+SELECT @@session.bulk_insert_buffer_size;
+SET @@session.bulk_insert_buffer_size = 429496;
+SELECT @@session.bulk_insert_buffer_size;
+
+
+--echo '#------------------FN_DYNVARS_007_05-----------------------#'
+###################################################################
+# Change the value of bulk_insert_buffer_size to an invalid value #
+###################################################################
+
+SET @@global.bulk_insert_buffer_size = 42949672950;
+SELECT @@global.bulk_insert_buffer_size;
+SET @@global.bulk_insert_buffer_size = -1024;
+SELECT @@global.bulk_insert_buffer_size;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.bulk_insert_buffer_size = test;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.bulk_insert_buffer_size = ON;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.bulk_insert_buffer_size = 429496.10;
+
+SET @@session.bulk_insert_buffer_size = 42949672950;
+SELECT @@session.bulk_insert_buffer_size;
+SET @@session.bulk_insert_buffer_size = -2;
+SELECT @@session.bulk_insert_buffer_size;
+echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.bulk_insert_buffer_size = test;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.bulk_insert_buffer_size = 429496.10;
+
+
+--echo '#------------------FN_DYNVARS_007_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='bulk_insert_buffer_size';
+
+--echo '#------------------FN_DYNVARS_007_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='bulk_insert_buffer_size';
+
+
+--echo '#------------------FN_DYNVARS_007_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.bulk_insert_buffer_size = TRUE;
+SELECT @@global.bulk_insert_buffer_size;
+SET @@global.bulk_insert_buffer_size = FALSE;
+SELECT @@global.bulk_insert_buffer_size;
+
+SET @@session.bulk_insert_buffer_size = TRUE;
+SELECT @@session.bulk_insert_buffer_size;
+SET @@session.bulk_insert_buffer_size = FALSE;
+SELECT @@session.bulk_insert_buffer_size;
+
+
+--echo '#---------------------FN_DYNVARS_007_09----------------------#'
+##############################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points #
+#    to same session variable                                                #
+##############################################################################
+
+SET @@bulk_insert_buffer_size = 100;
+SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size;
+SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
+
+
+--echo '#---------------------FN_DYNVARS_007_10----------------------#'
+###############################################################################
+#   Check if bulk_insert_buffer_size can be accessed with and without @@ sign #
+###############################################################################
+
+SET bulk_insert_buffer_size = 1;
+SELECT @@bulk_insert_buffer_size;
+--Error ER_PARSE_ERROR
+SET local.bulk_insert_buffer_size = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT local.bulk_insert_buffer_size;
+--Error ER_PARSE_ERROR
+SET session.bulk_insert_buffer_size = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT session.bulk_insert_buffer_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.bulk_insert_buffer_size = @start_global_value;
+SELECT @@global.bulk_insert_buffer_size;
+SET @@session.bulk_insert_buffer_size = @start_session_value;
+SELECT @@session.bulk_insert_buffer_size;
+
+
+####################################################
+#         END OF bulk_insert_buffer_size TESTS     #
+####################################################
diff --git a/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc b/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc
new file mode 100644
index 00000000000..ab158bc593e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc
@@ -0,0 +1,167 @@
+############### mysql-test\t\delayed_insert_limit_basic.test ###################
+#                                                                              #
+# Variable Name: delayed_insert_limit                                          #
+# Scope: GLOBAL                                                                #
+# Access Type: Dynamic                                                         #
+# Data Type: Numeric                                                           #
+# Default Value: 100                                                           #
+# Range: 1 - 4294967295                                                        #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-02-07                                                    #
+# Author:  Salman Rawala                                                       #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable "delayed_insert_limit"    #
+#              that checks behavior of this variable in the following ways     #
+#              * Default Value                                                 #
+#              * Valid & Invalid values                                        #
+#              * Scope & Access method                                         #
+#              * Data Integrity                                                #
+#                                                                              #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
+#        server-system-variables.html#option_mysqld_delayed_insert_limit       #
+#                                                                              #
+################################################################################
+
+--source include/load_sysvars.inc
+
+#################################################################
+#           START OF delayed_insert_limit TESTS                 #
+#################################################################
+
+#########################################################################
+# Saving initial value of delayed_insert_limit in a temporary variable  #
+#########################################################################
+
+SET @start_value = @@global.delayed_insert_limit;
+SELECT @start_value;
+
+--echo '#--------------------FN_DYNVARS_024_01------------------------#'
+######################################################################### 
+#              Display the DEFAULT value of delayed_insert_limit        #
+######################################################################### 
+
+SET @@global.delayed_insert_limit = 100;
+SET @@global.delayed_insert_limit = DEFAULT;
+SELECT @@global.delayed_insert_limit;
+
+
+--echo '#---------------------FN_DYNVARS_024_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.delayed_insert_limit = @start_value;
+SELECT @@global.delayed_insert_limit = 100;
+
+
+--echo '#--------------------FN_DYNVARS_024_03------------------------#'
+#########################################################################
+#        Change the value of delayed_insert_limit to a valid value      #
+#########################################################################
+
+SET @@global.delayed_insert_limit = 10000;
+SELECT @@global.delayed_insert_limit;
+SET @@global.delayed_insert_limit = 4294967295;
+SELECT @@global.delayed_insert_limit;
+SET @@global.delayed_insert_limit = 1;
+SELECT @@global.delayed_insert_limit;
+
+
+--echo '#--------------------FN_DYNVARS_024_04-------------------------#'
+############################################################################
+#         Change the value of delayed_insert_limit to invalid value        #
+############################################################################ 
+
+SET @@global.delayed_insert_limit = 0;
+SELECT @@global.delayed_insert_limit;
+SET @@global.delayed_insert_limit = -1024;
+SELECT @@global.delayed_insert_limit;
+SET @@global.delayed_insert_limit = 42949672950;
+SELECT @@global.delayed_insert_limit;
+echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.delayed_insert_limit = 429496729.5;
+SELECT @@global.delayed_insert_limit;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.delayed_insert_limit = ON;
+SELECT @@global.delayed_insert_limit;
+
+
+
+--echo '#-------------------FN_DYNVARS_024_05----------------------------#'
+############################################################################
+#       Test if accessing session delayed_insert_limit gives error         #
+############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.delayed_insert_limit = 0;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@Session.delayed_insert_limit;
+
+
+--echo '#----------------------FN_DYNVARS_024_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.delayed_insert_limit =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+  WHERE VARIABLE_NAME='delayed_insert_limit';
+
+SELECT @@delayed_insert_limit =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+  WHERE VARIABLE_NAME='delayed_insert_limit';
+
+
+--echo '#---------------------FN_DYNVARS_024_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.delayed_insert_limit = TRUE;
+SELECT @@global.delayed_insert_limit;
+SET @@global.delayed_insert_limit = FALSE;
+SELECT @@global.delayed_insert_limit;
+
+--echo '#---------------------FN_DYNVARS_024_08----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@global.delayed_insert_limit = 1;
+SELECT @@delayed_insert_limit = @@global.delayed_insert_limit;
+
+
+--echo '#---------------------FN_DYNVARS_024_09----------------------#'
+##############################################################################
+#   Check if delayed_insert_limit can be accessed with and without @@ sign   #
+##############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET delayed_insert_limit = 1;
+SELECT @@delayed_insert_limit;
+--Error ER_PARSE_ERROR
+SET local.delayed_insert_limit = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT local.delayed_insert_limit;
+--Error ER_PARSE_ERROR
+SET global.delayed_insert_limit = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT global.delayed_insert_limit;
+--Error ER_BAD_FIELD_ERROR
+SELECT delayed_insert_limit = @@session.delayed_insert_limit;
+
+##############################
+#   Restore initial value    #
+##############################
+
+SET @@global.delayed_insert_limit = @start_value;
+SELECT @@global.delayed_insert_limit;
+
+
+###########################################################
+#           END OF delayed_insert_limit TESTS             #
+###########################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc b/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc
new file mode 100644
index 00000000000..2d16f75d4e1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc
@@ -0,0 +1,163 @@
+################# mysql-test\t\delayed_queue_size_basic.test ###################
+#                                                                              #
+# Variable Name: delayed_queue_size                                            #
+# Scope: GLOBAL                                                                #
+# Access Type: Dynamic                                                         #
+# Data Type: Numeric                                                           #
+# Default Value: 1000                                                          #
+# Range: 1 - 4294967295                                                        #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-02-07                                                    #
+# Author:  Salman Rawala                                                       #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable "delayed_queue_size"      #
+#              that checks behavior of this variable in the following ways     #
+#              * Default Value                                                 #
+#              * Valid & Invalid values                                        #
+#              * Scope & Access method                                         #
+#              * Data Integrity                          .                     #
+#                                                                              #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
+#        server-system-variables.html#option_mysqld_delayed_queue_size         #
+#                                                                              #
+################################################################################
+
+--source include/load_sysvars.inc
+
+#################################################################
+#           START OF delayed_queue_size TESTS                   #
+#################################################################
+
+#########################################################################
+# Saving initial value of delayed_queue_size in a temporary variable    #
+#########################################################################
+
+SET @start_value = @@global.delayed_queue_size;
+SELECT @start_value;
+
+--echo '#--------------------FN_DYNVARS_026_01------------------------#'
+######################################################################### 
+#              Display the DEFAULT value of delayed_queue_size          #
+######################################################################### 
+
+SET @@global.delayed_queue_size = 100;
+SET @@global.delayed_queue_size = DEFAULT;
+SELECT @@global.delayed_queue_size;
+
+--echo '#---------------------FN_DYNVARS_026_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.delayed_queue_size = @start_value;
+SELECT @@global.delayed_queue_size = 1000;
+
+--echo '#--------------------FN_DYNVARS_026_03------------------------#'
+#########################################################################
+#        Change the value of delayed_queue_size to a valid value        #
+#########################################################################
+
+SET @@global.delayed_queue_size = 10000;
+SELECT @@global.delayed_queue_size;
+SET @@global.delayed_queue_size = 4294967295;
+SELECT @@global.delayed_queue_size;
+SET @@global.delayed_queue_size = 1;
+SELECT @@global.delayed_queue_size;
+
+
+--echo '#--------------------FN_DYNVARS_026_04-------------------------#'
+############################################################################
+#         Change the value of delayed_queue_size to invalid value          #
+############################################################################ 
+
+SET @@global.delayed_queue_size = 0;
+SELECT @@global.delayed_queue_size;
+SET @@global.delayed_queue_size = -1024;
+SELECT @@global.delayed_queue_size;
+SET @@global.delayed_queue_size = 42949672950;
+SELECT @@global.delayed_queue_size;
+echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.delayed_queue_size = 429496729.5;
+SELECT @@global.delayed_queue_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.delayed_queue_size = ON;
+SELECT @@delayed_queue_size;
+
+--echo '#-------------------FN_DYNVARS_026_05----------------------------#'
+############################################################################
+#       Test if accessing session delayed_queue_size gives error           #
+############################################################################
+
+--Error 1229
+SET @@session.delayed_queue_size = 0;
+--Error 1238
+SELECT @@session.delayed_queue_size;
+
+--echo '#----------------------FN_DYNVARS_026_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.delayed_queue_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='delayed_queue_size';
+
+SELECT @@delayed_queue_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='delayed_queue_size';
+
+
+--echo '#---------------------FN_DYNVARS_026_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.delayed_queue_size = TRUE;
+SELECT @@global.delayed_queue_size;
+SET @@global.delayed_queue_size = FALSE;
+SELECT @@global.delayed_queue_size;
+
+--echo '#---------------------FN_DYNVARS_026_08----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@global.delayed_queue_size = 1;
+SELECT @@delayed_queue_size = @@global.delayed_queue_size;
+
+
+--echo '#---------------------FN_DYNVARS_026_09----------------------#'
+###########################################################################
+#   Check if delayed_queue_size can be accessed with and without @@ sign  #
+###########################################################################
+
+--Error 1229
+SET delayed_queue_size = 1;
+SELECT @@delayed_queue_size;
+--Error ER_PARSE_ERROR
+SET local.delayed_queue_size = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT local.delayed_queue_size;
+--Error ER_PARSE_ERROR
+SET global.delayed_queue_size = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT global.delayed_queue_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT delayed_queue_size = @@session.delayed_queue_size;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.delayed_queue_size = @start_value;
+SELECT @@global.delayed_queue_size;
+
+
+###########################################################
+#              END OF delayed_queue_size TESTS            #
+###########################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc b/mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc
new file mode 100644
index 00000000000..67b0247d169
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc
@@ -0,0 +1,147 @@
+################# mysql-test\t\innodb_concurrency_tickets_basic.test ##########
+#                                                                             #
+# Variable Name: innodb_concurrency_tickets                                   #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: Numeric                                                          #
+# Default Value: 500                                                          #
+# Range: 1-4294967295                                                         #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Rizwan                                                             #
+#                                                                             #
+#Description:Test Cases of Dynamic System Variable innodb_concurrency_tickets #
+#             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_concurrency_tickets TESTS         #
+########################################################################
+
+
+################################################################################
+# Saving initial value of innodb_concurrency_tickets in a temporary variable   #
+################################################################################
+
+SET @global_start_value = @@global.innodb_concurrency_tickets;
+SELECT @global_start_value;
+
+--echo '#--------------------FN_DYNVARS_046_01------------------------#'
+######################################################################## 
+#           Display the DEFAULT value of innodb_concurrency_tickets    #
+######################################################################## 
+
+SET @@global.innodb_concurrency_tickets = 0;
+SET @@global.innodb_concurrency_tickets = DEFAULT;
+SELECT @@global.innodb_concurrency_tickets;
+
+--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
+################################################################################
+# Check if innodb_concurrency_tickets can be accessed with and without @@ sign #
+################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET innodb_concurrency_tickets = 1;
+SELECT @@innodb_concurrency_tickets;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.innodb_concurrency_tickets;
+
+
+SET global innodb_concurrency_tickets = 0;
+SELECT @@global.innodb_concurrency_tickets;
+
+
+--echo '#--------------------FN_DYNVARS_046_03------------------------#'
+########################################################################## 
+#      change the value of innodb_concurrency_tickets to a valid value   #
+########################################################################## 
+
+
+SET @@global.innodb_concurrency_tickets = 1;
+SELECT @@global.innodb_concurrency_tickets;
+
+SET @@global.innodb_concurrency_tickets = 1000;
+SELECT @@global.innodb_concurrency_tickets;
+
+SET @@global.innodb_concurrency_tickets = 4294967295;
+SELECT @@global.innodb_concurrency_tickets;
+
+
+--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
+########################################################################### 
+#  Change the value of innodb_concurrency_tickets to invalid value        #
+###########################################################################
+
+SET @@global.innodb_concurrency_tickets = -1;
+SELECT @@global.innodb_concurrency_tickets;
+
+--Error ER_WRONG_TYPE_FOR_VAR  
+SET @@global.innodb_concurrency_tickets = "T";
+SELECT @@global.innodb_concurrency_tickets;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_concurrency_tickets = "Y";
+SELECT @@global.innodb_concurrency_tickets;
+
+SET @@global.innodb_concurrency_tickets = 1001;
+SELECT @@global.innodb_concurrency_tickets;
+
+--echo '#----------------------FN_DYNVARS_046_05------------------------#'
+######################################################################### 
+#     Check if the value in GLOBAL Table matches value in variable      #
+#########################################################################
+
+SELECT @@global.innodb_concurrency_tickets =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+  WHERE VARIABLE_NAME='innodb_concurrency_tickets';
+SELECT @@global.innodb_concurrency_tickets;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_concurrency_tickets';
+
+--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+###################################################################
+#        Check if ON and OFF values can be used on variable       #
+###################################################################
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_concurrency_tickets = OFF;
+SELECT @@global.innodb_concurrency_tickets;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_concurrency_tickets = ON;
+SELECT @@global.innodb_concurrency_tickets;
+
+--echo '#---------------------FN_DYNVARS_046_07----------------------#'
+###################################################################
+#      Check if TRUE and FALSE values can be used on variable     #
+###################################################################
+
+SET @@global.innodb_concurrency_tickets = TRUE;
+SELECT @@global.innodb_concurrency_tickets;
+SET @@global.innodb_concurrency_tickets = FALSE;
+SELECT @@global.innodb_concurrency_tickets;
+
+##############################
+#   Restore initial value    #
+##############################
+
+SET @@global.innodb_concurrency_tickets = @global_start_value;
+SELECT @@global.innodb_concurrency_tickets;
+
+###############################################################
+#           END OF innodb_concurrency_tickets TESTS           #
+###############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc b/mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc
new file mode 100644
index 00000000000..9e6b8201e3d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc
@@ -0,0 +1,147 @@
+################# mysql-test\t\innodb_max_purge_lag_basic.test ################
+#                                                                             #
+# Variable Name: innodb_max_purge_lag                                         #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: Numeric                                                          #
+# Default Value: 0                                                            #
+# Range: 0-4294967295                                                         #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Rizwan                                                             #
+#                                                                             #
+#Description:Test Cases of Dynamic System Variable innodb_max_purge_lag       #
+#             that checks the behavior of this variable in the following ways #
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+######################################################################## 
+#                    START OF innodb_max_purge_lag TESTS               #
+######################################################################## 
+
+################################################################################ 
+#   Saving initial value of innodb_max_purge_lag in a temporary variable       #
+################################################################################ 
+
+SET @global_start_value = @@global.innodb_max_purge_lag;
+SELECT @global_start_value;
+
+--echo '#--------------------FN_DYNVARS_046_01------------------------#'
+######################################################################## 
+#           Display the DEFAULT value of innodb_max_purge_lag          #
+######################################################################## 
+
+SET @@global.innodb_max_purge_lag = 0;
+SET @@global.innodb_max_purge_lag = DEFAULT;
+SELECT @@global.innodb_max_purge_lag;
+
+--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
+############################################################################
+#   Check if innodb_max_purge_lag can be accessed with and without @@ sign #
+############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET innodb_max_purge_lag = 1;
+SELECT @@innodb_max_purge_lag;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.innodb_max_purge_lag;
+
+SET global innodb_max_purge_lag = 0;
+SELECT @@global.innodb_max_purge_lag;
+
+--echo '#--------------------FN_DYNVARS_046_03------------------------#'
+########################################################################## 
+#      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-------------------------#'
+########################################################################### 
+#       Change the value of innodb_max_purge_lag to invalid value         #
+########################################################################### 
+
+SET @@global.innodb_max_purge_lag = -1;
+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;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_purge_lag = "Y";
+SELECT @@global.innodb_max_purge_lag;
+
+
+SET @@global.innodb_max_purge_lag = 1001;
+SELECT @@global.innodb_max_purge_lag;
+
+--echo '#----------------------FN_DYNVARS_046_05------------------------#'
+######################################################################### 
+#     Check if the value in GLOBAL Table matches value in variable      #
+#########################################################################
+
+SELECT @@global.innodb_max_purge_lag =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+  WHERE VARIABLE_NAME='innodb_max_purge_lag';
+SELECT @@global.innodb_max_purge_lag;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_max_purge_lag';
+
+
+
+
+--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+################################################################### 
+#        Check if ON and OFF values can be used on variable       #
+################################################################### 
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_purge_lag = OFF;
+SELECT @@global.innodb_max_purge_lag;
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_max_purge_lag = ON;
+SELECT @@global.innodb_max_purge_lag;
+
+--echo '#---------------------FN_DYNVARS_046_07----------------------#'
+################################################################### 
+#      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;
+SELECT @@global.innodb_max_purge_lag;
+
+##############################  
+#   Restore initial value    #
+##############################
+
+
+SET @@global.innodb_max_purge_lag = @global_start_value;
+SELECT @@global.innodb_max_purge_lag;
+
+###############################################################
+#                    END OF innodb_max_purge_lag TESTS        #
+############################################################### 
diff --git a/mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc b/mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc
new file mode 100644
index 00000000000..35460fe47f2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc
@@ -0,0 +1,142 @@
+################# mysql-test\t\innodb_sync_spin_loops_basic.test ##############
+#                                                                             #
+# Variable Name: innodb_sync_spin_loops                                       #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: Numeric                                                          #
+# Default Value: 20                                                           #
+# Range: 0-4294967295                                                         #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Rizwan                                                             #
+#                                                                             #
+#Description:Test Cases of Dynamic System Variable innodb_sync_spin_loops     #
+#             that checks the behavior of this variable in the following ways #
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/have_innodb.inc
+--source include/load_sysvars.inc
+
+########################################################################
+#                    START OF innodb_sync_spin_loops TESTS             #
+########################################################################
+
+
+############################################################################
+#   Saving initial value of innodb_sync_spin_loops in a temporary variable #
+############################################################################
+
+SET @global_start_value = @@global.innodb_sync_spin_loops;
+SELECT @global_start_value;
+
+--echo '#--------------------FN_DYNVARS_046_01------------------------#'
+########################################################################
+#           Display the DEFAULT value of innodb_sync_spin_loops        #
+########################################################################
+
+SET @@global.innodb_sync_spin_loops = 0;
+SET @@global.innodb_sync_spin_loops = DEFAULT;
+SELECT @@global.innodb_sync_spin_loops;
+
+--echo '#---------------------FN_DYNVARS_046_02-------------------------#'
+##############################################################################
+#   Check if innodb_sync_spin_loops can be accessed with and without @@ sign #
+##############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET innodb_sync_spin_loops = 1;
+SELECT @@innodb_sync_spin_loops;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.innodb_sync_spin_loops;
+
+SET global innodb_sync_spin_loops = 0;
+SELECT @@global.innodb_sync_spin_loops;
+
+--echo '#--------------------FN_DYNVARS_046_03------------------------#'
+##########################################################################
+#      change the value of innodb_sync_spin_loops to a valid value       #
+##########################################################################
+
+SET @@global.innodb_sync_spin_loops = 0;
+SELECT @@global.innodb_sync_spin_loops;
+
+SET @@global.innodb_sync_spin_loops = 1;
+SELECT @@global.innodb_sync_spin_loops;
+SET @@global.innodb_sync_spin_loops = 1000;
+SELECT @@global.innodb_sync_spin_loops;
+
+--echo '#--------------------FN_DYNVARS_046_04-------------------------#'
+###########################################################################
+#       Change the value of innodb_sync_spin_loops to invalid value       #
+########################################################################### 
+
+SET @@global.innodb_sync_spin_loops = -1;
+SELECT @@global.innodb_sync_spin_loops;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_sync_spin_loops = "T";
+SELECT @@global.innodb_sync_spin_loops;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_sync_spin_loops = "Y";
+SELECT @@global.innodb_sync_spin_loops;
+
+SET @@global.innodb_sync_spin_loops = 1001;
+SELECT @@global.innodb_sync_spin_loops;
+
+--echo '#----------------------FN_DYNVARS_046_05------------------------#'
+######################################################################### 
+#     Check if the value in GLOBAL Table matches value in variable      #
+#########################################################################
+
+SELECT @@global.innodb_sync_spin_loops =
+ VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+  WHERE VARIABLE_NAME='innodb_sync_spin_loops';
+SELECT @@global.innodb_sync_spin_loops;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_sync_spin_loops';
+
+--echo '#---------------------FN_DYNVARS_046_06-------------------------#'
+################################################################### 
+#        Check if ON and OFF values can be used on variable       #
+###################################################################
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_sync_spin_loops = OFF;
+SELECT @@global.innodb_sync_spin_loops;
+
+--ERROR ER_WRONG_TYPE_FOR_VAR
+SET @@global.innodb_sync_spin_loops = ON;
+SELECT @@global.innodb_sync_spin_loops;
+
+--echo '#---------------------FN_DYNVARS_046_07----------------------#'
+###################################################################
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+
+SET @@global.innodb_sync_spin_loops = TRUE;
+SELECT @@global.innodb_sync_spin_loops;
+SET @@global.innodb_sync_spin_loops = FALSE;
+SELECT @@global.innodb_sync_spin_loops;
+
+##############################
+#   Restore initial value    #
+##############################
+
+SET @@global.innodb_sync_spin_loops = @global_start_value;
+SELECT @@global.innodb_sync_spin_loops;
+
+###############################################################
+#                    END OF innodb_sync_spin_loops TESTS      #
+############################################################### 
diff --git a/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc
new file mode 100644
index 00000000000..880dac4cac4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc
@@ -0,0 +1,216 @@
+############## mysql-test\t\join_buffer_size_basic.test ###############
+#                                                                             #
+# Variable Name: join_buffer_size                                             #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 131072                                                       #
+# Range: 8200-4294967295                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable join_buffer_size         #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+################################################################
+#           START OF join_buffer_size TESTS                    #
+################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.join_buffer_size;
+SELECT @start_global_value;
+SET @start_session_value = @@session.join_buffer_size;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_053_01-------------------------#'
+################################################################
+#     Display the DEFAULT value of join_buffer_size            #
+################################################################
+
+SET @@global.join_buffer_size = 8200;
+SET @@global.join_buffer_size = DEFAULT;
+SELECT @@global.join_buffer_size;
+
+SET @@session.join_buffer_size = 8200;
+SET @@session.join_buffer_size = DEFAULT;
+SELECT @@session.join_buffer_size;
+
+
+--echo '#--------------------FN_DYNVARS_053_02-------------------------#'
+###################################################################
+#     Check the DEFAULT value of join_buffer_size              #
+###################################################################
+
+SET @@global.join_buffer_size = DEFAULT;
+SELECT @@global.join_buffer_size = 131072;
+
+SET @@session.join_buffer_size = DEFAULT;
+SELECT @@session.join_buffer_size = 131072;
+
+
+--echo '#--------------------FN_DYNVARS_053_03-------------------------#'
+##########################################################################
+# Change the value of join_buffer_size to a valid value for GLOBAL Scope #
+##########################################################################
+
+SET @@global.join_buffer_size = 8200;
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+SET @@global.join_buffer_size = 65536;
+SELECT @@global.join_buffer_size;
+SET @@global.join_buffer_size = 4294967295;
+SELECT @@global.join_buffer_size;
+echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+
+--echo '#--------------------FN_DYNVARS_053_04-------------------------#'
+###########################################################################
+# Change the value of join_buffer_size to a valid value for SESSION Scope #
+###########################################################################
+ 
+SET @@session.join_buffer_size = 8200;
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+SET @@session.join_buffer_size = 65536;
+SELECT @@session.join_buffer_size;
+SET @@session.join_buffer_size = 4294967295;
+SELECT @@session.join_buffer_size;
+echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+
+--echo '#------------------FN_DYNVARS_053_05-----------------------#'
+############################################################
+# Change the value of join_buffer_size to an invalid value #
+############################################################
+
+SET @@global.join_buffer_size = 0;
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+SET @@global.join_buffer_size = -1024;
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+SET @@global.join_buffer_size = 8199;
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+SET @@global.join_buffer_size = 42949672951;
+SELECT @@global.join_buffer_size;
+
+--Error ER_PARSE_ERROR
+SET @@global.join_buffer_size = 65530.34.;
+SELECT @@global.join_buffer_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.join_buffer_size = test;
+SELECT @@global.join_buffer_size;
+
+SET @@session.join_buffer_size = 0;
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+SET @@session.join_buffer_size = -2;
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+SET @@session.join_buffer_size = 8199;
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+SET @@session.join_buffer_size = 42949672951;
+SELECT @@session.join_buffer_size;
+
+--Error ER_PARSE_ERROR
+SET @@session.join_buffer_size = 65530.34.;
+SELECT @@session.join_buffer_size;
+echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.join_buffer_size = test;
+SELECT @@session.join_buffer_size;
+
+
+--echo '#------------------FN_DYNVARS_053_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.join_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='join_buffer_size';
+
+--echo '#------------------FN_DYNVARS_053_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.join_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='join_buffer_size';
+
+
+--echo '#------------------FN_DYNVARS_053_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.join_buffer_size = TRUE;
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+SET @@global.join_buffer_size = FALSE;
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+--echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
+
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+#################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+#################################################################################
+
+SET @@global.join_buffer_size = 10;
+SELECT @@join_buffer_size = @@global.join_buffer_size;
+
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@join_buffer_size = 100;
+SELECT @@join_buffer_size = @@local.join_buffer_size;
+SELECT @@local.join_buffer_size = @@session.join_buffer_size;
+
+
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+##############################################################################
+#   Check if join_buffer_size can be accessed with and without @@ sign    #
+##############################################################################
+
+SET join_buffer_size = 1;
+SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
+--Error ER_UNKNOWN_TABLE
+SELECT local.join_buffer_size;
+--Error ER_UNKNOWN_TABLE
+SELECT session.join_buffer_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT join_buffer_size = @@session.join_buffer_size;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.join_buffer_size = @start_global_value;
+SELECT @@global.join_buffer_size;
+SET @@session.join_buffer_size = @start_session_value;
+SELECT @@session.join_buffer_size;
+
+
+########################################################
+#                 END OF join_buffer_size TESTS     #
+########################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
new file mode 100644
index 00000000000..996a9e712f9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc
@@ -0,0 +1,187 @@
+############## mysql-test\t\key_buffer_size_basic.test ########################
+#                                                                             #
+# Variable Name: key_buffer_size                                              #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 131072                                                       #
+# Range:8-4294967295                                                          #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable key_buffer_size          #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+# Changes:                                                             #
+# 2008-03-06 hhunger Got "lost connections with 5.1.24                 #
+########################################################################
+
+--source include/load_sysvars.inc
+
+######################################################################## 
+#                    START OF key_buffer_size TESTS                    #
+######################################################################## 
+
+--disable_warnings
+######################################################################## 
+# Saving initial value of key_buffer_size in a temporary variable      #
+######################################################################## 
+
+SET @start_value = @@global.key_buffer_size;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_055_01------------------------#'
+######################################################################## 
+#              Display the DEFAULT value of key_buffer_size            #
+######################################################################## 
+
+SET @@global.key_buffer_size = 99;
+--Error ER_NO_DEFAULT
+SET @@global.key_buffer_size = DEFAULT;
+--echo 'Bug# 34878: This variable has default value according to documentation';
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+
+
+--echo '#---------------------FN_DYNVARS_055_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.key_buffer_size = @start_value;
+SELECT @@global.key_buffer_size = @start_value;
+
+--echo '#--------------------FN_DYNVARS_055_03------------------------#'
+######################################################################## 
+#        Change the value of key_buffer_size to a valid value          #
+######################################################################## 
+
+SET @@global.key_buffer_size = @min_key_buffer_size;
+SELECT @@global.key_buffer_size= @min_key_buffer_size;
+--disable_warnings
+#Due to "lost connection"
+#SET @@global.key_buffer_size = 4294967295;
+--enable_warnings
+#SELECT @@global.key_buffer_size;
+SET @@global.key_buffer_size = 1800;
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+SET @@global.key_buffer_size = 65535;
+SELECT @@global.key_buffer_size;
+echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+
+--echo '#--------------------FN_DYNVARS_055_04-------------------------#'
+########################################################################### 
+#         Change the value of key_buffer_size to invalid value            #
+########################################################################### 
+
+# Due to "lost connection"
+#SET @@global.key_buffer_size = -1;
+#SELECT @@global.key_buffer_size;
+#SET @@global.key_buffer_size = 100000000000;
+#SELECT @@global.key_buffer_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_buffer_size = 10000.01;
+SELECT @@global.key_buffer_size;
+#SET @@global.key_buffer_size = -1024;
+#SELECT @@global.key_buffer_size;
+SET @@global.key_buffer_size = 4;
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_buffer_size = ON;
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_buffer_size = 'test';
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+
+
+--echo '#-------------------FN_DYNVARS_055_05----------------------------#'
+########################################################################### 
+#       Test if accessing session key_buffer_size gives error             #
+########################################################################### 
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.key_buffer_size = 0;
+SELECT @@key_buffer_size = @min_key_buffer_size;
+
+
+--echo '#----------------------FN_DYNVARS_055_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.key_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_buffer_size';
+
+SELECT @@key_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_buffer_size';
+
+
+--echo '#---------------------FN_DYNVARS_055_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.key_buffer_size = TRUE;
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+SET @@global.key_buffer_size = FALSE;
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+
+
+--echo '#---------------------FN_DYNVARS_055_08----------------------#'
+#####################################################################
+#  Check if accessing variable with SESSION,LOCAL and without SCOPE #
+#  points to same session variable                                  #
+#####################################################################
+
+# due to differences in contents of the warnings
+--disable_warnings
+SET @@global.key_buffer_size = @min_key_buffer_size;
+SELECT @@key_buffer_size = @@global.key_buffer_size;
+--enable_warnings
+
+--echo '#---------------------FN_DYNVARS_055_09----------------------#'
+##########################################################################  
+#   Check if key_buffer_size can be accessed with and without @@ sign    #
+##########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET key_buffer_size = @min_key_buffer_size;
+SELECT @@key_buffer_size = @min_key_buffer_size;
+--Error ER_PARSE_ERROR
+SET local.key_buffer_size = 10;
+--Error ER_UNKNOWN_TABLE
+SELECT local.key_buffer_size;
+--Error ER_PARSE_ERROR
+SET global.key_buffer_size = 10;
+--Error ER_UNKNOWN_TABLE
+SELECT global.key_buffer_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT key_buffer_size = @@session.key_buffer_size;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.key_buffer_size = @start_value;
+SELECT @@global.key_buffer_size;
+
+--enable_warnings
+#######################################################################
+#              END OF key_buffer_size TESTS                           #
+#######################################################################
diff --git a/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc b/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc
new file mode 100644
index 00000000000..7841ad2cedc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc
@@ -0,0 +1,180 @@
+############## mysql-test\t\key_cache_age_threshold_basic.test ###############
+#                                                                             #
+# Variable Name: key_cache_age_threshold                                      #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 300                                                          #
+# Range: 100-4294967295                                                       #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable key_cache_age_threshold  #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+######################################################################## 
+#            START OF key_cache_age_threshold TESTS                    #
+######################################################################## 
+
+
+############################################################################# 
+#  Saving initial value of key_cache_age_threshold in a temporary variable  #
+############################################################################# 
+
+SET @start_value = @@global.key_cache_age_threshold;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_056_01------------------------#'
+################################################################################ 
+#              Display the DEFAULT value of key_cache_age_threshold            #
+################################################################################ 
+
+SET @@global.key_cache_age_threshold = 99;
+--Error ER_NO_DEFAULT
+SET @@global.key_cache_age_threshold = DEFAULT;
+--echo 'Bug# 34878: This variable has default value according to documentation';
+SELECT @@global.key_cache_age_threshold;
+
+
+--echo '#---------------------FN_DYNVARS_056_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.key_cache_age_threshold = @start_value;
+SELECT @@global.key_cache_age_threshold = 300;
+
+
+--echo '#--------------------FN_DYNVARS_056_03------------------------#'
+############################################################################### 
+#        Change the value of key_cache_age_threshold to a valid value         #
+############################################################################### 
+
+SET @@global.key_cache_age_threshold = 100;
+SELECT @@global.key_cache_age_threshold;
+SET @@global.key_cache_age_threshold = 4294967295;
+SELECT @@global.key_cache_age_threshold;
+SET @@global.key_cache_age_threshold = 1800;
+SELECT @@global.key_cache_age_threshold;
+SET @@global.key_cache_age_threshold = 65535;
+SELECT @@global.key_cache_age_threshold;
+--echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
+
+
+--echo '#--------------------FN_DYNVARS_056_04-------------------------#'
+########################################################################### 
+#         Change the value of key_cache_age_threshold to invalid value    #
+########################################################################### 
+
+SET @@global.key_cache_age_threshold = -1;
+SELECT @@global.key_cache_age_threshold;
+SET @@global.key_cache_age_threshold = 42949672951;
+SELECT @@global.key_cache_age_threshold;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_age_threshold = 10000.01;
+SELECT @@global.key_cache_age_threshold;
+SET @@global.key_cache_age_threshold = -1024;
+SELECT @@global.key_cache_age_threshold;
+SET @@global.key_cache_age_threshold = 99;
+SELECT @@global.key_cache_age_threshold;
+
+echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_age_threshold = ON;
+SELECT @@global.key_cache_age_threshold;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_age_threshold = 'test';
+SELECT @@global.key_cache_age_threshold;
+
+
+--echo '#-------------------FN_DYNVARS_056_05----------------------------#'
+########################################################################### 
+#       Test if accessing session key_cache_age_threshold gives error     #
+########################################################################### 
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.key_cache_age_threshold = 0;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.key_cache_age_threshold;
+
+
+--echo '#----------------------FN_DYNVARS_056_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_age_threshold';
+
+SELECT @@key_cache_age_threshold = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_age_threshold';
+
+
+--echo '#---------------------FN_DYNVARS_056_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.key_cache_age_threshold = TRUE;
+SELECT @@global.key_cache_age_threshold;
+SET @@global.key_cache_age_threshold = FALSE;
+SELECT @@global.key_cache_age_threshold;
+
+
+--echo '#---------------------FN_DYNVARS_056_08----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@global.key_cache_age_threshold = 101;
+SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold;
+
+
+--echo '#---------------------FN_DYNVARS_056_09----------------------#'
+########################################################################## ####### 
+#   Check if key_cache_age_threshold can be accessed with and without @@ sign    #
+##################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET key_cache_age_threshold = 8000;
+SELECT @@key_cache_age_threshold;
+--Error ER_PARSE_ERROR
+SET local.key_cache_age_threshold = 10;
+--Error ER_UNKNOWN_TABLE
+SELECT local.key_cache_age_threshold;
+--Error ER_PARSE_ERROR
+SET global.key_cache_age_threshold = 10;
+--Error ER_UNKNOWN_TABLE
+SELECT global.key_cache_age_threshold;
+--Error ER_BAD_FIELD_ERROR
+SELECT key_cache_age_threshold = @@session.key_cache_age_threshold;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.key_cache_age_threshold = @start_value;
+SELECT @@global.key_cache_age_threshold;
+
+
+######################################################################## 
+#              END OF key_cache_age_threshold TESTS                    #
+######################################################################## 
diff --git a/mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc
new file mode 100644
index 00000000000..b12ea45b762
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc
@@ -0,0 +1,185 @@
+############## mysql-test\t\key_cache_block_size_basic.test ###############
+#                                                                             #
+# Variable Name: key_cache_block_size                                         #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric 1024                                                     #
+# Default Value:                                                              #
+# Range: 512-16384                                                            #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable key_cache_block_size     #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+##################################################################### 
+#            START OF key_cache_block_size TESTS                    #
+#####################################################################
+
+
+########################################################################## 
+#  Saving initial value of key_cache_block_size in a temporary variable  #
+##########################################################################
+
+SET @start_value = @@global.key_cache_block_size;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_057_01------------------------#'
+################################################################################ 
+#              Display the DEFAULT value of key_cache_block_size            #
+################################################################################ 
+
+SET @@global.key_cache_block_size = 600;
+--Error ER_NO_DEFAULT
+SET @@global.key_cache_block_size = DEFAULT;
+--echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
+SELECT @@global.key_cache_block_size;
+
+
+--echo '#---------------------FN_DYNVARS_057_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.key_cache_block_size = @start_value;
+SELECT @@global.key_cache_block_size = 1024;
+
+
+--echo '#--------------------FN_DYNVARS_057_03------------------------#'
+############################################################################### 
+#        Change the value of key_cache_block_size to a valid value            #
+############################################################################### 
+
+SET @@global.key_cache_block_size = 1024;
+SELECT @@global.key_cache_block_size;
+SET @@global.key_cache_block_size = 16384;
+SELECT @@global.key_cache_block_size;
+SET @@global.key_cache_block_size = 1800;
+SELECT @@global.key_cache_block_size;
+SET @@global.key_cache_block_size = 16383;
+SELECT @@global.key_cache_block_size;
+--echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
+
+
+--echo '#--------------------FN_DYNVARS_057_04-------------------------#'
+########################################################################### 
+#         Change the value of key_cache_block_size to invalid value    #
+########################################################################### 
+
+SET @@global.key_cache_block_size = -1;
+SELECT @@global.key_cache_block_size;
+SET @@global.key_cache_block_size = 42949672951;
+SELECT @@global.key_cache_block_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_block_size = 10000.01;
+SELECT @@global.key_cache_block_size;
+SET @@global.key_cache_block_size = -1024;
+SELECT @@global.key_cache_block_size;
+SET @@global.key_cache_block_size = 256;
+SELECT @@global.key_cache_block_size;
+SET @@global.key_cache_block_size = 511;
+SELECT @@global.key_cache_block_size;
+SET @@global.key_cache_block_size = 16385;
+SELECT @@global.key_cache_block_size;
+
+echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_block_size = ON;
+SELECT @@global.key_cache_block_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_block_size = 'test';
+SELECT @@global.key_cache_block_size;
+
+
+--echo '#-------------------FN_DYNVARS_057_05----------------------------#'
+########################################################################### 
+#       Test if accessing session key_cache_block_size gives error     #
+########################################################################### 
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.key_cache_block_size = 0;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.key_cache_block_size;
+
+
+--echo '#----------------------FN_DYNVARS_057_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.key_cache_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_block_size';
+
+SELECT @@key_cache_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_block_size';
+
+
+--echo '#---------------------FN_DYNVARS_057_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.key_cache_block_size = TRUE;
+SELECT @@global.key_cache_block_size;
+SET @@global.key_cache_block_size = FALSE;
+SELECT @@global.key_cache_block_size;
+
+
+--echo '#---------------------FN_DYNVARS_057_08----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@global.key_cache_block_size = 1024;
+SELECT @@key_cache_block_size = @@global.key_cache_block_size;
+
+
+--echo '#---------------------FN_DYNVARS_057_09----------------------#'
+############################################################################### 
+#   Check if key_cache_block_size can be accessed with and without @@ sign    #
+###############################################################################;
+
+--Error ER_GLOBAL_VARIABLE
+SET key_cache_block_size = 8000;
+SELECT @@key_cache_block_size;
+--Error ER_PARSE_ERROR
+SET local.key_cache_block_size = 10;
+--Error ER_UNKNOWN_TABLE
+SELECT local.key_cache_block_size;
+--Error ER_PARSE_ERROR
+SET global.key_cache_block_size = 10;
+--Error ER_UNKNOWN_TABLE
+SELECT global.key_cache_block_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT key_cache_block_size = @@session.key_cache_block_size;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.key_cache_block_size = @start_value;
+SELECT @@global.key_cache_block_size;
+
+
+#####################################################################
+#              END OF key_cache_block_size TESTS                    #
+#####################################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc b/mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc
new file mode 100644
index 00000000000..a2cc49a1f38
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc
@@ -0,0 +1,184 @@
+############## mysql-test\t\key_cache_division_limit_basic.test ###############
+#                                                                             #
+# Variable Name: key_cache_division_limit                                     #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 100                                                          #
+# Range: 1-100                                                                #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable key_cache_division_limit #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+##################################################################### 
+#            START OF key_cache_division_limit TESTS                #
+#####################################################################
+
+
+############################################################################## 
+#  Saving initial value of key_cache_division_limit in a temporary variable  #
+##############################################################################
+
+SET @start_value = @@global.key_cache_division_limit;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_058_01------------------------#'
+################################################################################ 
+#              Display the DEFAULT value of key_cache_division_limit           #
+################################################################################ 
+
+SET @@global.key_cache_division_limit = 50;
+--Error ER_NO_DEFAULT
+SET @@global.key_cache_division_limit = DEFAULT;
+--echo 'Bug# 34878: This variable has default value according to documentation';
+SELECT @@global.key_cache_division_limit;
+
+
+--echo '#---------------------FN_DYNVARS_058_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.key_cache_division_limit = @start_value;
+SELECT @@global.key_cache_division_limit = 100;
+
+
+--echo '#--------------------FN_DYNVARS_058_03------------------------#'
+############################################################################### 
+#        Change the value of key_cache_division_limit to a valid value        #
+############################################################################### 
+
+SET @@global.key_cache_division_limit = 1;
+SELECT @@global.key_cache_division_limit;
+SET @@global.key_cache_division_limit = 50;
+SELECT @@global.key_cache_division_limit;
+SET @@global.key_cache_division_limit = 99;
+SELECT @@global.key_cache_division_limit;
+SET @@global.key_cache_division_limit = 2;
+SELECT @@global.key_cache_division_limit;
+
+
+--echo '#--------------------FN_DYNVARS_058_04-------------------------#'
+########################################################################### 
+#         Change the value of key_cache_division_limit to invalid value    #
+########################################################################### 
+
+SET @@global.key_cache_division_limit = -1;
+SELECT @@global.key_cache_division_limit;
+SET @@global.key_cache_division_limit = 101;
+SELECT @@global.key_cache_division_limit;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_division_limit = 10000.01;
+SELECT @@global.key_cache_division_limit;
+SET @@global.key_cache_division_limit = -1024;
+SELECT @@global.key_cache_division_limit;
+SET @@global.key_cache_division_limit = 0;
+SELECT @@global.key_cache_division_limit;
+SET @@global.key_cache_division_limit = 200;
+SELECT @@global.key_cache_division_limit;
+SET @@global.key_cache_division_limit = 65535;
+SELECT @@global.key_cache_division_limit;
+
+echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_division_limit = ON;
+SELECT @@global.key_cache_division_limit;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.key_cache_division_limit = 'test';
+SELECT @@global.key_cache_division_limit;
+
+
+--echo '#-------------------FN_DYNVARS_058_05----------------------------#'
+########################################################################### 
+#       Test if accessing session key_cache_division_limit gives error     #
+########################################################################### 
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.key_cache_division_limit = 0;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.key_cache_division_limit;
+
+
+--echo '#----------------------FN_DYNVARS_058_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.key_cache_division_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_division_limit';
+
+SELECT @@key_cache_division_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_division_limit';
+
+
+--echo '#---------------------FN_DYNVARS_058_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.key_cache_division_limit = TRUE;
+SELECT @@global.key_cache_division_limit;
+SET @@global.key_cache_division_limit = FALSE;
+SELECT @@global.key_cache_division_limit;
+
+
+--echo '#---------------------FN_DYNVARS_058_08----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@global.key_cache_division_limit = 90;
+SELECT @@key_cache_division_limit = @@global.key_cache_division_limit;
+
+
+--echo '#---------------------FN_DYNVARS_058_09----------------------#'
+############################################################################### 
+#  Check if key_cache_division_limit can be accessed with and without @@ sign #
+###############################################################################;
+
+--Error ER_GLOBAL_VARIABLE
+SET key_cache_division_limit = 80;
+SELECT @@key_cache_division_limit;
+--Error ER_PARSE_ERROR
+SET local.key_cache_division_limit = 10;
+--Error ER_UNKNOWN_TABLE
+SELECT local.key_cache_division_limit;
+--Error ER_PARSE_ERROR
+SET global.key_cache_division_limit = 10;
+--Error ER_UNKNOWN_TABLE
+SELECT global.key_cache_division_limit;
+--Error ER_BAD_FIELD_ERROR
+SELECT key_cache_division_limit = @@session.key_cache_division_limit;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.key_cache_division_limit = @start_value;
+SELECT @@global.key_cache_division_limit;
+
+
+#####################################################################
+#              END OF key_cache_division_limit TESTS                #
+#####################################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc b/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc
new file mode 100644
index 00000000000..cd7e1023649
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc
@@ -0,0 +1,210 @@
+############## mysql-test\t\log_warnings_basic.test ###############
+#                                                                             #
+# Variable Name: log_warnings                                                 #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 1                                                            #
+# Range: -                                                                    #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable log_warnings             #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+############################################################
+#           START OF log_warnings TESTS                    #
+############################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.log_warnings;
+SELECT @start_global_value;
+SET @start_session_value = @@session.log_warnings;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_067_01-------------------------#'
+########################################################################
+#     Display the DEFAULT value of log_warnings            #
+########################################################################
+
+SET @@global.log_warnings = 100;
+SET @@global.log_warnings = DEFAULT;
+SELECT @@global.log_warnings;
+
+SET @@session.log_warnings = 200;
+SET @@session.log_warnings = DEFAULT;
+SELECT @@session.log_warnings;
+
+
+--echo '#--------------------FN_DYNVARS_067_02-------------------------#'
+########################################################################
+#     Check the DEFAULT value of log_warnings              #
+########################################################################
+
+SET @@global.log_warnings = DEFAULT;
+SELECT @@global.log_warnings = 1;
+
+SET @@session.log_warnings = DEFAULT;
+SELECT @@session.log_warnings = 1;
+
+
+--echo '#--------------------FN_DYNVARS_067_03-------------------------#'
+######################################################################
+# Change the value of log_warnings to a valid value for GLOBAL Scope #
+######################################################################
+
+SET @@global.log_warnings = 0;
+SELECT @@global.log_warnings;
+SET @@global.log_warnings = 1;
+SELECT @@global.log_warnings;
+SET @@global.log_warnings = 60020;
+SELECT @@global.log_warnings;
+SET @@global.log_warnings = 65535;
+SELECT @@global.log_warnings;
+SET @@global.log_warnings = 65536;
+SELECT @@global.log_warnings;
+
+
+--echo '#--------------------FN_DYNVARS_067_04-------------------------#'
+#######################################################################
+# Change the value of log_warnings to a valid value for SESSION Scope #
+#######################################################################
+ 
+SET @@session.log_warnings = 0;
+SELECT @@session.log_warnings;
+SET @@session.log_warnings = 1;
+SELECT @@session.log_warnings;
+SET @@session.log_warnings = 50050;
+SELECT @@session.log_warnings;
+SET @@session.log_warnings = 65535;
+SELECT @@session.log_warnings;
+SET @@session.log_warnings = 65550;
+SELECT @@session.log_warnings;
+
+
+--echo '#------------------FN_DYNVARS_067_05-----------------------#'
+########################################################
+# Change the value of log_warnings to an invalid value #
+########################################################
+
+SET @@global.log_warnings = 100000000000;
+SELECT @@global.log_warnings;
+SET @@global.log_warnings = -1024;
+SELECT @@global.log_warnings;
+--Error ER_PARSE_ERROR
+SET @@global.log_warnings = 65530.34.;
+SELECT @@global.log_warnings;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.log_warnings = test;
+SELECT @@global.log_warnings;
+
+SET @@session.log_warnings = 100000000000;
+SELECT @@session.log_warnings;
+SET @@session.log_warnings = -2;
+SELECT @@session.log_warnings;
+--Error ER_PARSE_ERROR
+SET @@session.log_warnings = 65530.34.;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.log_warnings = test;
+SELECT @@session.log_warnings;
+
+
+--echo '#------------------FN_DYNVARS_067_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.log_warnings = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='log_warnings';
+
+--echo '#------------------FN_DYNVARS_067_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.log_warnings = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='log_warnings';
+
+
+--echo '#------------------FN_DYNVARS_067_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.log_warnings = TRUE;
+SELECT @@global.log_warnings;
+SET @@global.log_warnings = FALSE;
+SELECT @@global.log_warnings;
+
+
+--echo '#---------------------FN_DYNVARS_067_09----------------------#'
+#################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+#################################################################################
+
+SET @@global.log_warnings = 10;
+SELECT @@log_warnings = @@global.log_warnings;
+
+
+--echo '#---------------------FN_DYNVARS_067_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@log_warnings = 100;
+SELECT @@log_warnings = @@local.log_warnings;
+SELECT @@local.log_warnings = @@session.log_warnings;
+
+
+--echo '#---------------------FN_DYNVARS_067_11----------------------#'
+#######################################################################
+#   Check if log_warnings can be accessed with and without @@ sign    #
+#######################################################################
+
+SET log_warnings = 1;
+SELECT @@log_warnings;
+--Error ER_UNKNOWN_TABLE
+SELECT local.log_warnings;
+--Error ER_UNKNOWN_TABLE
+SELECT session.log_warnings;
+--Error ER_BAD_FIELD_ERROR
+SELECT log_warnings = @@session.log_warnings;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.log_warnings = @start_global_value;
+SELECT @@global.log_warnings;
+SET @@session.log_warnings = @start_session_value;
+SELECT @@session.log_warnings;
+
+
+#############################################################
+#                 END OF log_warnings TESTS     #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc
new file mode 100644
index 00000000000..9f3416d2e31
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc
@@ -0,0 +1,187 @@
+############## mysql-test\t\max_binlog_cache_size_basic.test ###############
+#                                                                             #
+# Variable Name: max_binlog_cache_size                                        #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:4294967295                                                    #
+# Range: 4096-4294967295                                                      #
+#                                                                             #
+#                                                                             #
+#                                                                             #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable max_binlog_cache_size    #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+######################################################################## 
+#              START OF max_binlog_cache_size TESTS                    #
+######################################################################## 
+
+
+######################################################################## 
+# Saving initial value of max_binlog_cache_size in a temporary variable#
+######################################################################## 
+
+SET @start_value = @@global.max_binlog_cache_size;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_072_01------------------------#'
+######################################################################## 
+#           Display the DEFAULT value of max_binlog_cache_size         #
+######################################################################## 
+
+SET @@global.max_binlog_cache_size = 5000;
+SET @@global.max_binlog_cache_size = DEFAULT;
+SELECT @@global.max_binlog_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_072_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.max_binlog_cache_size = @start_value;
+SELECT @@global.max_binlog_cache_size = 4294967295;
+--echo 'Bug# 34876: Incorrect Default Value is assigned to variable';
+
+--echo '#--------------------FN_DYNVARS_072_03------------------------#'
+######################################################################## 
+#    Change the value of max_binlog_cache_size to a valid value        #
+######################################################################## 
+
+SET @@global.max_binlog_cache_size = 4096;
+SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = 4294967295;
+SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = 4294967294;
+SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = 4097;
+SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = 65535;
+SELECT @@global.max_binlog_cache_size;
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+
+
+--echo '#--------------------FN_DYNVARS_072_04-------------------------#'
+########################################################################### 
+#      Change the value of max_binlog_cache_size to invalid value         #
+########################################################################### 
+
+SET @@global.max_binlog_cache_size = -1;
+SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = 100000000000;
+SELECT @@global.max_binlog_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_binlog_cache_size = 10000.01;
+SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = -1024;
+SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = 1024;
+SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = 4294967296;
+SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = 4095;
+SELECT @@global.max_binlog_cache_size;
+
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_binlog_cache_size = ON;
+SELECT @@global.max_binlog_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_binlog_cache_size = 'test';
+SELECT @@global.max_binlog_cache_size;
+
+
+--echo '#-------------------FN_DYNVARS_072_05----------------------------#'
+########################################################################### 
+#       Test if accessing session max_binlog_cache_size gives error       #
+########################################################################### 
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.max_binlog_cache_size = 4096;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.max_binlog_cache_size;
+
+
+--echo '#----------------------FN_DYNVARS_072_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_binlog_cache_size';
+
+SELECT @@max_binlog_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_binlog_cache_size';
+
+
+--echo '#---------------------FN_DYNVARS_072_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.max_binlog_cache_size = TRUE;
+SELECT @@global.max_binlog_cache_size;
+SET @@global.max_binlog_cache_size = FALSE;
+SELECT @@global.max_binlog_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_072_08----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@global.max_binlog_cache_size = 5000;
+SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_072_09----------------------#'
+################################################################################  
+#   Check if max_binlog_cache_size can be accessed with and without @@ sign    #
+################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET max_binlog_cache_size = 6000;
+SELECT @@max_binlog_cache_size;
+--Error ER_PARSE_ERROR
+SET local.max_binlog_cache_size = 7000;
+--Error ER_UNKNOWN_TABLE
+SELECT local.max_binlog_cache_size;
+--Error ER_PARSE_ERROR
+SET global.max_binlog_cache_size = 8000;
+--Error ER_UNKNOWN_TABLE
+SELECT global.max_binlog_cache_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.max_binlog_cache_size = @start_value;
+SELECT @@global.max_binlog_cache_size;
+
+
+######################################################################## 
+#              END OF max_binlog_cache_size TESTS                      #
+######################################################################## 
diff --git a/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc b/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc
new file mode 100644
index 00000000000..530022652a1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc
@@ -0,0 +1,182 @@
+############## mysql-test\t\max_connect_errors_basic.test ###############
+#                                                                             #
+# Variable Name: max_connect_errors                                           #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:  10                                                          #
+# Range:    1-4294967295                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable max_connect_errors       #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+##################################################################
+#              START OF max_connect_errors TESTS                 #
+##################################################################
+
+
+######################################################################
+# Saving initial value of max_connect_errors in a temporary variable #
+######################################################################
+
+SET @start_value = @@global.max_connect_errors;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_073_01------------------------#'
+##################################################################
+#           Display the DEFAULT value of max_connect_errors         #
+##################################################################
+
+SET @@global.max_connect_errors = 5000;
+SET @@global.max_connect_errors = DEFAULT;
+SELECT @@global.max_connect_errors;
+--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
+
+--echo '#---------------------FN_DYNVARS_073_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.max_connect_errors = @start_value;
+SELECT @@global.max_connect_errors = 10;
+
+--echo '#--------------------FN_DYNVARS_073_03------------------------#'
+##################################################################
+#    Change the value of max_connect_errors to a valid value        #
+##################################################################
+
+SET @@global.max_connect_errors = 4096;
+SELECT @@global.max_connect_errors;
+SET @@global.max_connect_errors = 4294967294;
+SELECT @@global.max_connect_errors;
+SET @@global.max_connect_errors = 4294967295;
+SELECT @@global.max_connect_errors;
+SET @@global.max_connect_errors = 1;
+SELECT @@global.max_connect_errors;
+SET @@global.max_connect_errors = 2;
+SELECT @@global.max_connect_errors;
+--echo 'Bug# 34877:  Invalid Values are coming in variable on assigning valid values';
+
+
+--echo '#--------------------FN_DYNVARS_073_04-------------------------#'
+#####################################################################
+#      Change the value of max_connect_errors to invalid value         #
+#####################################################################
+
+SET @@global.max_connect_errors = -1;
+SELECT @@global.max_connect_errors;
+SET @@global.max_connect_errors = 100000000000;
+SELECT @@global.max_connect_errors;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_connect_errors = 10000.01;
+SELECT @@global.max_connect_errors;
+SET @@global.max_connect_errors = -1024;
+SELECT @@global.max_connect_errors;
+SET @@global.max_connect_errors = 0;
+SELECT @@global.max_connect_errors;
+SET @@global.max_connect_errors = 4294967296;
+SELECT @@global.max_connect_errors;
+
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_connect_errors = ON;
+SELECT @@global.max_connect_errors;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_connect_errors = 'test';
+SELECT @@global.max_connect_errors;
+
+
+--echo '#-------------------FN_DYNVARS_073_05----------------------------#'
+##################################################################### 
+#       Test if accessing session max_connect_errors gives error       #
+#####################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.max_connect_errors = 4096;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.max_connect_errors;
+
+
+--echo '#----------------------FN_DYNVARS_073_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.max_connect_errors = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_connect_errors';
+
+SELECT @@max_connect_errors = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_connect_errors';
+
+
+--echo '#---------------------FN_DYNVARS_073_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.max_connect_errors = TRUE;
+SELECT @@global.max_connect_errors;
+SET @@global.max_connect_errors = FALSE;
+SELECT @@global.max_connect_errors;
+
+
+--echo '#---------------------FN_DYNVARS_073_08----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@global.max_connect_errors = 5000;
+SELECT @@max_connect_errors = @@global.max_connect_errors;
+
+
+--echo '#---------------------FN_DYNVARS_073_09----------------------#'
+##########################################################################
+#   Check if max_connect_errors can be accessed with and without @@ sign    #
+##########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET max_connect_errors = 6000;
+SELECT @@max_connect_errors;
+--Error ER_PARSE_ERROR
+SET local.max_connect_errors = 7000;
+--Error ER_UNKNOWN_TABLE
+SELECT local.max_connect_errors;
+--Error ER_PARSE_ERROR
+SET global.max_connect_errors = 8000;
+--Error ER_UNKNOWN_TABLE
+SELECT global.max_connect_errors;
+--Error ER_BAD_FIELD_ERROR
+SELECT max_connect_errors = @@session.max_connect_errors;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.max_connect_errors = @start_value;
+SELECT @@global.max_connect_errors;
+
+
+##################################################################
+#              END OF max_connect_errors TESTS                      #
+##################################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc b/mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc
new file mode 100644
index 00000000000..d07ae094cde
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc
@@ -0,0 +1,222 @@
+############## mysql-test\t\max_heap_table_size_basic.test ###############
+#                                                                             #
+# Variable Name: max_heap_table_size                                          #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:  16777216                                                    #
+# Range:  16384-4294967295                                                    #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable max_heap_table_size      #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+###############################################################
+#           START OF max_heap_table_size TESTS                #
+###############################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.max_heap_table_size;
+SELECT @start_global_value;
+SET @start_session_value = @@session.max_heap_table_size;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_077_01-------------------------#'
+###############################################################
+#     Display the DEFAULT value of max_heap_table_size        #
+###############################################################
+
+SET @@global.max_heap_table_size = 1677721610;
+SET @@global.max_heap_table_size = DEFAULT;
+SELECT @@global.max_heap_table_size;
+
+SET @@session.max_heap_table_size = 1677721610;
+SET @@session.max_heap_table_size = DEFAULT;
+SELECT @@session.max_heap_table_size;
+
+
+--echo '#--------------------FN_DYNVARS_077_02-------------------------#'
+##################################################################
+#     Check the DEFAULT value of max_heap_table_size             #
+##################################################################
+
+SET @@global.max_heap_table_size = DEFAULT;
+SELECT @@global.max_heap_table_size = 16777216;
+
+SET @@session.max_heap_table_size = DEFAULT;
+SELECT @@session.max_heap_table_size = 16777216;
+
+
+--echo '#--------------------FN_DYNVARS_077_03-------------------------#'
+############################################################################
+# Change the value of max_heap_table_size to a valid value for GLOBAL Scope #
+############################################################################
+
+SET @@global.max_heap_table_size = 16384;
+SELECT @@global.max_heap_table_size;
+SET @@global.max_heap_table_size = 16385;
+SELECT @@global.max_heap_table_size;
+SET @@global.max_heap_table_size = 65535;
+SELECT @@global.max_heap_table_size;
+SET @@global.max_heap_table_size = 4294967294;
+SELECT @@global.max_heap_table_size;
+SET @@global.max_heap_table_size = 4294967295;
+SELECT @@global.max_heap_table_size;
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+
+
+--echo '#--------------------FN_DYNVARS_077_04-------------------------#'
+#############################################################################
+# Change the value of max_heap_table_size to a valid value for SESSION Scope #
+#############################################################################
+ 
+SET @@session.max_heap_table_size = 16384;
+SELECT @@session.max_heap_table_size;
+SET @@session.max_heap_table_size = 16385;
+SELECT @@session.max_heap_table_size;
+SET @@session.max_heap_table_size = 65535;
+SELECT @@session.max_heap_table_size;
+SET @@session.max_heap_table_size = 4294967294;
+SELECT @@session.max_heap_table_size;
+SET @@session.max_heap_table_size = 4294967295;
+SELECT @@session.max_heap_table_size;
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+
+
+--echo '#------------------FN_DYNVARS_077_05-----------------------#'
+##############################################################
+# Change the value of max_heap_table_size to an invalid value #
+##############################################################
+
+SET @@global.max_heap_table_size = -1;
+SELECT @@global.max_heap_table_size;
+SET @@global.max_heap_table_size = -1024;
+SELECT @@global.max_heap_table_size;
+SET @@global.max_heap_table_size = 1024;
+SELECT @@global.max_heap_table_size;
+SET @@global.max_heap_table_size = 16383;
+SELECT @@global.max_heap_table_size;
+SET @@global.max_heap_table_size = 4294967296;
+SELECT @@global.max_heap_table_size;
+--Error ER_PARSE_ERROR
+SET @@global.max_heap_table_size = 65530.34.;
+SELECT @@global.max_heap_table_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_heap_table_size = test;
+SELECT @@global.max_heap_table_size;
+
+SET @@session.max_heap_table_size = -1;
+SELECT @@session.max_heap_table_size;
+SET @@session.max_heap_table_size = 16383;
+SELECT @@session.max_heap_table_size;
+SET @@session.max_heap_table_size = 4294967296;
+SELECT @@session.max_heap_table_size;
+--Error ER_PARSE_ERROR
+SET @@session.max_heap_table_size = 65530.34.;
+SET @@session.max_heap_table_size = 10737418241;
+SELECT @@session.max_heap_table_size;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_heap_table_size = test;
+SELECT @@session.max_heap_table_size;
+
+
+--echo '#------------------FN_DYNVARS_077_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.max_heap_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_heap_table_size';
+
+--echo '#------------------FN_DYNVARS_077_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.max_heap_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_heap_table_size';
+
+
+--echo '#------------------FN_DYNVARS_077_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.max_heap_table_size = TRUE;
+SELECT @@global.max_heap_table_size;
+SET @@global.max_heap_table_size = FALSE;
+SELECT @@global.max_heap_table_size;
+
+
+--echo '#---------------------FN_DYNVARS_077_09----------------------#'
+#################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+#################################################################################
+
+SET @@global.max_heap_table_size = 163845;
+SELECT @@max_heap_table_size = @@global.max_heap_table_size;
+
+
+--echo '#---------------------FN_DYNVARS_077_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@max_heap_table_size = 16777216;
+SELECT @@max_heap_table_size = @@local.max_heap_table_size;
+SELECT @@local.max_heap_table_size = @@session.max_heap_table_size;
+
+
+--echo '#---------------------FN_DYNVARS_077_11----------------------#'
+#############################################################################
+#   Check if max_heap_table_size can be accessed with and without @@ sign    #
+#############################################################################
+
+SET max_heap_table_size = 316777216;
+SELECT @@max_heap_table_size;
+--Error ER_UNKNOWN_TABLE
+SELECT local.max_heap_table_size;
+--Error ER_UNKNOWN_TABLE
+SELECT session.max_heap_table_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT max_heap_table_size = @@session.max_heap_table_size;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.max_heap_table_size = @start_global_value;
+SELECT @@global.max_heap_table_size;
+SET @@session.max_heap_table_size = @start_session_value;
+SELECT @@session.max_heap_table_size;
+
+
+#######################################################
+#                 END OF max_heap_table_size TESTS     #
+#######################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc b/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc
new file mode 100644
index 00000000000..23c3c5b2a95
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc
@@ -0,0 +1,213 @@
+############## mysql-test\t\max_seeks_for_key_basic.test ###############
+#                                                                             #
+# Variable Name: max_seeks_for_key                                            #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:  4294967295                                                  #
+# Range:  1-4294967295                                                        #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable max_seeks_for_key        #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+#################################################################
+#           START OF max_seeks_for_key TESTS                    #
+#################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.max_seeks_for_key;
+SELECT @start_global_value;
+SET @start_session_value = @@session.max_seeks_for_key;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_083_01-------------------------#'
+#################################################################
+#     Display the DEFAULT value of max_seeks_for_key            #
+#################################################################
+
+SET @@global.max_seeks_for_key = 100;
+SET @@global.max_seeks_for_key = DEFAULT;
+SELECT @@global.max_seeks_for_key;
+
+SET @@session.max_seeks_for_key = 200;
+SET @@session.max_seeks_for_key = DEFAULT;
+SELECT @@session.max_seeks_for_key;
+
+
+--echo '#--------------------FN_DYNVARS_083_02-------------------------#'
+#################################################################
+#     Check the DEFAULT value of max_seeks_for_key              #
+#################################################################
+
+SET @@global.max_seeks_for_key = DEFAULT;
+SELECT @@global.max_seeks_for_key = 4294967295;
+
+SET @@session.max_seeks_for_key = DEFAULT;
+SELECT @@session.max_seeks_for_key = 4294967295;
+
+
+--echo '#--------------------FN_DYNVARS_083_03-------------------------#'
+###########################################################################
+# Change the value of max_seeks_for_key to a valid value for GLOBAL Scope #
+###########################################################################
+
+SET @@global.max_seeks_for_key = 1;
+SELECT @@global.max_seeks_for_key;
+SET @@global.max_seeks_for_key = 2;
+SELECT @@global.max_seeks_for_key;
+SET @@global.max_seeks_for_key = 65536;
+SELECT @@global.max_seeks_for_key;
+SET @@global.max_seeks_for_key = 4294967295;
+SELECT @@global.max_seeks_for_key;
+SET @@global.max_seeks_for_key = 4294967294;
+SELECT @@global.max_seeks_for_key;
+
+
+--echo '#--------------------FN_DYNVARS_083_04-------------------------#'
+############################################################################
+# Change the value of max_seeks_for_key to a valid value for SESSION Scope #
+############################################################################
+SET @@session.max_seeks_for_key = 1;
+SELECT @@session.max_seeks_for_key;
+SET @@session.max_seeks_for_key = 2;
+SELECT @@session.max_seeks_for_key;
+SET @@session.max_seeks_for_key = 4294967295;
+SELECT @@session.max_seeks_for_key;
+SET @@session.max_seeks_for_key = 4294967294;
+SELECT @@session.max_seeks_for_key;
+SET @@session.max_seeks_for_key = 65535;
+SELECT @@session.max_seeks_for_key;
+
+
+--echo '#------------------FN_DYNVARS_083_05-----------------------#'
+#############################################################
+# Change the value of max_seeks_for_key to an invalid value #
+#############################################################
+
+SET @@global.max_seeks_for_key = 0;
+SELECT @@global.max_seeks_for_key;
+SET @@global.max_seeks_for_key = -1024;
+SELECT @@global.max_seeks_for_key;
+SET @@global.max_seeks_for_key = 4294967296;
+SELECT @@global.max_seeks_for_key;
+--Error ER_PARSE_ERROR
+SET @@global.max_seeks_for_key = 65530.34.;
+SELECT @@global.max_seeks_for_key;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_seeks_for_key = test;
+SELECT @@global.max_seeks_for_key;
+
+SET @@session.max_seeks_for_key = 0;
+SELECT @@session.max_seeks_for_key;
+SET @@session.max_seeks_for_key = -2;
+SELECT @@session.max_seeks_for_key;
+--Error ER_PARSE_ERROR
+SET @@session.max_seeks_for_key = 65530.34.;
+SET @@session.max_seeks_for_key = 4294967296;
+SELECT @@session.max_seeks_for_key;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_seeks_for_key = test;
+SELECT @@session.max_seeks_for_key;
+
+
+--echo '#------------------FN_DYNVARS_083_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.max_seeks_for_key = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_seeks_for_key';
+
+--echo '#------------------FN_DYNVARS_083_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.max_seeks_for_key = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_seeks_for_key';
+
+
+--echo '#------------------FN_DYNVARS_083_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.max_seeks_for_key = TRUE;
+SELECT @@global.max_seeks_for_key;
+SET @@global.max_seeks_for_key = FALSE;
+SELECT @@global.max_seeks_for_key;
+
+
+--echo '#---------------------FN_DYNVARS_083_09----------------------#'
+#################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+#################################################################################
+
+SET @@global.max_seeks_for_key = 10;
+SELECT @@max_seeks_for_key = @@global.max_seeks_for_key;
+
+
+--echo '#---------------------FN_DYNVARS_083_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@max_seeks_for_key = 100;
+SELECT @@max_seeks_for_key = @@local.max_seeks_for_key;
+SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key;
+
+
+--echo '#---------------------FN_DYNVARS_083_11----------------------#'
+############################################################################  
+#   Check if max_seeks_for_key can be accessed with and without @@ sign    #
+############################################################################
+
+SET max_seeks_for_key = 1;
+SELECT @@max_seeks_for_key;
+--Error ER_UNKNOWN_TABLE
+SELECT local.max_seeks_for_key;
+--Error ER_UNKNOWN_TABLE
+SELECT session.max_seeks_for_key;
+--Error ER_BAD_FIELD_ERROR
+SELECT max_seeks_for_key = @@session.max_seeks_for_key;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.max_seeks_for_key = @start_global_value;
+SELECT @@global.max_seeks_for_key;
+SET @@session.max_seeks_for_key = @start_session_value;
+SELECT @@session.max_seeks_for_key;
+
+
+#############################################################
+#                 END OF max_seeks_for_key TESTS     #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc b/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc
new file mode 100644
index 00000000000..e24d97f47dd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc
@@ -0,0 +1,227 @@
+############## mysql-test\t\max_tmp_tables_basic.test ###############
+#                                                                             #
+# Variable Name: max_tmp_tables                                               #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 32                                                           #
+# Range: 1-4294967295                                                         #
+#                                                                             # 
+#                                                                             #
+#                                                                             #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable max_tmp_tables           #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+####################################
+#   START OF max_tmp_tables TESTS  #
+####################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.max_tmp_tables;
+SELECT @start_global_value;
+SET @start_session_value = @@session.max_tmp_tables;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_086_01-------------------------#'
+######################################################
+#    Display the DEFAULT value of max_tmp_tables     #
+######################################################
+
+SET @@global.max_tmp_tables = 1000;
+SET @@global.max_tmp_tables = DEFAULT;
+SELECT @@global.max_tmp_tables;
+
+
+SET @@session.max_tmp_tables = 1000;
+SET @@session.max_tmp_tables = DEFAULT;
+SELECT @@session.max_tmp_tables;
+
+
+--echo '#--------------------FN_DYNVARS_086_02-------------------------#'
+######################################################
+#     Check the DEFAULT value of max_tmp_tables      #
+######################################################
+
+SET @@global.max_tmp_tables = DEFAULT;
+SELECT @@global.max_tmp_tables = 32;
+
+SET @@session.max_tmp_tables = DEFAULT;
+SELECT @@session.max_tmp_tables = 32;
+
+
+
+--echo '#--------------------FN_DYNVARS_086_03-------------------------#'
+########################################################################
+# Change the value of max_tmp_tables to a valid value for GLOBAL Scope #
+########################################################################
+
+SET @@global.max_tmp_tables = 1;
+SELECT @@global.max_tmp_tables;
+SET @@global.max_tmp_tables = 2;
+SELECT @@global.max_tmp_tables;
+SET @@global.max_tmp_tables = 65536;
+SELECT @@global.max_tmp_tables;
+SET @@global.max_tmp_tables = 4294967295;
+SELECT @@global.max_tmp_tables;
+SET @@global.max_tmp_tables = 4294967294;
+SELECT @@global.max_tmp_tables;
+
+--echo '#--------------------FN_DYNVARS_086_04-------------------------#'
+#########################################################################
+# Change the value of max_tmp_tables to a valid value for SESSION Scope #
+#########################################################################
+
+SET @@session.max_tmp_tables = 1;
+SELECT @@session.max_tmp_tables;
+
+SET @@session.max_tmp_tables = 2;
+SELECT @@session.max_tmp_tables;
+
+SET @@session.max_tmp_tables = 65536;
+SELECT @@session.max_tmp_tables;
+
+SET @@session.max_tmp_tables = 4294967295;
+SELECT @@session.max_tmp_tables;
+
+SET @@session.max_tmp_tables = 4294967294;
+SELECT @@session.max_tmp_tables;
+
+
+--echo '#------------------FN_DYNVARS_086_05-----------------------#'
+##########################################################
+# Change the value of max_tmp_tables to an invalid value #
+##########################################################
+
+SET @@global.max_tmp_tables = -1024;
+SELECT @@global.max_tmp_tables;
+SET @@global.max_tmp_tables = 4294967296;
+SELECT @@global.max_tmp_tables;
+SET @@global.max_tmp_tables = -1;
+SELECT @@global.max_tmp_tables;
+SET @@global.max_tmp_tables = 429496729500;
+SELECT @@global.max_tmp_tables;
+--Error ER_PARSE_ERROR
+SET @@global.max_tmp_tables = 65530.34.;
+SELECT @@global.max_tmp_tables;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_tmp_tables = test;
+SELECT @@global.max_tmp_tables;
+
+SET @@session.max_tmp_tables = 4294967296;
+SELECT @@session.max_tmp_tables;
+SET @@session.max_tmp_tables = -1;
+SELECT @@session.max_tmp_tables;
+SET @@session.max_tmp_tables = 429496729500;
+SELECT @@session.max_tmp_tables;
+SET @@session.max_tmp_tables = -001;
+SELECT @@session.max_tmp_tables;
+--Error ER_PARSE_ERROR
+SET @@session.max_tmp_tables = 65530.34.;
+SET @@session.max_tmp_tables = 10737418241;
+SELECT @@session.max_tmp_tables;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.max_tmp_tables = test;
+SELECT @@session.max_tmp_tables;
+
+
+--echo '#------------------FN_DYNVARS_086_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.max_tmp_tables = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_tmp_tables';
+
+--echo '#------------------FN_DYNVARS_086_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.max_tmp_tables = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_tmp_tables';
+
+
+--echo '#------------------FN_DYNVARS_086_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.max_tmp_tables = TRUE;
+SELECT @@global.max_tmp_tables;
+SET @@global.max_tmp_tables = FALSE;
+SELECT @@global.max_tmp_tables;
+
+
+--echo '#---------------------FN_DYNVARS_086_09----------------------#'
+#################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+#################################################################################
+
+SET @@global.max_tmp_tables = 20;
+SELECT @@max_tmp_tables = @@global.max_tmp_tables;
+
+
+--echo '#---------------------FN_DYNVARS_086_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@max_tmp_tables = 255;
+SELECT @@max_tmp_tables = @@local.max_tmp_tables;
+SELECT @@local.max_tmp_tables = @@session.max_tmp_tables;
+
+
+--echo '#---------------------FN_DYNVARS_086_11----------------------#'
+#########################################################################
+#   Check if max_tmp_tables can be accessed with and without @@ sign    #
+#########################################################################
+
+
+SET max_tmp_tables = 102;
+SELECT @@max_tmp_tables;
+--Error ER_UNKNOWN_TABLE
+SELECT local.max_tmp_tables;
+--Error ER_UNKNOWN_TABLE
+SELECT session.max_tmp_tables;
+--Error ER_BAD_FIELD_ERROR
+SELECT max_tmp_tables = @@session.max_tmp_tables;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.max_tmp_tables = @start_global_value;
+SELECT @@global.max_tmp_tables;
+SET @@session.max_tmp_tables = @start_session_value;
+SELECT @@session.max_tmp_tables;
+
+
+###################################################
+#                 END OF max_tmp_tables TESTS     #
+###################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc b/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc
new file mode 100644
index 00000000000..80d5b7cc747
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc
@@ -0,0 +1,158 @@
+############## mysql-test\t\max_write_lock_count_basic.test ###############
+#                                                                             #
+# Variable Name: max_write_lock_count                                         #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 4294967295                                                   #
+# Range:1-4294967295                                                          #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable max_write_lock_count     #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+##########################################
+#   START OF max_write_lock_count TESTS  #
+##########################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.max_write_lock_count;
+SELECT @start_global_value;
+
+
+--echo '#--------------------FN_DYNVARS_088_01-------------------------#'
+############################################################
+#    Display the DEFAULT value of max_write_lock_count     #
+############################################################
+
+SET @@global.max_write_lock_count = 1000;
+SET @@global.max_write_lock_count = DEFAULT;
+SELECT @@global.max_write_lock_count;
+
+
+--echo '#--------------------FN_DYNVARS_088_02-------------------------#'
+############################################################
+#     Check the DEFAULT value of max_write_lock_count      #
+############################################################
+
+SET @@global.max_write_lock_count = DEFAULT;
+SELECT @@global.max_write_lock_count = 4294967295;
+
+
+--echo '#--------------------FN_DYNVARS_088_03-------------------------#'
+##############################################################################
+# Change the value of max_write_lock_count to a valid value for GLOBAL Scope #
+##############################################################################
+
+SET @@global.max_write_lock_count = 1;
+SELECT @@global.max_write_lock_count;
+SET @@global.max_write_lock_count = 2;
+SELECT @@global.max_write_lock_count;
+SET @@global.max_write_lock_count = 65536;
+SELECT @@global.max_write_lock_count;
+SET @@global.max_write_lock_count = 4294967295;
+SELECT @@global.max_write_lock_count;
+SET @@global.max_write_lock_count = 4294967294;
+SELECT @@global.max_write_lock_count;
+
+
+
+--echo '#------------------FN_DYNVARS_088_04-----------------------#'
+################################################################
+# Change the value of max_write_lock_count to an invalid value #
+################################################################
+
+SET @@global.max_write_lock_count = -1024;
+SELECT @@global.max_write_lock_count;
+SET @@global.max_write_lock_count = 4294967296;
+SELECT @@global.max_write_lock_count;
+SET @@global.max_write_lock_count = -1;
+SELECT @@global.max_write_lock_count;
+SET @@global.max_write_lock_count = 429496729500;
+SELECT @@global.max_write_lock_count;
+--Error ER_PARSE_ERROR
+SET @@global.max_write_lock_count = 65530.34.;
+SELECT @@global.max_write_lock_count;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_write_lock_count = test;
+SELECT @@global.max_write_lock_count;
+
+
+
+--echo '#------------------FN_DYNVARS_088_05-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.max_write_lock_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_write_lock_count';
+
+
+--echo '#------------------FN_DYNVARS_088_06-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.max_write_lock_count = TRUE;
+SELECT @@global.max_write_lock_count;
+SET @@global.max_write_lock_count = FALSE;
+SELECT @@global.max_write_lock_count;
+
+
+--echo '#---------------------FN_DYNVARS_088_07----------------------#'
+#################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+#################################################################################
+
+SET @@global.max_write_lock_count = 20;
+SELECT @@max_write_lock_count = @@global.max_write_lock_count;
+
+
+--echo '#---------------------FN_DYNVARS_088_08----------------------#'
+###############################################################################
+#   Check if max_write_lock_count can be accessed with and without @@ sign    #
+###############################################################################
+
+
+SET @@global.max_write_lock_count = 102;
+SELECT @@max_write_lock_count;
+--Error ER_UNKNOWN_TABLE
+SELECT local.max_write_lock_count;
+--Error ER_UNKNOWN_TABLE
+SELECT global.max_write_lock_count;
+--Error ER_BAD_FIELD_ERROR
+SELECT max_write_lock_count = @@global.max_write_lock_count;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.max_write_lock_count = @start_global_value;
+SELECT @@global.max_write_lock_count;
+
+
+###################################################
+#           END OF max_write_lock_count TESTS     #
+###################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc b/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc
new file mode 100644
index 00000000000..c032d4a9d6d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc
@@ -0,0 +1,219 @@
+############## mysql-test\t\min_examined_row_limit_basic.test ###############
+#                                                                             #
+# Variable Name: min_examined_row_limit                                       #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:  0                                                           #
+# Range:0-4294967295                                                          #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable min_examined_row_limit   #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+######################################################################
+#           START OF min_examined_row_limit TESTS                    #
+######################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.min_examined_row_limit;
+SELECT @start_global_value;
+SET @start_session_value = @@session.min_examined_row_limit;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_089_01-------------------------#'
+######################################################################
+#     Display the DEFAULT value of min_examined_row_limit            #
+######################################################################
+
+SET @@global.min_examined_row_limit = 100;
+SET @@global.min_examined_row_limit = DEFAULT;
+SELECT @@global.min_examined_row_limit;
+
+SET @@session.min_examined_row_limit = 200;
+SET @@session.min_examined_row_limit = DEFAULT;
+SELECT @@session.min_examined_row_limit;
+
+
+--echo '#--------------------FN_DYNVARS_089_02-------------------------#'
+########################################################################
+#     Check the DEFAULT value of min_examined_row_limit              #
+########################################################################
+
+SET @@global.min_examined_row_limit = DEFAULT;
+SELECT @@global.min_examined_row_limit = 0;
+
+SET @@session.min_examined_row_limit = DEFAULT;
+SELECT @@session.min_examined_row_limit = 0;
+
+
+--echo '#--------------------FN_DYNVARS_089_03-------------------------#'
+################################################################################
+# Change the value of min_examined_row_limit to a valid value for GLOBAL Scope #
+################################################################################
+
+SET @@global.min_examined_row_limit = 0;
+SELECT @@global.min_examined_row_limit;
+SET @@global.min_examined_row_limit = 1;
+SELECT @@global.min_examined_row_limit;
+SET @@global.min_examined_row_limit = 60020;
+SELECT @@global.min_examined_row_limit;
+SET @@global.min_examined_row_limit = 65535;
+SELECT @@global.min_examined_row_limit;
+SET @@global.min_examined_row_limit = 4294967295;
+SELECT @@global.min_examined_row_limit;
+SET @@global.min_examined_row_limit = 4294967294;
+SELECT @@global.min_examined_row_limit;
+
+
+
+--echo '#--------------------FN_DYNVARS_089_04-------------------------#'
+###################################################################################
+# Change the value of min_examined_row_limit to a valid value for SESSION Scope #
+###################################################################################
+ 
+SET @@session.min_examined_row_limit = 0;
+SELECT @@session.min_examined_row_limit;
+SET @@session.min_examined_row_limit = 1;
+SELECT @@session.min_examined_row_limit;
+SET @@session.min_examined_row_limit = 50050;
+SELECT @@session.min_examined_row_limit;
+SET @@session.min_examined_row_limit = 65535;
+SELECT @@session.min_examined_row_limit;
+SET @@session.min_examined_row_limit = 4294967295;
+SELECT @@session.min_examined_row_limit;
+SET @@session.min_examined_row_limit = 4294967294;
+SELECT @@session.min_examined_row_limit;
+
+
+--echo '#------------------FN_DYNVARS_089_05-----------------------#'
+####################################################################
+# Change the value of min_examined_row_limit to an invalid value #
+####################################################################
+
+SET @@global.min_examined_row_limit = 429496726;
+SELECT @@global.min_examined_row_limit;
+SET @@global.min_examined_row_limit = -1024;
+SELECT @@global.min_examined_row_limit;
+SET @@global.min_examined_row_limit = 429496729500;
+SELECT @@global.min_examined_row_limit;
+--Error ER_PARSE_ERROR
+SET @@global.min_examined_row_limit = 65530.34.;
+SELECT @@global.min_examined_row_limit;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.min_examined_row_limit = test;
+SELECT @@global.min_examined_row_limit;
+
+SET @@session.min_examined_row_limit = 4294967296;
+SELECT @@session.min_examined_row_limit;
+SET @@session.min_examined_row_limit = -1;
+SELECT @@session.min_examined_row_limit;
+--Error ER_PARSE_ERROR
+SET @@session.min_examined_row_limit = 65530.34.;
+SET @@session.min_examined_row_limit = 4294967295021;
+SELECT @@session.min_examined_row_limit;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.min_examined_row_limit = test;
+SELECT @@session.min_examined_row_limit;
+
+
+--echo '#------------------FN_DYNVARS_089_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.min_examined_row_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='min_examined_row_limit';
+
+--echo '#------------------FN_DYNVARS_089_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.min_examined_row_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='min_examined_row_limit';
+
+
+--echo '#------------------FN_DYNVARS_089_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.min_examined_row_limit = TRUE;
+SELECT @@global.min_examined_row_limit;
+SET @@global.min_examined_row_limit = FALSE;
+SELECT @@global.min_examined_row_limit;
+
+
+--echo '#---------------------FN_DYNVARS_089_09----------------------#'
+#################################################################################### 
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+#################################################################################### 
+
+SET @@global.min_examined_row_limit = 10;
+SELECT @@min_examined_row_limit = @@global.min_examined_row_limit;
+
+
+--echo '#---------------------FN_DYNVARS_089_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@min_examined_row_limit = 100;
+SELECT @@min_examined_row_limit = @@local.min_examined_row_limit;
+SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit;
+
+
+--echo '#---------------------FN_DYNVARS_089_11----------------------#'
+###################################################################################  
+#   Check if min_examined_row_limit can be accessed with and without @@ sign    #
+###################################################################################
+
+SET min_examined_row_limit = 1;
+SELECT @@min_examined_row_limit;
+--Error ER_UNKNOWN_TABLE
+SELECT local.min_examined_row_limit;
+--Error ER_UNKNOWN_TABLE
+SELECT session.min_examined_row_limit;
+--Error ER_BAD_FIELD_ERROR
+SELECT min_examined_row_limit = @@session.min_examined_row_limit;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.min_examined_row_limit = @start_global_value;
+SELECT @@global.min_examined_row_limit;
+SET @@session.min_examined_row_limit = @start_session_value;
+SELECT @@session.min_examined_row_limit;
+
+
+#############################################################
+#                 END OF min_examined_row_limit TESTS     #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/multi_range_count_basic.inc b/mysql-test/suite/sys_vars/inc/multi_range_count_basic.inc
new file mode 100644
index 00000000000..47e8352196f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/multi_range_count_basic.inc
@@ -0,0 +1,219 @@
+############## mysql-test\t\multi_range_count_basic.test ###############
+#                                                                             #
+# Variable Name: multi_range_count                                            #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:  256                                                         #
+# Range:1-4294967295                                                          #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable multi_range_count        #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+#################################################################
+#           START OF multi_range_count TESTS                    #
+#################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.multi_range_count;
+SELECT @start_global_value;
+SET @start_session_value = @@session.multi_range_count;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_090_01-------------------------#'
+#################################################################
+#     Display the DEFAULT value of multi_range_count            #
+#################################################################
+
+SET @@global.multi_range_count = 100;
+SET @@global.multi_range_count = DEFAULT;
+SELECT @@global.multi_range_count;
+
+SET @@session.multi_range_count = 200;
+SET @@session.multi_range_count = DEFAULT;
+SELECT @@session.multi_range_count;
+
+
+--echo '#--------------------FN_DYNVARS_090_02-------------------------#'
+#################################################################
+#     Check the DEFAULT value of multi_range_count              #
+#################################################################
+
+SET @@global.multi_range_count = DEFAULT;
+SELECT @@global.multi_range_count = 256;
+
+SET @@session.multi_range_count = DEFAULT;
+SELECT @@session.multi_range_count = 256;
+
+
+--echo '#--------------------FN_DYNVARS_090_03-------------------------#'
+###########################################################################
+# Change the value of multi_range_count to a valid value for GLOBAL Scope #
+###########################################################################
+
+SET @@global.multi_range_count = 1;
+SELECT @@global.multi_range_count;
+SET @@global.multi_range_count = 60020;
+SELECT @@global.multi_range_count;
+SET @@global.multi_range_count = 65535;
+SELECT @@global.multi_range_count;
+SET @@global.multi_range_count = 4294967295;
+SELECT @@global.multi_range_count;
+SET @@global.multi_range_count = 4294967294;
+SELECT @@global.multi_range_count;
+
+
+
+--echo '#--------------------FN_DYNVARS_090_04-------------------------#'
+############################################################################
+# Change the value of multi_range_count to a valid value for SESSION Scope #
+############################################################################
+ 
+SET @@session.multi_range_count = 1;
+SELECT @@session.multi_range_count;
+SET @@session.multi_range_count = 50050;
+SELECT @@session.multi_range_count;
+SET @@session.multi_range_count = 65535;
+SELECT @@session.multi_range_count;
+SET @@session.multi_range_count = 4294967295;
+SELECT @@session.multi_range_count;
+SET @@session.multi_range_count = 4294967294;
+SELECT @@session.multi_range_count;
+
+
+--echo '#------------------FN_DYNVARS_090_05-----------------------#'
+#############################################################
+# Change the value of multi_range_count to an invalid value #
+#############################################################
+
+SET @@global.multi_range_count = 0;
+SELECT @@global.multi_range_count;
+SET @@global.multi_range_count = 4294967296;
+SELECT @@global.multi_range_count;
+SET @@global.multi_range_count = -1024;
+SELECT @@global.multi_range_count;
+SET @@global.multi_range_count = 429496729500;
+SELECT @@global.multi_range_count;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.multi_range_count = 65530.34;
+SELECT @@global.multi_range_count;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.multi_range_count = test;
+SELECT @@global.multi_range_count;
+
+SET @@session.multi_range_count = 0;
+SELECT @@session.multi_range_count;
+SET @@session.multi_range_count = 4294967296;
+SELECT @@session.multi_range_count;
+SET @@session.multi_range_count = -1;
+SELECT @@session.multi_range_count;
+--Error ER_PARSE_ERROR
+SET @@session.multi_range_count = 65530.34.;
+SET @@session.multi_range_count = 4294967295021;
+SELECT @@session.multi_range_count;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.multi_range_count = test;
+SELECT @@session.multi_range_count;
+
+
+--echo '#------------------FN_DYNVARS_090_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.multi_range_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='multi_range_count';
+
+--echo '#------------------FN_DYNVARS_090_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.multi_range_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='multi_range_count';
+
+
+--echo '#------------------FN_DYNVARS_090_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.multi_range_count = TRUE;
+SELECT @@global.multi_range_count;
+SET @@global.multi_range_count = FALSE;
+SELECT @@global.multi_range_count;
+
+
+--echo '#---------------------FN_DYNVARS_090_09----------------------#'
+################################################################################# 
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+################################################################################# 
+
+SET @@global.multi_range_count = 10;
+SELECT @@multi_range_count = @@global.multi_range_count;
+
+
+--echo '#---------------------FN_DYNVARS_090_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@multi_range_count = 100;
+SELECT @@multi_range_count = @@local.multi_range_count;
+SELECT @@local.multi_range_count = @@session.multi_range_count;
+
+
+--echo '#---------------------FN_DYNVARS_090_11----------------------#'
+############################################################################  
+#   Check if multi_range_count can be accessed with and without @@ sign    #
+############################################################################
+
+SET multi_range_count = 1;
+SELECT @@multi_range_count;
+--Error ER_UNKNOWN_TABLE
+SELECT local.multi_range_count;
+--Error ER_UNKNOWN_TABLE
+SELECT session.multi_range_count;
+--Error ER_BAD_FIELD_ERROR
+SELECT multi_range_count = @@session.multi_range_count;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.multi_range_count = @start_global_value;
+SELECT @@global.multi_range_count;
+SET @@session.multi_range_count = @start_session_value;
+SELECT @@session.multi_range_count;
+
+
+######################################################
+#                 END OF multi_range_count TESTS     #
+######################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc
new file mode 100644
index 00000000000..23f0607b439
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc
@@ -0,0 +1,184 @@
+
+############## mysql-test\t\myisam_max_sort_file_size_basic.test ################
+#                                                                              #
+# Variable Name: myisam_max_sort_file_size                                      #
+# Scope: GLOBAL & SESSION                                                      #
+# Access Type: Dynamic                                                         #
+# Data Type: Numeric                                                           #
+# Default Value: 1                                                             #
+# Range: 1 - 65536                                                             #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-02-07                                                    #
+# Author:  Rizwan Maredia                                                      #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable myisam_max_sort_file_size  #
+#              that checks the behavior of this variable in the following ways #
+#              * Default Value                                                 #
+#              * Valid & Invalid values                                        #
+#              * Scope & Access method                                         #
+#              * Data Integrity                                                #
+#                                                                              #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
+#  server-system-variables.html                                                #
+#                                                                              #
+################################################################################
+
+--source include/load_sysvars.inc
+
+###################################################################
+#           START OF myisam_max_sort_file_size TESTS              #
+###################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.myisam_max_sort_file_size;
+SELECT @start_global_value;
+
+--echo '#--------------------FN_DYNVARS_094_01-------------------------#'
+###################################################################
+#     Display the DEFAULT value of myisam_max_sort_file_size      #
+###################################################################
+
+SET @@global.myisam_max_sort_file_size = 500000;
+SET @@global.myisam_max_sort_file_size = DEFAULT;
+SELECT @@global.myisam_max_sort_file_size;
+
+--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
+
+--echo '#--------------------FN_DYNVARS_094_02-------------------------#'
+###################################################################
+#     Check the DEFAULT value of myisam_max_sort_file_size         #
+###################################################################
+
+SET @@global.myisam_max_sort_file_size = DEFAULT;
+SELECT @@global.myisam_max_sort_file_size = 2147483648;
+
+--echo '#--------------------FN_DYNVARS_094_03-------------------------#'
+##################################################################################
+# Change the value of myisam_max_sort_file_size to a valid value for GLOBAL Scope #
+##################################################################################
+
+SET @@global.myisam_max_sort_file_size = 0;
+SELECT @@global.myisam_max_sort_file_size;
+SET @@global.myisam_max_sort_file_size = 1024;
+SELECT @@global.myisam_max_sort_file_size;
+SET @@global.myisam_max_sort_file_size = 123456789;
+SELECT @@global.myisam_max_sort_file_size;
+SET @@global.myisam_max_sort_file_size = 2147483648*2;
+SELECT @@global.myisam_max_sort_file_size;
+SET @@global.myisam_max_sort_file_size = 2147483648*1024;
+SELECT @@global.myisam_max_sort_file_size;
+SELECT @@global.myisam_max_sort_file_size;
+SET @@global.myisam_max_sort_file_size = 2147483648*2147483648;
+
+--echo '#--------------------FN_DYNVARS_094_04-------------------------#'
+#################################################################################
+#           Check if variable can be access with session scope                  #
+#################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@myisam_max_sort_file_size = 2;
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.myisam_max_sort_file_size = 3;
+
+--Error ER_GLOBAL_VARIABLE
+SET @@local.myisam_max_sort_file_size = 4;
+
+
+
+--echo '#------------------FN_DYNVARS_094_05-----------------------#'
+####################################################################
+# Change the value of myisam_max_sort_file_size to an invalid value #
+####################################################################
+
+SET @@global.myisam_max_sort_file_size = -1;
+SELECT @@global.myisam_max_sort_file_size;
+SET @@global.myisam_max_sort_file_size = -2147483648;
+SELECT @@global.myisam_max_sort_file_size;
+SET @@global.myisam_max_sort_file_size = -2147483649;
+SELECT @@global.myisam_max_sort_file_size;
+--Error ER_PARSE_ERROR
+SET @@global.myisam_max_sort_file_size = 65530.34.;
+SELECT @@global.myisam_max_sort_file_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_max_sort_file_size = 2147483649.56;
+SELECT @@global.myisam_max_sort_file_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_max_sort_file_size = 1G;
+
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+
+--echo '#------------------FN_DYNVARS_094_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+SET @@global.myisam_max_sort_file_size = 3000;
+SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='myisam_max_sort_file_size';
+
+
+--echo '#------------------FN_DYNVARS_094_07-----------------------#'
+###########################################################################
+#  Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES  #
+###########################################################################
+
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='myisam_max_sort_file_size';
+
+
+--echo '#------------------FN_DYNVARS_094_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.myisam_max_sort_file_size = TRUE;
+SELECT @@global.myisam_max_sort_file_size;
+SET @@global.myisam_max_sort_file_size = FALSE;
+SELECT @@global.myisam_max_sort_file_size;
+
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+#################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+################################################################################# 
+
+
+SET @@global.myisam_max_sort_file_size = 512;
+SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size;
+
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+##################################################################################
+#   Check if myisam_max_sort_file_size can be accessed without @@ sign and scope #
+##################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET myisam_max_sort_file_size = 2048;
+--Error ER_BAD_FIELD_ERROR
+SELECT myisam_max_sort_file_size;
+
+SELECT @@myisam_max_sort_file_size;
+
+#verifying another syntax for setting value#
+SET global myisam_max_sort_file_size = 64;
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.myisam_max_sort_file_size = @start_global_value;
+SELECT @@global.myisam_max_sort_file_size;
+
+########################################################
+#              END OF myisam_max_sort_file_size TESTS  #
+########################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc
new file mode 100644
index 00000000000..8485e79ff03
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc
@@ -0,0 +1,242 @@
+############## mysql-test\t\myisam_repair_threads_basic.test ##################
+#                                                                             #
+# Variable Name: myisam_repair_threads                                        #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 1                                                            #
+# Range:  1-4294967295                                                        #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Sharique Abdullah                                                      #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable myisam_repair_threads    #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+######################################################################
+#           START OF myisam_repair_threads  TESTS                    #
+######################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.myisam_repair_threads;
+SELECT @start_global_value;
+SET @start_session_value = @@session.myisam_repair_threads;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
+#################################################################
+#     Display the DEFAULT value of myisam_block_size            #
+#################################################################
+
+SET @@global.myisam_repair_threads  = 100;
+SET @@global.myisam_repair_threads  = DEFAULT;
+SELECT @@global.myisam_repair_threads ;
+
+SET @@session.myisam_repair_threads  = 200;
+SET @@session.myisam_repair_threads  = DEFAULT;
+SELECT @@session.myisam_repair_threads ;
+
+
+--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
+######################################################################
+#     Check the DEFAULT value of myisam_repair_threads               #
+######################################################################
+
+SET @@global.myisam_repair_threads  = DEFAULT;
+SELECT @@global.myisam_repair_threads  = 1;
+
+SET @@session.myisam_repair_threads  = DEFAULT;
+SELECT @@session.myisam_repair_threads  = 1;
+
+
+--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
+###############################################################################
+# Change the value of myisam_repair_threads  to a valid value for GLOBAL Scope#
+###############################################################################
+
+SET @@global.myisam_repair_threads  = 1;
+SELECT @@global.myisam_repair_threads ;
+
+SET @@global.myisam_repair_threads  = 4294967295;
+SELECT @@global.myisam_repair_threads ;
+
+SET @@global.myisam_repair_threads  = 655354;
+SELECT @@global.myisam_repair_threads ;
+
+
+--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
+###############################################################################
+# Change the value of myisam_repair_threads  to a valid value for SESSION
+# Scope 
+###############################################################################
+ 
+SET @@session.myisam_repair_threads  = 1;
+SELECT @@session.myisam_repair_threads ;
+
+SET @@session.myisam_repair_threads  = 4294967295;
+SELECT @@session.myisam_repair_threads ;
+
+SET @@session.myisam_repair_threads  = 655345;
+SELECT @@session.myisam_repair_threads ;
+
+
+
+
+--echo '#------------------FN_DYNVARS_005_05-----------------------#'
+##################################################################
+# Change the value of myisam_repair_threads  to an invalid value #
+##################################################################
+
+SET @@global.myisam_repair_threads  = 0;
+SELECT @@global.myisam_repair_threads ;
+
+SET @@global.myisam_repair_threads  = -1024;
+SELECT @@global.myisam_repair_threads ;
+
+SET @@global.myisam_repair_threads  = 429496729533;
+SELECT @@global.myisam_repair_threads ;
+
+
+--Error ER_PARSE_ERROR
+SET @@global.myisam_repair_threads  = 65530.34.;
+SELECT @@global.myisam_repair_threads ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_repair_threads  = test;
+SELECT @@global.myisam_repair_threads ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_repair_threads  = "test";
+SELECT @@global.myisam_repair_threads ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_repair_threads  = 'test';
+SELECT @@global.myisam_repair_threads ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_repair_threads  = ON;
+SELECT @@global.myisam_repair_threads ;
+
+
+SET @@session.myisam_repair_threads  = 0;
+SELECT @@session.myisam_repair_threads ;
+
+SET @@session.myisam_repair_threads  = -2;
+SELECT @@session.myisam_repair_threads ;
+
+--Error ER_PARSE_ERROR
+
+SET @@session.myisam_repair_threads  = 65530.34.;
+SELECT @@session.myisam_repair_threads ;
+
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.myisam_repair_threads  = test;
+SELECT @@session.myisam_repair_threads ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.myisam_repair_threads  = "test";
+SELECT @@session.myisam_repair_threads ;
+
+
+--echo '#------------------FN_DYNVARS_005_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.myisam_repair_threads  = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='myisam_repair_threads ';
+
+--echo '#------------------FN_DYNVARS_005_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.myisam_repair_threads  = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='myisam_repair_threads ';
+
+
+--echo '#------------------FN_DYNVARS_005_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.myisam_repair_threads  = TRUE;
+SELECT @@global.myisam_repair_threads ;
+SET @@global.myisam_repair_threads  = FALSE;
+SELECT @@global.myisam_repair_threads ;
+
+
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+###############################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable #
+###############################################################################
+
+SET @@global.myisam_repair_threads  = 10;
+SELECT @@myisam_repair_threads  = @@global.myisam_repair_threads ;
+
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to
+#    same session variable  #
+########################################################################################################
+
+SET @@myisam_repair_threads  = 100;
+SELECT @@myisam_repair_threads  = @@local.myisam_repair_threads ;
+SELECT @@local.myisam_repair_threads  = @@session.myisam_repair_threads ;
+
+
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+###################################################################################  
+#   Check if myisam_repair_threads  can be accessed with and without @@ sign    #
+###################################################################################
+
+SET myisam_repair_threads  = 1;
+SELECT @@myisam_repair_threads ;
+--Error ER_UNKNOWN_TABLE
+
+SELECT local.myisam_repair_threads ;
+
+--Error ER_UNKNOWN_TABLE
+SELECT session.myisam_repair_threads ;
+
+--Error ER_BAD_FIELD_ERROR
+SELECT myisam_repair_threads  = @@session.myisam_repair_threads ;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.myisam_repair_threads  = @start_global_value;
+SELECT @@global.myisam_repair_threads ;
+SET @@session.myisam_repair_threads  = @start_session_value;
+SELECT @@session.myisam_repair_threads ;
+
+
+#############################################################
+#                 END OF myisam_repair_threads  TESTS     #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc
new file mode 100644
index 00000000000..8e36d8a2c70
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc
@@ -0,0 +1,240 @@
+############## mysql-test\t\myisam_sort_buffer_size_basic.test ###############
+#                                                                             #
+# Variable Name: myisam_sort_buffer_size                                     #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                        #
+# Default Value:                                                              #
+# Range:                                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Rizwan                                                     #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable myisam_sort_buffer_size #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+########################################################################
+#           START OF myisam_sort_buffer_size   TESTS                    #
+########################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.myisam_sort_buffer_size ;
+SELECT @start_global_value;
+SET @start_session_value = @@session.myisam_sort_buffer_size ;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
+########################################################################
+#     Display the DEFAULT value of myisam_block_size            #
+########################################################################
+
+SET @@global.myisam_sort_buffer_size   = 100;
+SET @@global.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+SET @@session.myisam_sort_buffer_size   = 200;
+SET @@session.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@session.myisam_sort_buffer_size  ;
+
+
+--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
+########################################################################
+#     Check the DEFAULT value of myisam_sort_buffer_size                #
+########################################################################
+
+SET @@global.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@global.myisam_sort_buffer_size   = 8388608;
+
+SET @@session.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@session.myisam_sort_buffer_size   = 8388608;
+
+
+--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
+##################################################################################
+# Change the value of myisam_sort_buffer_size   to a valid value for GLOBAL Scope #
+##################################################################################
+
+SET @@global.myisam_sort_buffer_size   = 4;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+SET @@global.myisam_sort_buffer_size   = 4294967295;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+SET @@global.myisam_sort_buffer_size   = 655354;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+
+--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
+###################################################################################
+# Change the value of myisam_sort_buffer_size   to a valid value for SESSION Scope #
+###################################################################################
+ 
+SET @@session.myisam_sort_buffer_size   = 4;
+SELECT @@session.myisam_sort_buffer_size  ;
+
+SET @@session.myisam_sort_buffer_size   = 4294967295;
+SELECT @@session.myisam_sort_buffer_size  ;
+
+SET @@session.myisam_sort_buffer_size   = 655345;
+SELECT @@session.myisam_sort_buffer_size  ;
+
+
+
+
+--echo '#------------------FN_DYNVARS_005_05-----------------------#'
+####################################################################
+# Change the value of myisam_sort_buffer_size   to an invalid value #
+####################################################################
+
+SET @@global.myisam_sort_buffer_size   = 0;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+SET @@global.myisam_sort_buffer_size   = -1024;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+SET @@global.myisam_sort_buffer_size   = 429496729533;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+
+--Error ER_PARSE_ERROR
+SET @@global.myisam_sort_buffer_size   = 65530.34.;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_sort_buffer_size   = test;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_sort_buffer_size   = "test";
+SELECT @@global.myisam_sort_buffer_size  ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_sort_buffer_size   = 'test';
+SELECT @@global.myisam_sort_buffer_size  ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.myisam_sort_buffer_size   = ON;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+
+SET @@session.myisam_sort_buffer_size   = 0;
+SELECT @@session.myisam_sort_buffer_size  ;
+
+SET @@session.myisam_sort_buffer_size   = -2;
+SELECT @@session.myisam_sort_buffer_size  ;
+
+--Error ER_PARSE_ERROR
+
+SET @@session.myisam_sort_buffer_size   = 65530.34.;
+SELECT @@session.myisam_sort_buffer_size  ;
+
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.myisam_sort_buffer_size   = test;
+SELECT @@session.myisam_sort_buffer_size  ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.myisam_sort_buffer_size   = "test";
+SELECT @@session.myisam_sort_buffer_size  ;
+
+
+--echo '#------------------FN_DYNVARS_005_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.myisam_sort_buffer_size   = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
+
+--echo '#------------------FN_DYNVARS_005_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.myisam_sort_buffer_size   = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
+
+
+--echo '#------------------FN_DYNVARS_005_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.myisam_sort_buffer_size   = TRUE;
+SELECT @@global.myisam_sort_buffer_size  ;
+SET @@global.myisam_sort_buffer_size   = FALSE;
+SELECT @@global.myisam_sort_buffer_size  ;
+
+
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+#################################################################################### 
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+#################################################################################### 
+
+SET @@global.myisam_sort_buffer_size   = 10;
+SELECT @@myisam_sort_buffer_size   = @@global.myisam_sort_buffer_size  ;
+
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@myisam_sort_buffer_size   = 100;
+SELECT @@myisam_sort_buffer_size   = @@local.myisam_sort_buffer_size  ;
+SELECT @@local.myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
+
+
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+###################################################################################  
+#   Check if myisam_sort_buffer_size   can be accessed with and without @@ sign    #
+###################################################################################
+
+SET myisam_sort_buffer_size   = 1;
+SELECT @@myisam_sort_buffer_size  ;
+--Error ER_UNKNOWN_TABLE
+
+SELECT local.myisam_sort_buffer_size  ;
+
+--Error ER_UNKNOWN_TABLE
+SELECT session.myisam_sort_buffer_size  ;
+
+--Error ER_BAD_FIELD_ERROR
+SELECT myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.myisam_sort_buffer_size   = @start_global_value;
+SELECT @@global.myisam_sort_buffer_size  ;
+SET @@session.myisam_sort_buffer_size   = @start_session_value;
+SELECT @@session.myisam_sort_buffer_size  ;
+
+
+#############################################################
+#                 END OF myisam_sort_buffer_size   TESTS     #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc b/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc
new file mode 100644
index 00000000000..537d8eea6c6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc
@@ -0,0 +1,217 @@
+############## mysql-test\t\net_retry_count_basic.test ###############
+#                                                                             #
+# Variable Name: net_retry_count                                              #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:10                                                            #
+# Range: 1-4294967295                                                         #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable net_retry_count          #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+###############################################################
+#           START OF net_retry_count TESTS                    #
+###############################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.net_retry_count;
+SELECT @start_global_value;
+SET @start_session_value = @@session.net_retry_count;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_111_01-------------------------#'
+###############################################################
+#     Display the DEFAULT value of net_retry_count            #
+###############################################################
+
+SET @@global.net_retry_count = 100;
+SET @@global.net_retry_count = DEFAULT;
+SELECT @@global.net_retry_count;
+
+SET @@session.net_retry_count = 200;
+SET @@session.net_retry_count = DEFAULT;
+SELECT @@session.net_retry_count;
+
+
+--echo '#--------------------FN_DYNVARS_111_02-------------------------#'
+###############################################################
+#     Check the DEFAULT value of net_retry_count              #
+###############################################################
+
+SET @@global.net_retry_count = DEFAULT;
+SELECT @@global.net_retry_count = 10;
+
+SET @@session.net_retry_count = DEFAULT;
+SELECT @@session.net_retry_count = 10;
+
+
+--echo '#--------------------FN_DYNVARS_111_03-------------------------#'
+#########################################################################
+# Change the value of net_retry_count to a valid value for GLOBAL Scope #
+#########################################################################
+
+SET @@global.net_retry_count = 1;
+SELECT @@global.net_retry_count;
+SET @@global.net_retry_count = 2;
+SELECT @@global.net_retry_count;
+SET @@global.net_retry_count = 4294967295;
+SELECT @@global.net_retry_count;
+SET @@global.net_retry_count = 4294967294;
+SELECT @@global.net_retry_count;
+SET @@global.net_retry_count = 65536;
+SELECT @@global.net_retry_count;
+
+--echo '#--------------------FN_DYNVARS_111_04-------------------------#'
+##########################################################################
+# Change the value of net_retry_count to a valid value for SESSION Scope #
+##########################################################################
+ 
+SET @@session.net_retry_count = 1;
+SELECT @@session.net_retry_count;
+SET @@session.net_retry_count = 2;
+SELECT @@session.net_retry_count;
+SET @@session.net_retry_count = 65535;
+SELECT @@session.net_retry_count;
+SET @@session.net_retry_count = 4294967295;
+SELECT @@session.net_retry_count;
+SET @@session.net_retry_count = 4294967294;
+SELECT @@session.net_retry_count;
+
+--echo '#------------------FN_DYNVARS_111_05-----------------------#'
+###########################################################
+# Change the value of net_retry_count to an invalid value #
+###########################################################
+
+SET @@global.net_retry_count = 0;
+SELECT @@global.net_retry_count;
+SET @@global.net_retry_count = -1024;
+SELECT @@global.net_retry_count;
+SET @@global.net_retry_count = 4294967296;
+SELECT @@global.net_retry_count;
+SET @@global.net_retry_count = 429496729500;
+SELECT @@global.net_retry_count;
+--Error ER_PARSE_ERROR
+SET @@global.net_retry_count = 65530.34.;
+SELECT @@global.net_retry_count;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.net_retry_count = test;
+SELECT @@global.net_retry_count;
+
+SET @@session.net_retry_count = 0;
+SELECT @@session.net_retry_count;
+SET @@session.net_retry_count = -2;
+SELECT @@session.net_retry_count;
+--Error ER_PARSE_ERROR
+SET @@session.net_retry_count = 65530.34.;
+SET @@session.net_retry_count = 6555015425;
+SELECT @@session.net_retry_count;
+SET @@session.net_retry_count = 4294967296;
+SELECT @@session.net_retry_count;
+
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.net_retry_count = test;
+SELECT @@session.net_retry_count;
+
+
+--echo '#------------------FN_DYNVARS_111_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.net_retry_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='net_retry_count';
+
+--echo '#------------------FN_DYNVARS_111_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.net_retry_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='net_retry_count';
+
+
+--echo '#------------------FN_DYNVARS_111_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.net_retry_count = TRUE;
+SELECT @@global.net_retry_count;
+SET @@global.net_retry_count = FALSE;
+SELECT @@global.net_retry_count;
+
+
+--echo '#---------------------FN_DYNVARS_111_09----------------------#'
+################################################################################# 
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+################################################################################# 
+
+SET @@global.net_retry_count = 10;
+SELECT @@net_retry_count = @@global.net_retry_count;
+
+
+--echo '#---------------------FN_DYNVARS_111_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@net_retry_count = 100;
+SELECT @@net_retry_count = @@local.net_retry_count;
+SELECT @@local.net_retry_count = @@session.net_retry_count;
+
+
+--echo '#---------------------FN_DYNVARS_111_11----------------------#'
+##########################################################################
+#   Check if net_retry_count can be accessed with and without @@ sign    #
+##########################################################################
+
+SET net_retry_count = 1;
+SELECT @@net_retry_count;
+--Error ER_UNKNOWN_TABLE
+SELECT local.net_retry_count;
+--Error ER_UNKNOWN_TABLE
+SELECT session.net_retry_count;
+--Error ER_BAD_FIELD_ERROR
+SELECT net_retry_count = @@session.net_retry_count;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.net_retry_count = @start_global_value;
+SELECT @@global.net_retry_count;
+SET @@session.net_retry_count = @start_session_value;
+SELECT @@session.net_retry_count;
+
+
+####################################################
+#                 END OF net_retry_count TESTS     #
+####################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc
new file mode 100644
index 00000000000..208fe6b3da4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc
@@ -0,0 +1,225 @@
+############## mysql-test\t\query_alloc_block_size_basic.test ###############
+#                                                                             #
+# Variable Name: query_alloc_block_size                                       #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:  8192                                                        #
+# Range: 1024-4294967295                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable query_alloc_block_size   #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+###################################################################
+#           START OF query_alloc_block_size TESTS                    #
+###################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.query_alloc_block_size;
+SELECT @start_global_value;
+SET @start_session_value = @@session.query_alloc_block_size;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_130_01-------------------------#'
+###################################################################
+#     Display the DEFAULT value of query_alloc_block_size            #
+###################################################################
+
+SET @@global.query_alloc_block_size = 10000;
+SET @@global.query_alloc_block_size = DEFAULT;
+SELECT @@global.query_alloc_block_size;
+
+SET @@session.query_alloc_block_size = 20000;
+SET @@session.query_alloc_block_size = DEFAULT;
+SELECT @@session.query_alloc_block_size;
+
+
+--echo '#--------------------FN_DYNVARS_130_02-------------------------#'
+###################################################################
+#     Check the DEFAULT value of query_alloc_block_size              #
+###################################################################
+
+SET @@global.query_alloc_block_size = DEFAULT;
+SELECT @@global.query_alloc_block_size = 8192;
+
+SET @@session.query_alloc_block_size = DEFAULT;
+SELECT @@session.query_alloc_block_size = 8192;
+
+
+--echo '#--------------------FN_DYNVARS_130_03-------------------------#'
+#############################################################################
+# Change the value of query_alloc_block_size to a valid value for GLOBAL Scope #
+#############################################################################
+
+SET @@global.query_alloc_block_size = 1024;
+SELECT @@global.query_alloc_block_size;
+SET @@global.query_alloc_block_size = 1025;
+SELECT @@global.query_alloc_block_size;
+SET @@global.query_alloc_block_size = 4294967295;
+SELECT @@global.query_alloc_block_size;
+SET @@global.query_alloc_block_size = 4294967294;
+SELECT @@global.query_alloc_block_size;
+SET @@global.query_alloc_block_size = 65536;
+SELECT @@global.query_alloc_block_size;
+
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+
+
+--echo '#--------------------FN_DYNVARS_130_04-------------------------#'
+#################################################################################
+# Change the value of query_alloc_block_size to a valid value for SESSION Scope #
+#################################################################################
+ 
+SET @@session.query_alloc_block_size = 1024;
+SELECT @@session.query_alloc_block_size;
+SET @@session.query_alloc_block_size = 1025;
+SELECT @@session.query_alloc_block_size;
+SET @@session.query_alloc_block_size = 4294967295;
+SELECT @@session.query_alloc_block_size;
+SET @@session.query_alloc_block_size = 4294967294;
+SELECT @@session.query_alloc_block_size;
+SET @@session.query_alloc_block_size = 655536;
+SELECT @@session.query_alloc_block_size;
+
+--echo '#------------------FN_DYNVARS_130_05-----------------------#'
+##################################################################
+# Change the value of query_alloc_block_size to an invalid value #
+##################################################################
+
+SET @@global.query_alloc_block_size = 64;
+SELECT @@global.query_alloc_block_size;
+SET @@global.query_alloc_block_size = -1;
+SELECT @@global.query_alloc_block_size;
+SET @@global.query_alloc_block_size = 1023;
+SELECT @@global.query_alloc_block_size;
+SET @@global.query_alloc_block_size = 4294967296;
+SELECT @@global.query_alloc_block_size;
+--Error ER_PARSE_ERROR
+SET @@global.query_alloc_block_size = 65530.34.;
+SELECT @@global.query_alloc_block_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_alloc_block_size = test;
+SELECT @@global.query_alloc_block_size;
+
+SET @@session.query_alloc_block_size = 64;
+SELECT @@session.query_alloc_block_size;
+SET @@session.query_alloc_block_size = -2;
+SELECT @@session.query_alloc_block_size;
+--Error ER_PARSE_ERROR
+SET @@session.query_alloc_block_size = 65530.34.;
+SET @@session.query_alloc_block_size = 1023;
+SELECT @@session.query_alloc_block_size;
+SET @@session.query_alloc_block_size = 4294967296;
+SELECT @@session.query_alloc_block_size;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.query_alloc_block_size = test;
+SELECT @@session.query_alloc_block_size;
+
+--echo '#------------------FN_DYNVARS_130_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+#SET @@global.query_alloc_block_size = 1;
+#SET @@session.query_alloc_block_size = 12;
+--echo 'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement';
+
+SET @@global.query_alloc_block_size = 1;
+SET @@session.query_alloc_block_size = 12;
+
+SELECT @@global.query_alloc_block_size = 
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_alloc_block_size';
+
+
+--echo '#------------------FN_DYNVARS_130_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.query_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='query_alloc_block_size';
+
+
+--echo '#------------------FN_DYNVARS_130_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.query_alloc_block_size = TRUE;
+SELECT @@global.query_alloc_block_size;
+SET @@global.query_alloc_block_size = FALSE;
+SELECT @@global.query_alloc_block_size;
+
+
+--echo '#---------------------FN_DYNVARS_130_09----------------------#'
+#################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+################################################################################# 
+
+SET @@global.query_alloc_block_size = 2048;
+SELECT @@query_alloc_block_size = @@global.query_alloc_block_size;
+
+
+--echo '#---------------------FN_DYNVARS_130_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@query_alloc_block_size = 5000;
+SELECT @@query_alloc_block_size = @@local.query_alloc_block_size;
+SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size;
+
+
+--echo '#---------------------FN_DYNVARS_130_11----------------------#'
+##############################################################################
+#   Check if query_alloc_block_size can be accessed with and without @@ sign    #
+##############################################################################
+
+SET query_alloc_block_size = 1024;
+SELECT @@query_alloc_block_size;
+--Error ER_UNKNOWN_TABLE
+SELECT local.query_alloc_block_size;
+--Error ER_UNKNOWN_TABLE
+SELECT session.query_alloc_block_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT query_alloc_block_size = @@session.query_alloc_block_size;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.query_alloc_block_size = @start_global_value;
+SELECT @@global.query_alloc_block_size;
+SET @@session.query_alloc_block_size = @start_session_value;
+SELECT @@session.query_alloc_block_size;
+
+
+########################################################
+#              END OF query_alloc_block_size TESTS     #
+########################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc
new file mode 100644
index 00000000000..2eb4a597eef
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc
@@ -0,0 +1,178 @@
+############## mysql-test\t\query_cache_limit_basic.test ###############
+#                                                                             #
+# Variable Name: query_cache_limit                                            #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:  1048576                                                     #
+# Min value:     0                                                            #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable query_cache_limit        #
+#              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_query_cache.inc
+--source include/load_sysvars.inc
+
+######################################################################## 
+#                    START OF query_cache_limit TESTS                  #
+######################################################################## 
+
+
+######################################################################## 
+# Saving initial value of query_cache_limit in a temporary variable    #
+######################################################################## 
+
+SET @start_value = @@global.query_cache_limit;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_131_01------------------------#'
+######################################################################## 
+#              Display the DEFAULT value of query_cache_limit          #
+######################################################################## 
+
+SET @@global.query_cache_limit = 99;
+SET @@global.query_cache_limit = DEFAULT;
+SELECT @@global.query_cache_limit;
+
+
+--echo '#---------------------FN_DYNVARS_131_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.query_cache_limit = @start_value;
+SELECT @@global.query_cache_limit = 1048576;
+
+
+--echo '#--------------------FN_DYNVARS_131_03------------------------#'
+######################################################################## 
+#        Change the value of query_cache_limit to a valid value         #
+######################################################################## 
+
+SET @@global.query_cache_limit = 0;
+SELECT @@global.query_cache_limit;
+SET @@global.query_cache_limit = 1;
+SELECT @@global.query_cache_limit;
+SET @@global.query_cache_limit = 1048576;
+SELECT @@global.query_cache_limit;
+SET @@global.query_cache_limit = 1048575;
+SELECT @@global.query_cache_limit;
+
+
+--echo '#--------------------FN_DYNVARS_131_04-------------------------#'
+########################################################################### 
+#         Change the value of query_cache_limit to invalid value           #
+########################################################################### 
+
+SET @@global.query_cache_limit = -1;
+SELECT @@global.query_cache_limit;
+SET @@global.query_cache_limit = 4294967296;
+SELECT @@global.query_cache_limit;
+SET @@global.query_cache_limit = 10240022115;
+SELECT @@global.query_cache_limit;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_cache_limit = 10000.01;
+SELECT @@global.query_cache_limit;
+SET @@global.query_cache_limit = -1024;
+SELECT @@global.query_cache_limit;
+SET @@global.query_cache_limit = 42949672950;
+SELECT @@global.query_cache_limit;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_cache_limit = ON;
+SELECT @@global.query_cache_limit;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_cache_limit = 'test';
+SELECT @@global.query_cache_limit;
+
+
+--echo '#-------------------FN_DYNVARS_131_05----------------------------#'
+########################################################################### 
+#       Test if accessing session query_cache_limit gives error            #
+########################################################################### 
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.query_cache_limit = 0;
+SELECT @@query_cache_limit;
+
+
+--echo '#----------------------FN_DYNVARS_131_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.query_cache_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_limit';
+
+SELECT @@query_cache_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_limit';
+
+
+--echo '#---------------------FN_DYNVARS_131_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.query_cache_limit = TRUE;
+SELECT @@global.query_cache_limit;
+SET @@global.query_cache_limit = FALSE;
+SELECT @@global.query_cache_limit;
+
+
+--echo '#---------------------FN_DYNVARS_131_08----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@global.query_cache_limit = 1;
+SELECT @@query_cache_limit = @@global.query_cache_limit;
+
+
+--echo '#---------------------FN_DYNVARS_131_09----------------------#'
+##########################################################################  
+#   Check if query_cache_limit can be accessed with and without @@ sign   #
+##########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET query_cache_limit = 1;
+SELECT @@query_cache_limit;
+--Error ER_PARSE_ERROR
+SET local.query_cache_limit = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT local.query_cache_limit;
+--Error ER_PARSE_ERROR
+SET global.query_cache_limit = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT global.query_cache_limit;
+--Error ER_BAD_FIELD_ERROR
+SELECT query_cache_limit = @@session.query_cache_limit;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.query_cache_limit = @start_value;
+SELECT @@global.query_cache_limit;
+
+
+######################################################################## 
+#              END OF query_cache_limit TESTS                           #
+######################################################################## 
diff --git a/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc
new file mode 100644
index 00000000000..1b65e035b18
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc
@@ -0,0 +1,187 @@
+############## mysql-test\t\query_cache_min_res_unit_basic.test ###############
+#                                                                             #
+# Variable Name: query_cache_min_res_unit                                     #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:1024                                                          #
+# Min Value:0                                                                 #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman Rawala                                                      #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable query_cache_min_res_unit #
+#              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_query_cache.inc
+--source include/load_sysvars.inc
+
+########################################################################
+
+
+######################################################################## 
+#             START OF query_cache_min_res_unit TESTS                  #
+######################################################################## 
+
+
+############################################################################### 
+# Saving initial value of query_cache_min_res_unit in a temporary variable    #
+############################################################################### 
+
+SET @start_value = @@global.query_cache_min_res_unit;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_132_01------------------------#'
+############################################################################### 
+#              Display the DEFAULT value of query_cache_min_res_unit          #
+############################################################################### 
+
+SET @@global.query_cache_min_res_unit = 99;
+SET @@global.query_cache_min_res_unit = DEFAULT;
+SELECT @@global.query_cache_min_res_unit;
+
+
+--echo '#---------------------FN_DYNVARS_132_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.query_cache_min_res_unit = @start_value;
+SELECT @@global.query_cache_min_res_unit = 4096;
+
+
+--echo '#--------------------FN_DYNVARS_132_03------------------------#'
+################################################################################ 
+#        Change the value of query_cache_min_res_unit to a valid value         #
+################################################################################ 
+
+SET @@global.query_cache_min_res_unit = 0;
+SELECT @@global.query_cache_min_res_unit;
+SET @@global.query_cache_min_res_unit = 1;
+SELECT @@global.query_cache_min_res_unit;
+--echo 'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512';
+SET @@global.query_cache_min_res_unit = 512;
+SELECT @@global.query_cache_min_res_unit;
+SET @@global.query_cache_min_res_unit = 513;
+SELECT @@global.query_cache_min_res_unit;
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.query_cache_min_res_unit = 1048576;
+SELECT @@global.query_cache_min_res_unit;
+SET @@global.query_cache_min_res_unit = 1048575;
+SELECT @@global.query_cache_min_res_unit;
+
+
+--echo '#--------------------FN_DYNVARS_132_04-------------------------#'
+################################################################################### 
+#         Change the value of query_cache_min_res_unit to invalid value           #
+################################################################################### 
+
+SET @@global.query_cache_min_res_unit = -1;
+SELECT @@global.query_cache_min_res_unit;
+SET @@global.query_cache_min_res_unit = 4294967296;
+SELECT @@global.query_cache_min_res_unit;
+SET @@global.query_cache_min_res_unit = 511;
+SELECT @@global.query_cache_min_res_unit;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_cache_min_res_unit = 10000.01;
+SELECT @@global.query_cache_min_res_unit;
+SET @@global.query_cache_min_res_unit = -1024;
+SELECT @@global.query_cache_min_res_unit;
+SET @@global.query_cache_min_res_unit = 42949672950;
+SELECT @@global.query_cache_min_res_unit;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_cache_min_res_unit = ON;
+SELECT @@global.query_cache_min_res_unit;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_cache_min_res_unit = 'test';
+SELECT @@global.query_cache_min_res_unit;
+
+
+--echo '#-------------------FN_DYNVARS_132_05----------------------------#'
+################################################################################### 
+#       Test if accessing session query_cache_min_res_unit gives error            #
+################################################################################### 
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.query_cache_min_res_unit = 0;
+SELECT @@query_cache_min_res_unit;
+
+
+--echo '#----------------------FN_DYNVARS_132_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_min_res_unit';
+
+SELECT @@query_cache_min_res_unit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_min_res_unit';
+
+
+--echo '#---------------------FN_DYNVARS_132_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.query_cache_min_res_unit = TRUE;
+SELECT @@global.query_cache_min_res_unit;
+SET @@global.query_cache_min_res_unit = FALSE;
+SELECT @@global.query_cache_min_res_unit;
+
+
+--echo '#---------------------FN_DYNVARS_132_08----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@global.query_cache_min_res_unit = 1;
+SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit;
+
+
+--echo '#---------------------FN_DYNVARS_132_09----------------------#'
+##################################################################################  
+#   Check if query_cache_min_res_unit can be accessed with and without @@ sign   #
+##################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET query_cache_min_res_unit = 1;
+SELECT @@query_cache_min_res_unit;
+--Error ER_PARSE_ERROR
+SET local.query_cache_min_res_unit = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT local.query_cache_min_res_unit;
+--Error ER_PARSE_ERROR
+SET global.query_cache_min_res_unit = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT global.query_cache_min_res_unit;
+--Error ER_BAD_FIELD_ERROR
+SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.query_cache_min_res_unit = @start_value;
+SELECT @@global.query_cache_min_res_unit;
+
+
+######################################################################## 
+#              END OF query_cache_min_res_unit TESTS                   #
+######################################################################## 
diff --git a/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc
new file mode 100644
index 00000000000..1a3f9e1efe2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc
@@ -0,0 +1,175 @@
+############## mysql-test\t\query_cache_size_basic.test ###############
+#                                                                             #
+# Variable Name: query_cache_size                                             #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:  0                                                           #
+# Range:     -                                                                #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable query_cache_size         #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/have_query_cache.inc
+--source include/load_sysvars.inc
+
+######################################################################## 
+#             START OF query_cache_size TESTS                  #
+######################################################################## 
+
+
+############################################################################### 
+# Saving initial value of query_cache_size in a temporary variable    #
+############################################################################### 
+
+SET @start_value = @@global.query_cache_size;
+SELECT @start_value;
+
+--echo '#--------------------FN_DYNVARS_133_01------------------------#'
+############################################################################### 
+#              Display the DEFAULT value of query_cache_size          #
+############################################################################### 
+
+SET @@global.query_cache_size = 99;
+SET @@global.query_cache_size = DEFAULT;
+SELECT @@global.query_cache_size;
+
+--echo '#---------------------FN_DYNVARS_133_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.query_cache_size = @start_value;
+SELECT @@global.query_cache_size = 0;
+
+--echo '#--------------------FN_DYNVARS_133_03------------------------#'
+################################################################################ 
+#        Change the value of query_cache_size to a valid value         #
+################################################################################ 
+
+SET @@global.query_cache_size = 0;
+SELECT @@global.query_cache_size;
+SET @@global.query_cache_size = 1;
+SELECT @@global.query_cache_size;
+
+SET @@global.query_cache_size = 512;
+SELECT @@global.query_cache_size;
+SET @@global.query_cache_size = 1024;
+SELECT @@global.query_cache_size;
+--echo : 'Bug#34880: Warnings are coming on assinging valid values to variable
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.query_cache_size = 1048576;
+SELECT @@global.query_cache_size;
+SET @@global.query_cache_size = 1048575;
+SELECT @@global.query_cache_size;
+
+--echo '#--------------------FN_DYNVARS_133_04-------------------------#'
+################################################################################### 
+#         Change the value of query_cache_size to invalid value           #
+################################################################################### 
+
+SET @@global.query_cache_size = -1;
+SELECT @@global.query_cache_size;
+SET @@global.query_cache_size = 4294967296;
+SELECT @@global.query_cache_size;
+SET @@global.query_cache_size = 511;
+SELECT @@global.query_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_cache_size = 10000.01;
+SELECT @@global.query_cache_size;
+SET @@global.query_cache_size = -1024;
+SELECT @@global.query_cache_size;
+SET @@global.query_cache_size = 42949672950;
+SELECT @@global.query_cache_size;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_cache_size = ON;
+SELECT @@global.query_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_cache_size = 'test';
+SELECT @@global.query_cache_size;
+
+--echo '#-------------------FN_DYNVARS_133_05----------------------------#'
+################################################################################### 
+#       Test if accessing session query_cache_size gives error            #
+################################################################################### 
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.query_cache_size = 0;
+SELECT @@query_cache_size;
+
+--echo '#----------------------FN_DYNVARS_133_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.query_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_size';
+
+SELECT @@query_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='query_cache_size';
+
+--echo '#---------------------FN_DYNVARS_133_07----------------------#'
+################################################################### 
+#      Check if TRUE and FALSE values can be used on variable     #
+################################################################### 
+
+SET @@global.query_cache_size = TRUE;
+SELECT @@global.query_cache_size;
+SET @@global.query_cache_size = FALSE;
+SELECT @@global.query_cache_size;
+
+--echo '#---------------------FN_DYNVARS_133_08----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@global.query_cache_size = 1;
+SELECT @@query_cache_size = @@global.query_cache_size;
+
+--echo '#---------------------FN_DYNVARS_133_09----------------------#'
+##################################################################################  
+#   Check if query_cache_size can be accessed with and without @@ sign   #
+##################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET query_cache_size = 1;
+SELECT @@query_cache_size;
+--Error ER_PARSE_ERROR
+SET local.query_cache_size = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT local.query_cache_size;
+--Error ER_PARSE_ERROR
+SET global.query_cache_size = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT global.query_cache_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT query_cache_size = @@session.query_cache_size;
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.query_cache_size = @start_value;
+SELECT @@global.query_cache_size;
+
+######################################################################## 
+#              END OF query_cache_size TESTS                   #
+######################################################################## 
+
diff --git a/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc
new file mode 100644
index 00000000000..3a8608736c5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc
@@ -0,0 +1,241 @@
+################# mysql-test\t\query_prealloc_size_basic.test ##################
+#                                                                              #
+# Variable Name: query_prealloc_size                                           #
+# Scope: GLOBAL | SESSION                                                      #
+# Access Type: Dynamic                                                         #
+# Data Type: numeric                                                           #
+# Default Value:  8192                                                         #
+# Range:  8192-4294967295                                                      #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-02-07                                                    #
+# Author:  Rizwan                                                              #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable query_prealloc_size       #
+#              that checks the behavior of this variable in the following ways #
+#              * Default Value                                                 #
+#              * Valid & Invalid values                                        #
+#              * Scope & Access method                                         #
+#              * Data Integrity                                                #
+#                                                                              #
+# Reference:                                                                   #
+#      http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html     #
+#                                                                              #
+################################################################################
+
+--source include/load_sysvars.inc
+
+########################################################################
+#              START OF query_prealloc_size   TESTS                    #
+########################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.query_prealloc_size ;
+SELECT @start_global_value;
+SET @start_session_value = @@session.query_prealloc_size ;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
+########################################################################
+#            Display the DEFAULT value of myisam_block_size            #
+########################################################################
+
+SET @@global.query_prealloc_size   = 100;
+SET @@global.query_prealloc_size   = DEFAULT;
+SELECT @@global.query_prealloc_size  ;
+
+SET @@session.query_prealloc_size   = 200;
+SET @@session.query_prealloc_size   = DEFAULT;
+SELECT @@session.query_prealloc_size  ;
+
+
+--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
+########################################################################
+#        Check the DEFAULT value of query_prealloc_size                #
+########################################################################
+
+SET @@global.query_prealloc_size   = DEFAULT;
+SELECT @@global.query_prealloc_size   = 8192;
+
+SET @@session.query_prealloc_size   = DEFAULT;
+SELECT @@session.query_prealloc_size   = 8192;
+
+
+--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
+################################################################################
+# Change the value of query_prealloc_size   to a valid value for GLOBAL Scope  #
+################################################################################
+
+SET @@global.query_prealloc_size   = 8192;
+SELECT @@global.query_prealloc_size  ;
+
+SET @@global.query_prealloc_size   = 4294967295;
+SELECT @@global.query_prealloc_size  ;
+
+SET @@global.query_prealloc_size   = 655354;
+SELECT @@global.query_prealloc_size  ;
+
+
+--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
+##################################################################################
+# Change the value of query_prealloc_size   to a valid value for SESSION Scope   #
+##################################################################################
+
+SET @@session.query_prealloc_size   = 8192;
+SELECT @@session.query_prealloc_size  ;
+
+SET @@session.query_prealloc_size   = 4294967295;
+SELECT @@session.query_prealloc_size  ;
+
+SET @@session.query_prealloc_size   = 655345;
+SELECT @@session.query_prealloc_size  ;
+
+
+
+
+--echo '#------------------FN_DYNVARS_005_05-----------------------#'
+####################################################################
+#  Change the value of query_prealloc_size   to an invalid value   #
+####################################################################
+
+SET @@global.query_prealloc_size   = 0;
+SELECT @@global.query_prealloc_size  ;
+
+SET @@global.query_prealloc_size   = -1024;
+SELECT @@global.query_prealloc_size  ;
+
+SET @@global.query_prealloc_size   = 429496729533;
+SELECT @@global.query_prealloc_size  ;
+
+
+--Error ER_PARSE_ERROR
+SET @@global.query_prealloc_size   = 65530.34.;
+SELECT @@global.query_prealloc_size  ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_prealloc_size   = test;
+SELECT @@global.query_prealloc_size  ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_prealloc_size   = "test";
+SELECT @@global.query_prealloc_size  ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_prealloc_size   = 'test';
+SELECT @@global.query_prealloc_size  ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.query_prealloc_size   = ON;
+SELECT @@global.query_prealloc_size  ;
+
+
+SET @@session.query_prealloc_size   = 0;
+SELECT @@session.query_prealloc_size  ;
+
+SET @@session.query_prealloc_size   = -2;
+SELECT @@session.query_prealloc_size  ;
+
+--Error ER_PARSE_ERROR
+
+SET @@session.query_prealloc_size   = 65530.34.;
+SELECT @@session.query_prealloc_size  ;
+
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.query_prealloc_size   = test;
+SELECT @@session.query_prealloc_size  ;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.query_prealloc_size   = "test";
+SELECT @@session.query_prealloc_size  ;
+
+
+--echo '#------------------FN_DYNVARS_005_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.query_prealloc_size   = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='query_prealloc_size  ';
+
+--echo '#------------------FN_DYNVARS_005_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.query_prealloc_size   = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='query_prealloc_size  ';
+
+
+--echo '#------------------FN_DYNVARS_005_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.query_prealloc_size   = TRUE;
+SELECT @@global.query_prealloc_size  ;
+SET @@global.query_prealloc_size   = FALSE;
+SELECT @@global.query_prealloc_size  ;
+
+
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable   #
+################################################################################
+
+SET @@global.query_prealloc_size   = 10;
+SELECT @@query_prealloc_size   = @@global.query_prealloc_size  ;
+
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+##############################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points to #
+# to the same session variable                                               #
+##############################################################################
+
+SET @@query_prealloc_size   = 100;
+SELECT @@query_prealloc_size   = @@local.query_prealloc_size  ;
+SELECT @@local.query_prealloc_size   = @@session.query_prealloc_size  ;
+
+
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+################################################################################
+#    Check if query_prealloc_size   can be accessed with and without @@ sign   #
+################################################################################
+
+SET query_prealloc_size   = 1;
+SELECT @@query_prealloc_size  ;
+--Error ER_UNKNOWN_TABLE
+
+SELECT local.query_prealloc_size  ;
+
+--Error ER_UNKNOWN_TABLE
+SELECT session.query_prealloc_size  ;
+
+--Error ER_BAD_FIELD_ERROR
+SELECT query_prealloc_size   = @@session.query_prealloc_size  ;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.query_prealloc_size   = @start_global_value;
+SELECT @@global.query_prealloc_size  ;
+SET @@session.query_prealloc_size   = @start_session_value;
+SELECT @@session.query_prealloc_size  ;
+
+
+#############################################################
+#                 END OF query_prealloc_size   TESTS        #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc
new file mode 100644
index 00000000000..37692cc8c35
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc
@@ -0,0 +1,208 @@
+############## mysql-test\t\range_alloc_block_size_basic.test ###############
+#                                                                             #
+# Variable Name: range_alloc_block_size                                       #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:2048 	                                                      #
+# Max value: 4294967295                                                       #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable range_alloc_block_size   #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+######################################################################
+#           START OF range_alloc_block_size TESTS                    #
+######################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.range_alloc_block_size;
+SELECT @start_global_value;
+SET @start_session_value = @@session.range_alloc_block_size;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_137_01-------------------------#'
+######################################################################
+#     Display the DEFAULT value of range_alloc_block_size            #
+######################################################################
+
+SET @@global.range_alloc_block_size = 100;
+SET @@global.range_alloc_block_size = DEFAULT;
+SELECT @@global.range_alloc_block_size;
+
+SET @@session.range_alloc_block_size = 200;
+SET @@session.range_alloc_block_size = DEFAULT;
+SELECT @@session.range_alloc_block_size;
+
+
+--echo '#--------------------FN_DYNVARS_137_02-------------------------#'
+######################################################################
+#     Check the DEFAULT value of range_alloc_block_size              #
+######################################################################
+
+SET @@global.range_alloc_block_size = DEFAULT;
+SELECT @@global.range_alloc_block_size = 2048;
+
+SET @@session.range_alloc_block_size = DEFAULT;
+SELECT @@session.range_alloc_block_size = 2048;
+
+
+--echo '#--------------------FN_DYNVARS_137_03-------------------------#'
+################################################################################
+# Change the value of range_alloc_block_size to a valid value for GLOBAL Scope #
+################################################################################
+
+SET @@global.range_alloc_block_size = 2048;
+SELECT @@global.range_alloc_block_size;
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.range_alloc_block_size = 4294967295;
+SELECT @@global.range_alloc_block_size;
+SET @@global.range_alloc_block_size = 4294967294;
+SELECT @@global.range_alloc_block_size;
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+
+
+--echo '#--------------------FN_DYNVARS_137_04-------------------------#'
+###################################################################################
+# Change the value of range_alloc_block_size to a valid value for SESSION Scope #
+###################################################################################
+ 
+SET @@session.range_alloc_block_size = 2048;
+SELECT @@session.range_alloc_block_size;
+SET @@session.range_alloc_block_size = 4294967295;
+SELECT @@session.range_alloc_block_size;
+SET @@session.range_alloc_block_size = 4294967294;
+SELECT @@session.range_alloc_block_size;
+
+
+--echo '#------------------FN_DYNVARS_137_05-----------------------#'
+##################################################################
+# Change the value of range_alloc_block_size to an invalid value #
+##################################################################
+
+SET @@global.range_alloc_block_size = 0;
+SELECT @@global.range_alloc_block_size;
+SET @@global.range_alloc_block_size = -1024;
+SELECT @@global.range_alloc_block_size;
+SET @@global.range_alloc_block_size = 42949672951;
+SELECT @@global.range_alloc_block_size;
+--Error ER_PARSE_ERROR
+SET @@global.range_alloc_block_size = 65530.34.;
+SELECT @@global.range_alloc_block_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.range_alloc_block_size = test;
+SELECT @@global.range_alloc_block_size;
+
+SET @@session.range_alloc_block_size = 0;
+SELECT @@session.range_alloc_block_size;
+SET @@session.range_alloc_block_size = -2;
+SELECT @@session.range_alloc_block_size;
+--Error ER_PARSE_ERROR
+SET @@session.range_alloc_block_size = 65530.34.;
+SET @@session.range_alloc_block_size = 4294967296;
+SELECT @@session.range_alloc_block_size;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.range_alloc_block_size = test;
+SELECT @@session.range_alloc_block_size;
+
+
+--echo '#------------------FN_DYNVARS_137_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.range_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='range_alloc_block_size';
+
+--echo '#------------------FN_DYNVARS_137_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.range_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='range_alloc_block_size';
+
+
+--echo '#------------------FN_DYNVARS_137_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.range_alloc_block_size = TRUE;
+SELECT @@global.range_alloc_block_size;
+SET @@global.range_alloc_block_size = FALSE;
+SELECT @@global.range_alloc_block_size;
+
+
+--echo '#---------------------FN_DYNVARS_137_09----------------------#'
+#################################################################################### 
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+#################################################################################### 
+
+SET @@global.range_alloc_block_size = 10;
+SELECT @@range_alloc_block_size = @@global.range_alloc_block_size;
+
+
+--echo '#---------------------FN_DYNVARS_137_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@range_alloc_block_size = 100;
+SELECT @@range_alloc_block_size = @@local.range_alloc_block_size;
+SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size;
+
+
+--echo '#---------------------FN_DYNVARS_137_11----------------------#'
+###################################################################################  
+#   Check if range_alloc_block_size can be accessed with and without @@ sign    #
+###################################################################################
+
+SET range_alloc_block_size = 1;
+SELECT @@range_alloc_block_size;
+--Error ER_UNKNOWN_TABLE
+SELECT local.range_alloc_block_size;
+--Error ER_UNKNOWN_TABLE
+SELECT session.range_alloc_block_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT range_alloc_block_size = @@session.range_alloc_block_size;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.range_alloc_block_size = @start_global_value;
+SELECT @@global.range_alloc_block_size;
+SET @@session.range_alloc_block_size = @start_session_value;
+SELECT @@session.range_alloc_block_size;
+
+
+#############################################################
+#                 END OF range_alloc_block_size TESTS     #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc b/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc
new file mode 100644
index 00000000000..f9ae3968b31
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc
@@ -0,0 +1,171 @@
+############## mysql-test\t\rpl_recovery_rank_basic.test #######################
+#                                                                              #
+# Variable Name: rpl_recovery_rank                                             #
+# Scope: GLOBAL & SESSION                                                      #
+# Access Type: Dynamic                                                         #
+# Data Type: Numeric                                                           #
+# Default Value: 1                                                             #
+# Range: 1 - 65536                                                             #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-02-07                                                    #
+# Author:  Rizwan Maredia                                                      #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable rpl_recovery_rank         #
+#              that checks the behavior of this variable in the following ways #
+#              * Default Value                                                 #
+#              * Valid & Invalid values                                        #
+#              * Scope & Access method                                         #
+#              * Data Integrity                                                #
+#                                                                              #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
+#  server-system-variables.html                                                #
+#                                                                              #
+################################################################################
+
+--source include/load_sysvars.inc
+
+###################################################################
+#           START OF rpl_recovery_rank TESTS                      #
+###################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.rpl_recovery_rank;
+SELECT @start_global_value;
+
+--echo '#--------------------FN_DYNVARS_142_01-------------------------#'
+###################################################################
+#     Check the DEFAULT value of rpl_recovery_rank               #
+###################################################################
+
+SET @@global.rpl_recovery_rank = 500000;
+SET @@global.rpl_recovery_rank = DEFAULT;
+SELECT @@global.rpl_recovery_rank;
+
+--echo '#--------------------FN_DYNVARS_142_02-------------------------#'
+##################################################################################
+# Change the value of rpl_recovery_rank to a valid value for GLOBAL Scope        #
+##################################################################################
+
+SET @@global.rpl_recovery_rank = 0;
+SELECT @@global.rpl_recovery_rank;
+SET @@global.rpl_recovery_rank = 1024;
+SELECT @@global.rpl_recovery_rank;
+SET @@global.rpl_recovery_rank = 123456789;
+SELECT @@global.rpl_recovery_rank;
+SET @@global.rpl_recovery_rank = 2147483648*2;
+SELECT @@global.rpl_recovery_rank;
+SET @@global.rpl_recovery_rank = 2147483648*1024;
+SELECT @@global.rpl_recovery_rank;
+SELECT @@global.rpl_recovery_rank;
+SET @@global.rpl_recovery_rank = 2147483648*2147483648;
+SELECT @@global.rpl_recovery_rank;
+
+
+--echo '#--------------------FN_DYNVARS_142_03-------------------------#'
+#################################################################################
+#           Check if variable can be access with session scope                  #
+#################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@rpl_recovery_rank = 2;
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.rpl_recovery_rank = 3;
+
+--Error ER_GLOBAL_VARIABLE
+SET @@local.rpl_recovery_rank = 4;
+
+
+
+--echo '#------------------FN_DYNVARS_142_04-----------------------#'
+####################################################################
+# Change the value of rpl_recovery_rank to an invalid value        #
+####################################################################
+
+SET @@global.rpl_recovery_rank = -1;
+SELECT @@global.rpl_recovery_rank;
+SET @@global.rpl_recovery_rank = -2147483648;
+SELECT @@global.rpl_recovery_rank;
+SET @@global.rpl_recovery_rank = -2147483649;
+SELECT @@global.rpl_recovery_rank;
+--Error ER_PARSE_ERROR
+SET @@global.rpl_recovery_rank = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.rpl_recovery_rank = 2147483649.56;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.rpl_recovery_rank = 1G;
+
+
+--echo '#------------------FN_DYNVARS_142_05-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+SET @@global.rpl_recovery_rank = 3000;
+SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='rpl_recovery_rank';
+
+
+--echo '#------------------FN_DYNVARS_142_06-----------------------#'
+###########################################################################
+#  Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES  #
+###########################################################################
+
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='rpl_recovery_rank';
+
+
+--echo '#------------------FN_DYNVARS_142_07-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.rpl_recovery_rank = TRUE;
+SELECT @@global.rpl_recovery_rank;
+SET @@global.rpl_recovery_rank = FALSE;
+SELECT @@global.rpl_recovery_rank;
+
+
+--echo '#---------------------FN_DYNVARS_001_08----------------------#'
+#################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+################################################################################# 
+
+
+SET @@global.rpl_recovery_rank = 512;
+SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
+
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+##################################################################################
+#   Check if rpl_recovery_rank can be accessed without @@ sign and scope         #
+##################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET rpl_recovery_rank = 2048;
+--Error ER_BAD_FIELD_ERROR
+SELECT rpl_recovery_rank;
+
+SELECT @@rpl_recovery_rank;
+
+#verifying another another syntax for setting value
+SET global rpl_recovery_rank = 64;
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.rpl_recovery_rank = @start_global_value;
+SELECT @@global.rpl_recovery_rank;
+
+########################################################
+#              END OF rpl_recovery_rank TESTS          #
+########################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/server_id_basic.inc b/mysql-test/suite/sys_vars/inc/server_id_basic.inc
new file mode 100644
index 00000000000..47afadb5016
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/server_id_basic.inc
@@ -0,0 +1,190 @@
+############## mysql-test\t\server_id_basic.test ################
+#                                                                              #
+# Variable Name: server_id                                                     #
+# Scope: GLOBAL & SESSION                                                      #
+# Access Type: Dynamic                                                         #
+# Data Type: Numeric                                                           #
+# Default Value: 1                                                             #
+# Range: 1 - 65536                                                             #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-02-07                                                    #
+# Author:  Rizwan Maredia                                                      #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable server_id  #
+#              that checks the behavior of this variable in the following ways #
+#              * Default Value                                                 #
+#              * Valid & Invalid values                                        #
+#              * Scope & Access method                                         #
+#              * Data Integrity                                                #
+#                                                                              #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
+#  server-system-variables.html                                                #
+#                                                                              #
+################################################################################
+
+--source include/load_sysvars.inc
+
+###################################################################
+#           START OF server_id TESTS              #
+###################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+let $save_general_log= `SELECT @@global.general_log`;
+SET @@global.general_log= 0;
+SET @start_global_value = @@global.server_id;
+SELECT @start_global_value;
+
+--echo '#--------------------FN_DYNVARS_144_01-------------------------#'
+###################################################################
+#     Display the DEFAULT value of server_id      #
+###################################################################
+
+SET @@global.server_id = 500000;
+SET @@global.server_id = DEFAULT;
+SELECT @@global.server_id;
+
+--echo '#--------------------FN_DYNVARS_144_02-------------------------#'
+###################################################################
+#     Check the DEFAULT value of server_id         #
+###################################################################
+
+SET @@global.server_id = DEFAULT;
+SELECT @@global.server_id = 0;
+
+--echo '#--------------------FN_DYNVARS_144_03-------------------------#'
+##################################################################################
+# Change the value of server_id to a valid value for GLOBAL Scope #
+##################################################################################
+
+SET @@global.server_id = 0;
+SELECT @@global.server_id;
+SET @@global.server_id = 1;
+SELECT @@global.server_id;
+SET @@global.server_id = 15;
+SELECT @@global.server_id;
+SET @@global.server_id = 1024;
+SELECT @@global.server_id;
+SET @@global.server_id = 123456789;
+SELECT @@global.server_id;
+SET @@global.server_id = 2147483648;
+SELECT @@global.server_id;
+SET @@global.server_id = 2147483648*2-1;
+SELECT @@global.server_id;
+
+
+--echo '#--------------------FN_DYNVARS_144_04-------------------------#'
+#################################################################################
+#           Check if variable can be access with session scope                  #
+#################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@server_id = 2;
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.server_id = 3;
+
+--Error ER_GLOBAL_VARIABLE
+SET @@local.server_id = 4;
+
+
+
+--echo '#------------------FN_DYNVARS_144_05-----------------------#'
+####################################################################
+# Change the value of server_id to an invalid value #
+####################################################################
+
+SET @@global.server_id = -1;
+SELECT @@global.server_id;
+
+SET @@global.server_id = -2147483648;
+SELECT @@global.server_id;
+
+SET @@global.server_id = 2147483649*2;
+SELECT @@global.server_id;
+
+--Error ER_PARSE_ERROR
+SET @@global.server_id = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.server_id = '125';
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.server_id = 7483649.56;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.server_id = 1G;
+
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+
+
+--echo '#------------------FN_DYNVARS_144_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+SET @@global.server_id = 3000;
+SELECT @@global.server_id = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='server_id';
+
+
+--echo '#------------------FN_DYNVARS_144_07-----------------------#'
+###########################################################################
+#  Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES  #
+###########################################################################
+
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='server_id';
+
+
+--echo '#------------------FN_DYNVARS_144_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.server_id = TRUE;
+SELECT @@global.server_id;
+SET @@global.server_id = FALSE;
+SELECT @@global.server_id;
+
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+#################################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+################################################################################# 
+
+
+SET @@global.server_id = 512;
+SELECT @@server_id = @@global.server_id;
+
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+##################################################################################
+#   Check if server_id can be accessed without @@ sign and scope #
+##################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET server_id = 2048;
+--Error ER_BAD_FIELD_ERROR
+SELECT server_id;
+
+SELECT @@server_id;
+
+#verifying another another syntax for setting value
+SET global server_id = 99;
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.server_id = @start_global_value;
+SELECT @@global.server_id;
+
+eval SET @@global.general_log= $save_general_log;
+########################################################
+#              END OF server_id TESTS  #
+########################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc b/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc
new file mode 100644
index 00000000000..6bbed3b1982
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc
@@ -0,0 +1,188 @@
+############# mysql-test\t\slave_transaction_retries_basic.test ###############
+#                                                                             #
+# Variable Name: slave_transaction_retries                                    #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 10                                                           #
+# Range:                                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Rizwan                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable slave_transaction_retries#
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+###################################################################
+#           START OF slave_transaction_retries TESTS              #
+###################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.slave_transaction_retries;
+SELECT @start_global_value;
+
+--echo '#--------------------FN_DYNVARS_149_01-------------------------#'
+###################################################################
+#     Display the DEFAULT value of slave_transaction_retries      #
+###################################################################
+
+SET @@global.slave_transaction_retries = 50;
+SET @@global.slave_transaction_retries = DEFAULT;
+SELECT @@global.slave_transaction_retries;
+
+--echo '#--------------------FN_DYNVARS_149_02-------------------------#'
+###################################################################
+#     Check the DEFAULT value of slave_transaction_retries         #
+###################################################################
+
+SET @@global.slave_transaction_retries = DEFAULT;
+SELECT @@global.slave_transaction_retries = 10;
+
+--echo '#--------------------FN_DYNVARS_149_03-------------------------#'
+################################################################################
+# Change the value of slave_transaction_retries to a valid value for
+# GLOBAL Scope 
+################################################################################
+
+SET @@global.slave_transaction_retries = 0;
+SELECT @@global.slave_transaction_retries;
+SET @@global.slave_transaction_retries = 1;
+SELECT @@global.slave_transaction_retries;
+SET @@global.slave_transaction_retries = 15;
+SELECT @@global.slave_transaction_retries;
+SET @@global.slave_transaction_retries = 1024;
+SELECT @@global.slave_transaction_retries;
+SET @@global.slave_transaction_retries = 2147483648;
+SELECT @@global.slave_transaction_retries;
+SET @@global.slave_transaction_retries = 2147483648*2-1;
+SELECT @@global.slave_transaction_retries;
+SET @@global.slave_transaction_retries = 2147483649*2;
+SELECT @@global.slave_transaction_retries;
+SET @@global.slave_transaction_retries = 4294967295;
+SELECT @@global.slave_transaction_retries;
+
+--echo '#--------------------FN_DYNVARS_149_04-------------------------#'
+###############################################################################
+#           Check if variable can be access with session scope                #
+###############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@slave_transaction_retries = 2;
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.slave_transaction_retries = 3;
+
+--Error ER_GLOBAL_VARIABLE
+SET @@local.slave_transaction_retries = 4;
+
+
+
+--echo '#------------------FN_DYNVARS_149_05-----------------------#'
+####################################################################
+# Change the value of slave_transaction_retries to an invalid value#
+####################################################################
+
+SET @@global.slave_transaction_retries = -1;
+SELECT @@global.slave_transaction_retries;
+
+SET @@global.slave_transaction_retries = 2147483649*2147483649;
+SELECT @@global.slave_transaction_retries;
+
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+
+--Error ER_PARSE_ERROR
+SET @@global.slave_transaction_retries = 65530.34.;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_transaction_retries = '100';
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_transaction_retries = 7483649.56;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_transaction_retries = ON;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.slave_transaction_retries = OFF;
+
+--echo '#------------------FN_DYNVARS_149_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+SET @@global.slave_transaction_retries = 3000;
+SELECT @@global.slave_transaction_retries = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='slave_transaction_retries';
+
+
+--echo '#------------------FN_DYNVARS_149_07-----------------------#'
+###########################################################################
+#  Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES  #
+###########################################################################
+
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='slave_transaction_retries';
+
+
+--echo '#------------------FN_DYNVARS_149_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.slave_transaction_retries = TRUE;
+SELECT @@global.slave_transaction_retries;
+SET @@global.slave_transaction_retries = FALSE;
+SELECT @@global.slave_transaction_retries;
+
+
+--echo '#---------------------FN_DYNVARS_149_09----------------------#'
+###############################################################################
+#  Check if accessing variable with and without GLOBAL point to same variable #
+###############################################################################
+
+
+SET @@global.slave_transaction_retries = 60*60;
+SELECT @@slave_transaction_retries = @@global.slave_transaction_retries;
+
+
+--echo '#---------------------FN_DYNVARS_149_10----------------------#'
+###############################################################################
+#   Check if slave_transaction_retries can be accessed without @@ sign
+#   and scope 
+###############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET slave_transaction_retries = 2048;
+--Error ER_BAD_FIELD_ERROR
+SELECT slave_transaction_retries;
+
+SELECT @@slave_transaction_retries;
+
+#verifying another another syntax for setting value
+SET global slave_transaction_retries = 99;
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.slave_transaction_retries = @start_global_value;
+SELECT @@global.slave_transaction_retries;
+
+########################################################
+#              END OF slave_transaction_retries TESTS  #
+########################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
new file mode 100644
index 00000000000..4dbae7c8847
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc
@@ -0,0 +1,213 @@
+############## mysql-test\t\sort_buffer_size_basic.test #######################
+#                                                                             #
+# Variable Name: sort_buffer_size                                             #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 2097144                                                      #
+# Range:max value:4294967295                                                  #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable sort_buffer_size         #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+########################################################################
+
+
+######################################################################
+#           START OF sort_buffer_size TESTS                    #
+######################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+# due to difference when running on Windows (bug filed)
+--source include/not_windows.inc
+
+SET @start_global_value = @@global.sort_buffer_size;
+SELECT @start_global_value;
+SET @start_session_value = @@session.sort_buffer_size;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_151_01-------------------------#'
+######################################################################
+#     Display the DEFAULT value of sort_buffer_size            #
+######################################################################
+
+SET @@global.sort_buffer_size = 1000;
+SET @@global.sort_buffer_size = DEFAULT;
+SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
+
+SET @@session.sort_buffer_size = 2000;
+SET @@session.sort_buffer_size = DEFAULT;
+SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
+
+
+--echo '#--------------------FN_DYNVARS_151_02-------------------------#'
+######################################################################
+#     Check the DEFAULT value of sort_buffer_size              #
+######################################################################
+
+SET @@global.sort_buffer_size = DEFAULT;
+SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
+
+SET @@session.sort_buffer_size = DEFAULT;
+SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
+
+
+--echo '#--------------------FN_DYNVARS_151_03-------------------------#'
+################################################################################
+# Change the value of sort_buffer_size to a valid value for GLOBAL Scope #
+################################################################################
+
+SET @@global.sort_buffer_size = 32776;
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+SET @@global.sort_buffer_size = 32777;
+SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
+SET @@global.sort_buffer_size = 4294967295;
+SELECT @@global.sort_buffer_size;
+SET @@global.sort_buffer_size = 4294967294;
+SELECT @@global.sort_buffer_size;
+--echo 'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
+
+--echo '#--------------------FN_DYNVARS_151_04-------------------------#'
+###################################################################################
+# Change the value of sort_buffer_size to a valid value for SESSION Scope #
+###################################################################################
+ 
+SET @@session.sort_buffer_size = 32776;
+SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+SET @@session.sort_buffer_size = 32777;
+SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
+SET @@session.sort_buffer_size = 4294967295;
+SELECT @@session.sort_buffer_size;
+SET @@session.sort_buffer_size = 4294967294;
+SELECT @@session.sort_buffer_size;
+
+
+--echo '#------------------FN_DYNVARS_151_05-----------------------#'
+##################################################################
+# Change the value of sort_buffer_size to an invalid value #
+##################################################################
+
+SET @@global.sort_buffer_size = 32775;
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+SET @@global.sort_buffer_size = -1024;
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+SET @@global.sort_buffer_size = 4294967296;
+SELECT @@global.sort_buffer_size;
+--Error ER_PARSE_ERROR
+SET @@global.sort_buffer_size = 65530.34.;
+SELECT @@global.sort_buffer_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.sort_buffer_size = test;
+SELECT @@global.sort_buffer_size;
+
+SET @@session.sort_buffer_size = 32775;
+SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+SET @@session.sort_buffer_size = -2;
+SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+--Error ER_PARSE_ERROR
+SET @@session.sort_buffer_size = 65530.34.;
+SET @@session.sort_buffer_size = 4294967296;
+SELECT @@session.sort_buffer_size;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.sort_buffer_size = test;
+SELECT @@session.sort_buffer_size;
+
+
+--echo '#------------------FN_DYNVARS_151_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+
+--echo '#------------------FN_DYNVARS_151_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+
+
+--echo '#------------------FN_DYNVARS_151_08-----------------------#'
+####################################################################
+#     Check if TRUE and FALSE values can be used on variable       #
+####################################################################
+
+SET @@global.sort_buffer_size = TRUE;
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+SET @@global.sort_buffer_size = FALSE;
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+echo 'Bug: Errors should be displayed on assigning TRUE/FALSE to variable';
+
+
+--echo '#---------------------FN_DYNVARS_151_09----------------------#'
+#################################################################################### 
+#  Check if accessing variable with and without GLOBAL point to same variable   #
+#################################################################################### 
+
+SET @@global.sort_buffer_size = 9000;
+SELECT @@sort_buffer_size = @@global.sort_buffer_size;
+
+
+--echo '#---------------------FN_DYNVARS_151_10----------------------#'
+########################################################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
+########################################################################################################
+
+SET @@sort_buffer_size = 9000;
+SELECT @@sort_buffer_size = @@local.sort_buffer_size;
+SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
+
+
+--echo '#---------------------FN_DYNVARS_151_11----------------------#'
+###################################################################################  
+#   Check if sort_buffer_size can be accessed with and without @@ sign    #
+###################################################################################
+
+SET sort_buffer_size = 9100;
+SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
+SELECT @@sort_buffer_size;
+--Error ER_UNKNOWN_TABLE
+SELECT local.sort_buffer_size;
+--Error ER_UNKNOWN_TABLE
+SELECT session.sort_buffer_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT sort_buffer_size = @@session.sort_buffer_size;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.sort_buffer_size = @start_global_value;
+SELECT @@global.sort_buffer_size;
+SET @@session.sort_buffer_size = @start_session_value;
+SELECT @@session.sort_buffer_size;
+
+
+#############################################################
+#                 END OF sort_buffer_size TESTS     #
+#############################################################
diff --git a/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc b/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc
new file mode 100644
index 00000000000..b66509bbb5e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc
@@ -0,0 +1,156 @@
+#################### mysql-test\t\sync_binlog_basic.test ######################
+#                                                                             #
+# Variable Name: sync_binlog                                                  #
+# Scope: GLOBAL                                                               #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 0                                                            #
+# Range: 0 - 4294967295                                                       #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Salman Rawala                                                      #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable sync_binlog              #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+##################################################################
+#                    START OF sync_binlog TESTS                  #
+##################################################################
+
+
+##################################################################
+# Saving initial value of sync_binlog in a temporary variable    #
+##################################################################
+
+SET @start_value = @@global.sync_binlog;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_168_01------------------------#'
+##################################################################
+#              Display the DEFAULT value of sync_binlog          #
+################################################################## 
+
+SET @@global.sync_binlog = 99;
+SET @@global.sync_binlog = DEFAULT;
+SELECT @@global.sync_binlog;
+
+
+--echo '#---------------------FN_DYNVARS_168_02-------------------------#'
+############################################### 
+#     Verify default value of variable        #
+############################################### 
+
+SET @@global.sync_binlog = @start_value;
+SELECT @@global.sync_binlog = 0;
+
+
+--echo '#--------------------FN_DYNVARS_168_03------------------------#'
+###################################################################
+#        Change the value of sync_binlog to a valid value         #
+###################################################################
+
+SET @@global.sync_binlog = 0;
+SELECT @@global.sync_binlog;
+SET @@global.sync_binlog = 1;
+SELECT @@global.sync_binlog;
+SET @@global.sync_binlog = 4294967295;
+SELECT @@global.sync_binlog;
+SET @@global.sync_binlog = 4294967294;
+SELECT @@global.sync_binlog;
+SET @@global.sync_binlog = 65536;
+SELECT @@global.sync_binlog;
+
+
+--echo '#--------------------FN_DYNVARS_168_04-------------------------#'
+######################################################################
+#         Change the value of sync_binlog to invalid value           #
+######################################################################
+
+SET @@global.sync_binlog = -1;
+SELECT @@global.sync_binlog;
+SET @@global.sync_binlog = 4294967296;
+SELECT @@global.sync_binlog;
+SET @@global.sync_binlog = 10240022115;
+SELECT @@global.sync_binlog;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.sync_binlog = 10000.01;
+SELECT @@global.sync_binlog;
+SET @@global.sync_binlog = -1024;
+SELECT @@global.sync_binlog;
+SET @@global.sync_binlog = 42949672950;
+SELECT @@global.sync_binlog;
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.sync_binlog = ON;
+SELECT @@global.sync_binlog;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.sync_binlog = 'test';
+SELECT @@global.sync_binlog;
+
+
+--echo '#-------------------FN_DYNVARS_168_05----------------------------#'
+########################################################################### 
+#       Test if accessing session sync_binlog gives error            #
+########################################################################### 
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.sync_binlog = 0;
+SELECT @@sync_binlog;
+
+
+--echo '#----------------------FN_DYNVARS_168_06------------------------#'
+############################################################################## 
+# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
+##############################################################################
+
+SELECT @@global.sync_binlog = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='sync_binlog';
+
+
+
+--echo '#---------------------FN_DYNVARS_168_07----------------------#'
+##########################################################################  
+#   Check if sync_binlog can be accessed with and without @@ sign   #
+##########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET sync_binlog = 1;
+SELECT @@sync_binlog;
+--Error ER_PARSE_ERROR
+SET local.sync_binlog = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT local.sync_binlog;
+--Error ER_PARSE_ERROR
+SET global.sync_binlog = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT global.sync_binlog;
+--Error ER_BAD_FIELD_ERROR
+SELECT sync_binlog = @@session.sync_binlog;
+
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@global.sync_binlog = @start_value;
+SELECT @@global.sync_binlog;
+
+
+######################################################################## 
+#              END OF sync_binlog TESTS                           #
+######################################################################## 
diff --git a/mysql-test/suite/sys_vars/inc/timestamp_basic.inc b/mysql-test/suite/sys_vars/inc/timestamp_basic.inc
new file mode 100644
index 00000000000..d7ad620ec26
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/timestamp_basic.inc
@@ -0,0 +1,162 @@
+################## mysql-test\t\timestamp_basic.test ##########################
+#                                                                             #
+# Variable Name: timestamp                                                    #
+# Scope: SESSION                                                              #
+# Access Type: Dynamic                                                        #
+# Data Type: string                                                           #
+# Default Value:                                                              #
+# Range:                                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Rizwan                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable timestamp                #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+#######################################################################
+#                    START OF timestamp TESTS                         #
+#######################################################################
+
+
+#######################################################################
+#      Saving initial value of timestamp in a temporary variable      #
+#######################################################################
+
+SET @session_start_value = @@session.timestamp;
+
+--echo '#--------------------FN_DYNVARS_001_01------------------------#'
+########################################################################
+#                    Display the DEFAULT value of timestamp            #
+########################################################################
+
+
+SET @@timestamp = DEFAULT;
+#SELECT @@timestamp;
+
+--echo 'timestamp does not have any DEFAULT value'
+
+--echo '#---------------------FN_DYNVARS_001_02-------------------------#'
+##############################################################
+#     see if accessable using global scope                   #
+##############################################################
+
+--Error ER_LOCAL_VARIABLE
+SET @@global.timestamp = "1000";
+
+
+--echo '#--------------------FN_DYNVARS_001_03------------------------#'
+######################################################################## 
+#              Change the value of timestamp to a valid value          #
+######################################################################## 
+
+SET @@timestamp = 0;
+#SELECT @@timestamp;
+
+--echo 'Setting 0 resets timestamp to session default timestamp'
+
+SET @@timestamp = 123456789123456;
+SELECT @@timestamp;
+SET @@timestamp = 60*60*60*60*365;
+SELECT @@timestamp;
+SET @@timestamp = -1000000000;
+SELECT @@timestamp;
+
+SET @temp_ts = @@timestamp - @@timestamp;
+SELECT @temp_ts;
+
+--echo '#--------------------FN_DYNVARS_001_04-------------------------#'
+########################################################################### 
+#               Change the value of timestamp to invalid value            #
+########################################################################### 
+
+# for session scope
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@timestamp = "100";
+--echo 'Bug# 34836: Documentation says its a string variable but infact its numeric'
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@timestamp = " ";
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@timestamp = 1.1;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@timestamp = 9999999999999999999999;
+
+
+
+--echo '#----------------------FN_DYNVARS_001_06------------------------#'
+######################################################################### 
+#     Check if the value in SESSION Table matches value in variable     #
+#########################################################################
+
+SELECT @@timestamp = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='timestamp';
+
+--echo '#---------------------FN_DYNVARS_001_08-------------------------#'
+############################################################################# 
+#        Check if ON, OFF, TRUE and FALSE values can be used on variable    #
+############################################################################# 
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@timestamp = OFF;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@timestamp = ON;
+
+SET @@timestamp = TRUE;
+SELECT @@timestamp;
+
+SET @@timestamp = FALSE;
+#SELECT @@timestamp;
+
+
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+#############################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE points
+#    to same session variable
+#############################################################################
+
+SET @@timestamp = 123456;
+SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
+SET @@timestamp = 654321;
+SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
+
+
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+#####################################################################  
+#   Check if timestamp can be accessed with and without @@ sign    #
+#####################################################################
+
+SET timestamp = 1;
+SELECT @@timestamp;
+--Error ER_UNKNOWN_TABLE
+SELECT local.timestamp;
+--Error ER_UNKNOWN_TABLE
+SELECT session.timestamp;
+--Error ER_BAD_FIELD_ERROR
+SELECT timestamp = @@session.timestamp;
+
+##############################  
+#   Restore initial value    #
+##############################
+
+SET @@timestamp = @session_start_value;
+
+#######################################################################
+#                    END OF timestamp TESTS                           #
+#######################################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc b/mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc
new file mode 100644
index 00000000000..7f69bcd1f8c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc
@@ -0,0 +1,233 @@
+############## mysql-test\t\tmp_table_size_basic.test #########################
+#                                                                             #
+# Variable Name: tmp_table_size                                               #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 33554432                                                     #
+# Range: 1024-4294967295                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-13                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable tmp_table_size           #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html#option_mysqld_tmp_table_size                  #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+##############################################################
+#           START OF tmp_table_size TESTS                    #
+##############################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.tmp_table_size;
+SELECT @start_global_value;
+SET @start_session_value = @@session.tmp_table_size;
+SELECT @start_session_value;
+
+--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
+
+--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
+##############################################################
+#     Display the DEFAULT value of tmp_table_size            #
+##############################################################
+
+SET @@global.tmp_table_size = 100;
+SET @@global.tmp_table_size = DEFAULT;
+SELECT @@global.tmp_table_size;
+
+--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
+SET @@session.tmp_table_size = 200;
+SET @@session.tmp_table_size = DEFAULT;
+SELECT @@session.tmp_table_size;
+--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
+
+
+--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
+########################################################################
+#     Check the DEFAULT value of tmp_table_size              #
+########################################################################
+
+SET @@global.tmp_table_size = DEFAULT;
+SELECT @@global.tmp_table_size = 33554432;
+
+SET @@session.tmp_table_size = DEFAULT;
+SELECT @@session.tmp_table_size = 33554432;
+
+--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
+
+--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
+########################################################################
+# Change the value of tmp_table_size to a valid value for GLOBAL Scope #
+########################################################################
+
+SET @@global.tmp_table_size = 1024;
+SELECT @@global.tmp_table_size;
+SET @@global.tmp_table_size = 60020;
+SELECT @@global.tmp_table_size;
+SET @@global.tmp_table_size = 4294967295;
+SELECT @@global.tmp_table_size;
+
+
+--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
+#########################################################################
+# Change the value of tmp_table_size to a valid value for SESSION Scope #
+#########################################################################
+ 
+SET @@session.tmp_table_size = 1024;
+SELECT @@session.tmp_table_size;
+
+SET @@session.tmp_table_size =4294967295;
+SELECT @@session.tmp_table_size;
+SET @@session.tmp_table_size = 65535;
+SELECT @@session.tmp_table_size;
+
+
+--echo '#------------------FN_DYNVARS_005_05-----------------------#'
+##########################################################
+# Change the value of tmp_table_size to an invalid value #
+##########################################################
+
+SET @@global.tmp_table_size = 0;
+SELECT @@global.tmp_table_size;
+
+SET @@global.tmp_table_size = -1024;
+SELECT @@global.tmp_table_size;
+
+SET @@global.tmp_table_size = 1000;
+SELECT @@global.tmp_table_size;
+
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.tmp_table_size = ON;
+
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.tmp_table_size = OFF;
+
+
+SET @@global.tmp_table_size = True;
+SELECT @@global.tmp_table_size;
+
+SET @@global.tmp_table_size = False;
+SELECT @@global.tmp_table_size;
+--echo 'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
+
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.tmp_table_size = 65530.34;
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.tmp_table_size ="Test";
+
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.tmp_table_size = ON;
+
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.tmp_table_size = OFF;
+
+SET @@session.tmp_table_size = True;
+SELECT @@session.tmp_table_size;
+
+SET @@session.tmp_table_size = False;
+SELECT @@session.tmp_table_size;
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.tmp_table_size = "Test";
+
+SET @@session.tmp_table_size = 12345678901;
+SELECT @@session.tmp_table_size;
+
+
+--echo '#------------------FN_DYNVARS_005_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.tmp_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='tmp_table_size';
+
+--echo '#------------------FN_DYNVARS_005_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.tmp_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='tmp_table_size';
+
+
+
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+########################################################################
+#  Check if global and session variables are independent of each other #
+########################################################################
+
+SET @@global.tmp_table_size = 1024;
+SET @@tmp_table_size = 4294967295;
+SELECT @@tmp_table_size = @@global.tmp_table_size;
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+##################################################################
+#    Check if accessing variable with SESSION,LOCAL and without  #
+#    SCOPE points to same session variable                       #
+##################################################################
+
+SET @@tmp_table_size = 100;
+SELECT @@tmp_table_size = @@local.tmp_table_size;
+SELECT @@local.tmp_table_size = @@session.tmp_table_size;
+
+
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+#########################################################################
+#   Check if tmp_table_size can be accessed with and without @@ sign    #
+#########################################################################
+
+SET tmp_table_size = 1027;
+SELECT @@tmp_table_size;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.tmp_table_size;
+
+--Error ER_UNKNOWN_TABLE
+SELECT global.tmp_table_size;
+
+--Error ER_BAD_FIELD_ERROR
+SELECT tmp_table_size = @@session.tmp_table_size;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.tmp_table_size = @start_global_value;
+SELECT @@global.tmp_table_size;
+SET @@session.tmp_table_size = @start_session_value;
+SELECT @@session.tmp_table_size;
+
+
+###################################################
+#                 END OF tmp_table_size TESTS     #
+###################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
new file mode 100644
index 00000000000..c14383b86c6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
@@ -0,0 +1,240 @@
+############## mysql-test\t\transaction_alloc_block_size_basic.test ###########
+#                                                                             #
+# Variable Name: transaction_alloc_block_size                                 #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 8192                                                         #
+# Range: 1024-4294967295                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-14                                                   #
+# Author:  Salman                                                             #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable                          #
+#              transaction_alloc_block_size                                   #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html                                               #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+########################################################################
+#           START OF transaction_alloc_block_size TESTS                #
+########################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.transaction_alloc_block_size;
+SELECT @start_global_value;
+SET @start_session_value = @@session.transaction_alloc_block_size;
+SELECT @start_session_value;
+
+
+--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
+########################################################################
+#     Display the DEFAULT value of transaction_alloc_block_size        #
+########################################################################
+
+SET @@global.transaction_alloc_block_size = 100;
+SET @@global.transaction_alloc_block_size = DEFAULT;
+SELECT @@global.transaction_alloc_block_size;
+
+
+SET @@session.transaction_alloc_block_size = 200;
+SET @@session.transaction_alloc_block_size = DEFAULT;
+SELECT @@session.transaction_alloc_block_size;
+
+
+
+--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
+########################################################################
+#     Check the DEFAULT value of transaction_alloc_block_size          #
+########################################################################
+
+SET @@global.transaction_alloc_block_size = DEFAULT;
+SELECT @@global.transaction_alloc_block_size = 8192;
+
+SET @@session.transaction_alloc_block_size = DEFAULT;
+SELECT @@session.transaction_alloc_block_size = 8192;
+
+
+--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
+##################################################################
+# Change the value of variable to a valid value for GLOBAL Scope #
+##################################################################
+
+SET @@global.transaction_alloc_block_size = 1024;
+SELECT @@global.transaction_alloc_block_size;
+
+SET @@global.transaction_alloc_block_size = 60020;
+SELECT @@global.transaction_alloc_block_size;
+
+SET @@global.transaction_alloc_block_size = 4294967295;
+SELECT @@global.transaction_alloc_block_size;
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+
+--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
+###################################################################
+# Change the value of variable to a valid value for SESSION Scope #
+###################################################################
+ 
+SET @@session.transaction_alloc_block_size = 1024;
+SELECT @@session.transaction_alloc_block_size;
+
+SET @@session.transaction_alloc_block_size =4294967295;
+SELECT @@session.transaction_alloc_block_size;
+
+SET @@session.transaction_alloc_block_size = 65535;
+SELECT @@session.transaction_alloc_block_size;
+--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+
+
+--echo '#------------------FN_DYNVARS_005_05-----------------------#'
+########################################################################
+# Change the value of transaction_alloc_block_size to an invalid value #
+########################################################################
+
+SET @@global.transaction_alloc_block_size = 0;
+SELECT @@global.transaction_alloc_block_size;
+
+SET @@global.transaction_alloc_block_size = -1024;
+SELECT @@global.transaction_alloc_block_size;
+
+
+SET @@global.transaction_alloc_block_size = 123456789201;
+SELECT @@global.transaction_alloc_block_size;
+
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.transaction_alloc_block_size = ON;
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.transaction_alloc_block_size = OFF;
+
+
+SET @@global.transaction_alloc_block_size = True;
+SELECT @@global.transaction_alloc_block_size;
+
+SET @@global.transaction_alloc_block_size = False;
+SELECT @@global.transaction_alloc_block_size;
+
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.transaction_alloc_block_size = 65530.34;
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.transaction_alloc_block_size ="Test";
+
+SET @@global.transaction_alloc_block_size = 1000;
+SELECT @@global.transaction_alloc_block_size;
+
+SET @@session.transaction_alloc_block_size = 12345678901;
+SELECT @@session.transaction_alloc_block_size;
+
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.transaction_alloc_block_size = ON;
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.transaction_alloc_block_size = OFF;
+
+SET @@session.transaction_alloc_block_size = True;
+SELECT @@session.transaction_alloc_block_size;
+
+SET @@session.transaction_alloc_block_size = False;
+SELECT @@session.transaction_alloc_block_size;
+
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.transaction_alloc_block_size = "Test";
+
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.transaction_alloc_block_size = 'test';
+
+--echo '#------------------FN_DYNVARS_005_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='transaction_alloc_block_size';
+
+--echo '#------------------FN_DYNVARS_005_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='transaction_alloc_block_size';
+
+
+--echo '#---------------------FN_DYNVARS_001_08----------------------#'
+###########################################################################
+#  Check if global and session variable are independent of each other     #
+###########################################################################
+
+SET @@transaction_alloc_block_size = 1024;
+SET @@global.transaction_alloc_block_size = 4294967295;
+SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
+ 
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+########################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE  #
+#    points to same session variable                                   #
+########################################################################
+
+SET @@transaction_alloc_block_size = 100;
+SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size;
+SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size;
+
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+################################################################
+#   Check if variable can be accessed with and without @@ sign #
+################################################################
+
+SET transaction_alloc_block_size = 1027;
+SELECT @@transaction_alloc_block_size;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.transaction_alloc_block_size;
+
+--Error ER_UNKNOWN_TABLE
+SELECT session.transaction_alloc_block_size;
+
+--Error ER_BAD_FIELD_ERROR
+SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.transaction_alloc_block_size = @start_global_value;
+SELECT @@global.transaction_alloc_block_size;
+SET @@session.tmp_table_size = @start_session_value;
+SELECT @@session.transaction_alloc_block_size;
+
+
+#############################################################
+#             END OF transaction_alloc_block_size TESTS     #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc b/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc
new file mode 100644
index 00000000000..1ca302a19e0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc
@@ -0,0 +1,229 @@
+############## mysql-test\t\transaction_prealloc_size_basic.test ##############
+#                                                                             #
+# Variable Name: transaction_prealloc_size                                    #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value: 4096                                                         #
+# Range:                                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-14                                                   #
+# Author: Sharique Abdullah                                                       #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable transaction_prealloc_size#
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html#option_mysqld_transaction_prealloc_size       #
+#                                                                             #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+########################################################################
+#           START OF transaction_prealloc_size TESTS                   #
+########################################################################
+
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.transaction_prealloc_size;
+SELECT @start_global_value;
+SET @start_session_value = @@session.transaction_prealloc_size;
+SELECT @start_session_value;
+
+--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
+
+--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
+########################################################################
+#     Display the DEFAULT value of transaction_prealloc_size           #
+########################################################################
+
+SET @@global.transaction_prealloc_size = 100;
+SET @@global.transaction_prealloc_size = DEFAULT;
+SELECT @@global.transaction_prealloc_size;
+
+
+SET @@session.transaction_prealloc_size = 200;
+SET @@session.transaction_prealloc_size = DEFAULT;
+SELECT @@session.transaction_prealloc_size;
+
+--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
+########################################################################
+#     Check the DEFAULT value of transaction_prealloc_size             #
+########################################################################
+
+SET @@global.transaction_prealloc_size = DEFAULT;
+SELECT @@global.transaction_prealloc_size = 4096;
+
+SET @@session.transaction_prealloc_size = DEFAULT;
+SELECT @@session.transaction_prealloc_size = 4096;
+
+--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
+##################################################################
+# Change the value of variable to a valid value for GLOBAL Scope #
+##################################################################
+
+SET @@global.transaction_prealloc_size = 1024;
+SELECT @@global.transaction_prealloc_size;
+
+SET @@global.transaction_prealloc_size = 60020;
+SELECT @@global.transaction_prealloc_size;
+
+SET @@global.transaction_prealloc_size = 4294966272;
+SELECT @@global.transaction_prealloc_size;
+
+
+--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
+###################################################################
+# Change the value of variable to a valid value for SESSION Scope #
+###################################################################
+ 
+SET @@session.transaction_prealloc_size = 1024;
+SELECT @@session.transaction_prealloc_size;
+
+SET @@session.transaction_prealloc_size =4294966272;
+SELECT @@session.transaction_prealloc_size;
+SET @@session.transaction_prealloc_size = 65535;
+SELECT @@session.transaction_prealloc_size;
+
+
+--echo '#------------------FN_DYNVARS_005_05-----------------------#'
+#####################################################################
+# Change the value of transaction_prealloc_size to an invalid value #
+#####################################################################
+
+SET @@global.transaction_prealloc_size = 0;
+SELECT @@global.transaction_prealloc_size;
+
+SET @@global.transaction_prealloc_size = -1024;
+SELECT @@global.transaction_prealloc_size;
+
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.transaction_prealloc_size = ON;
+
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.transaction_prealloc_size = OFF;
+
+
+SET @@global.transaction_prealloc_size = True;
+SELECT @@global.transaction_prealloc_size;
+
+SET @@global.transaction_prealloc_size = False;
+SELECT @@global.transaction_prealloc_size;
+
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.transaction_prealloc_size = 65530.34;
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.transaction_prealloc_size ="Test";
+
+SET @@global.transaction_prealloc_size = 1000;
+SELECT @@global.transaction_prealloc_size;
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.transaction_prealloc_size = ON;
+
+
+-- Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.transaction_prealloc_size = OFF;
+
+SET @@session.transaction_prealloc_size = True;
+SELECT @@session.transaction_prealloc_size;
+
+SET @@session.transaction_prealloc_size = False;
+SELECT @@session.transaction_prealloc_size;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.transaction_prealloc_size = "Test";
+
+SET @@session.transaction_prealloc_size = 123456789031;
+SELECT @@session.transaction_prealloc_size;
+
+
+--echo '#------------------FN_DYNVARS_005_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+
+SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='transaction_prealloc_size';
+
+--echo '#------------------FN_DYNVARS_005_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='transaction_prealloc_size';
+
+
+
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+###########################################################################
+#  Check if global and session variable are independent of each other     #
+###########################################################################
+
+SET @@global.transaction_prealloc_size = 1024;
+SET @@global.transaction_prealloc_size = 10;
+
+SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
+ 
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+########################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE  #
+#    points to same session variable                                   #
+########################################################################
+
+SET @@transaction_prealloc_size = 100;
+SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size;
+SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size;
+
+
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+###############################################################################
+# Check if transaction_prealloc_size can be accessed with and without @@ sign #
+###############################################################################
+
+SET transaction_prealloc_size = 1027;
+SELECT @@transaction_prealloc_size;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.transaction_prealloc_size;
+
+--Error ER_UNKNOWN_TABLE
+SELECT session.transaction_prealloc_size;
+
+--Error ER_BAD_FIELD_ERROR
+SELECT transaction_prealloc_size = @@session.transaction_prealloc_size;
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.transaction_prealloc_size = @start_global_value;
+SELECT @@global.transaction_prealloc_size;
+SET @@session.transaction_prealloc_size = @start_session_value;
+SELECT @@session.transaction_prealloc_size;
+
+
+#############################################################
+#                 END OF transaction_prealloc_size TESTS     #
+#############################################################
+
diff --git a/mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc b/mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc
new file mode 100644
index 00000000000..b6e19e235ba
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc
@@ -0,0 +1,218 @@
+############## mysql-test\t\wait_timeout_basic.test ###########################
+#                                                                             #
+# Variable Name: wait_timeout                                                 #
+# Scope: GLOBAL | SESSION                                                     #
+# Access Type: Dynamic                                                        #
+# Data Type: numeric                                                          #
+# Default Value:                                                              #
+# Range:                                                                      #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2008-02-07                                                   #
+# Author:  Sharique Abdullah                                                      #
+#                                                                             #
+# Description: Test Cases of Dynamic System Variable wait_timeout             #
+#              that checks the behavior of this variable in the following ways#
+#              * Default Value                                                #
+#              * Valid & Invalid values                                       #
+#              * Scope & Access method                                        #
+#              * Data Integrity                                               #
+#                                                                             #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
+#  server-system-variables.html#option_mysqld_wait_timeouts                   #
+#                                                                             #
+###############################################################################
+# Due to differnces between linux and windows in the results
+
+--source include/not_windows.inc
+--source include/load_sysvars.inc
+
+############################################################
+#           START OF wait_timeout TESTS                    #
+############################################################
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.wait_timeout;
+SET @start_session_value = @@session.wait_timeout;
+
+--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
+############################################################
+#     Display the DEFAULT value of wait_timeout            #
+############################################################
+
+SET @@global.wait_timeout = 100;
+SET @@global.wait_timeout = DEFAULT;
+SELECT @@global.wait_timeout;
+
+SET @@session.wait_timeout = 200;
+SET @@session.wait_timeout = DEFAULT;
+SELECT @@session.wait_timeout;
+
+
+--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
+############################################################
+#     Check the DEFAULT value of wait_timeout              #
+############################################################
+
+SET @@global.wait_timeout = DEFAULT;
+SELECT @@global.wait_timeout = @default_wait_timeout;
+
+SET @@session.wait_timeout = DEFAULT;
+SELECT @@session.wait_timeout = @default_wait_timeout;
+
+
+
+--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
+######################################################################
+# Change the value of wait_timeout to a valid value for GLOBAL Scope #
+######################################################################
+
+#SET @@global.wait_timeout= @min_wait_timeout;
+SET @@global.wait_timeout= 1;
+SELECT @@global.wait_timeout;
+
+SET @@global.wait_timeout = 60020;
+SELECT @@global.wait_timeout;
+
+#SET @@global.wait_timeout = @max_wait_timeout;
+SET @@global.wait_timeout = 31536000;
+SELECT @@global.wait_timeout = @max_wait_timeout;
+
+
+--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
+#######################################################################
+# Change the value of wait_timeout to a valid value for SESSION Scope #
+#######################################################################
+#SET @@session.wait_timeout = @min_wait_timeout;
+#SELECT @@session.wait_timeout;
+
+SET @@session.wait_timeout =6000;
+SELECT @@session.wait_timeout;
+
+#SET @@session.wait_timeout = @max_wait_timeout;
+#SELECT @@session.wait_timeout = @max_wait_timeout;
+
+
+--echo '#------------------FN_DYNVARS_005_05-----------------------#'
+########################################################
+# Change the value of wait_timeout to an invalid value #
+########################################################
+
+SET @@global.wait_timeout = 0;
+SET @@global.wait_timeout = -1024;
+
+--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wait_timeout = ON;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wait_timeout = OFF;
+
+SET @@global.wait_timeout = True;
+SELECT @@global.wait_timeout;
+
+SET @@global.wait_timeout = False;
+SELECT @@global.wait_timeout;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wait_timeout = 65530.34;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wait_timeout ="Test";
+
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.wait_timeout = ON;
+
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.wait_timeout = OFF;
+
+SET @@session.wait_timeout = True;
+SELECT @@session.wait_timeout;
+
+SET @@session.wait_timeout = False;
+SELECT @@session.wait_timeout;
+
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.wait_timeout = "Test";
+
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.wait_timeout = 'test';
+
+SET @@session.wait_timeout = 123456789031;
+SELECT @@session.wait_timeout = @max_wait_timeout;
+
+
+--echo '#------------------FN_DYNVARS_005_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+SELECT @@global.wait_timeout = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='wait_timeout';
+
+--echo '#------------------FN_DYNVARS_005_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.wait_timeout = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='wait_timeout';
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+###########################################################################
+#  Check if global and session variable are independent of each other     #
+###########################################################################
+
+SET @@global.wait_timeout = 30000;
+SET @@global.wait_timeout = 40000;
+SELECT @@wait_timeout = @@global.wait_timeout;
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+########################################################################
+#    Check if accessing variable with SESSION,LOCAL and without SCOPE  #
+#    points to same session variable                                   #
+########################################################################
+
+SET @@wait_timeout = 100;
+SELECT @@wait_timeout = @@local.wait_timeout;
+SELECT @@local.wait_timeout = @@session.wait_timeout;
+
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+#######################################################################
+#   Check if wait_timeout can be accessed with and without @@ sign    #
+#######################################################################
+
+SET wait_timeout = 1027;
+SELECT @@wait_timeout;
+
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.wait_timeout;
+
+--Error ER_UNKNOWN_TABLE
+SELECT session.wait_timeout;
+
+--Error ER_BAD_FIELD_ERROR
+SELECT wait_timeout = @@session.wait_timeout;
+
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.wait_timeout = @start_global_value;
+SET @@session.wait_timeout = @start_session_value;
+
+#################################################
+#                 END OF wait_timeout TESTS     #
+#################################################
diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result
new file mode 100644
index 00000000000..6267c5493da
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result
@@ -0,0 +1,102 @@
+SET @start_value = @@global.binlog_cache_size;
+SELECT @start_value;
+@start_value
+32768
+'#--------------------FN_DYNVARS_006_01------------------------#'
+SET @@global.binlog_cache_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '100'
+SET @@global.binlog_cache_size = DEFAULT;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+32768
+'#---------------------FN_DYNVARS_006_02-------------------------#'
+SET @@global.binlog_cache_size = @start_value;
+SELECT @@global.binlog_cache_size = 32768;
+@@global.binlog_cache_size = 32768
+1
+'#--------------------FN_DYNVARS_006_03------------------------#'
+SET @@global.binlog_cache_size = 4096;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4096
+SET @@global.binlog_cache_size = 4294967295;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4294963200
+SET @@global.binlog_cache_size = 10000;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+8192
+SET @@global.binlog_cache_size = 21221204;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+21217280
+'Bug: Invalid values are coming in variable on assigning valid values'
+'#--------------------FN_DYNVARS_006_04-------------------------#'
+SET @@global.binlog_cache_size = 1024;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '1024'
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4096
+SET @@global.binlog_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
+SET @@global.binlog_cache_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '0'
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4096
+SET @@global.binlog_cache_size = 42949672950;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '42949672950'
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4294963200
+'Bug: Errors are not coming on assigning invalid values to variable'
+SET @@global.binlog_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
+SET @@global.binlog_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
+'#-------------------FN_DYNVARS_006_05----------------------------#'
+SET @@session.binlog_cache_size = 0;
+ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+'#----------------------FN_DYNVARS_006_06------------------------#'
+SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size';
+@@global.binlog_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_006_07----------------------#'
+SET @@global.binlog_cache_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '1'
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4096
+SET @@global.binlog_cache_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '0'
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4096
+'Bug: Errors are not coming on assigning TRUE/FALSE to variable'
+'#---------------------FN_DYNVARS_006_08----------------------#'
+SET @@global.binlog_cache_size = 1;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '1'
+SELECT @@binlog_cache_size = @@global.binlog_cache_size;
+@@binlog_cache_size = @@global.binlog_cache_size
+1
+'#---------------------FN_DYNVARS_006_09----------------------#'
+SET binlog_cache_size = 1;
+ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET global.binlog_cache_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_cache_size = 1' at line 1
+SELECT global.binlog_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT binlog_cache_size = @@session.binlog_cache_size;
+ERROR 42S22: Unknown column 'binlog_cache_size' in 'field list'
+SET @@global.binlog_cache_size = @start_value;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+32768
diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result
new file mode 100644
index 00000000000..45ed43589a3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result
@@ -0,0 +1,100 @@
+SET @start_value = @@global.binlog_cache_size;
+SELECT @start_value;
+@start_value
+32768
+'#--------------------FN_DYNVARS_006_01------------------------#'
+SET @@global.binlog_cache_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '100'
+SET @@global.binlog_cache_size = DEFAULT;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+32768
+'#---------------------FN_DYNVARS_006_02-------------------------#'
+SET @@global.binlog_cache_size = @start_value;
+SELECT @@global.binlog_cache_size = 32768;
+@@global.binlog_cache_size = 32768
+1
+'#--------------------FN_DYNVARS_006_03------------------------#'
+SET @@global.binlog_cache_size = 4096;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4096
+SET @@global.binlog_cache_size = 4294967295;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4294963200
+SET @@global.binlog_cache_size = 10000;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+8192
+SET @@global.binlog_cache_size = 21221204;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+21217280
+'Bug: Invalid values are coming in variable on assigning valid values'
+'#--------------------FN_DYNVARS_006_04-------------------------#'
+SET @@global.binlog_cache_size = 1024;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '1024'
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4096
+SET @@global.binlog_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
+SET @@global.binlog_cache_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '0'
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4096
+SET @@global.binlog_cache_size = 42949672950;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+42949668864
+'Bug: Errors are not coming on assigning invalid values to variable'
+SET @@global.binlog_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
+SET @@global.binlog_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'binlog_cache_size'
+'#-------------------FN_DYNVARS_006_05----------------------------#'
+SET @@session.binlog_cache_size = 0;
+ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+'#----------------------FN_DYNVARS_006_06------------------------#'
+SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size';
+@@global.binlog_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_006_07----------------------#'
+SET @@global.binlog_cache_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '1'
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4096
+SET @@global.binlog_cache_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '0'
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+4096
+'Bug: Errors are not coming on assigning TRUE/FALSE to variable'
+'#---------------------FN_DYNVARS_006_08----------------------#'
+SET @@global.binlog_cache_size = 1;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '1'
+SELECT @@binlog_cache_size = @@global.binlog_cache_size;
+@@binlog_cache_size = @@global.binlog_cache_size
+1
+'#---------------------FN_DYNVARS_006_09----------------------#'
+SET binlog_cache_size = 1;
+ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET global.binlog_cache_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_cache_size = 1' at line 1
+SELECT global.binlog_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT binlog_cache_size = @@session.binlog_cache_size;
+ERROR 42S22: Unknown column 'binlog_cache_size' in 'field list'
+SET @@global.binlog_cache_size = @start_value;
+SELECT @@global.binlog_cache_size;
+@@global.binlog_cache_size
+32768
diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result
new file mode 100644
index 00000000000..1194a0e7ce7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result
@@ -0,0 +1,154 @@
+SET @start_global_value = @@global.bulk_insert_buffer_size;
+SELECT @start_global_value;
+@start_global_value
+8388608
+SET @start_session_value = @@session.bulk_insert_buffer_size;
+SELECT @start_session_value;
+@start_session_value
+8388608
+'#--------------------FN_DYNVARS_007_01-------------------------#'
+SET @@global.bulk_insert_buffer_size = 100;
+SET @@global.bulk_insert_buffer_size = DEFAULT;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+8388608
+SET @@session.bulk_insert_buffer_size = 200;
+SET @@session.bulk_insert_buffer_size = DEFAULT;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+8388608
+'#--------------------FN_DYNVARS_007_02-------------------------#'
+SET @@global.bulk_insert_buffer_size = @start_global_value;
+SELECT @@global.bulk_insert_buffer_size = 8388608;
+@@global.bulk_insert_buffer_size = 8388608
+1
+SET @@session.bulk_insert_buffer_size = @start_session_value;
+SELECT @@session.bulk_insert_buffer_size = 8388608;
+@@session.bulk_insert_buffer_size = 8388608
+1
+'#--------------------FN_DYNVARS_007_03-------------------------#'
+SET @@global.bulk_insert_buffer_size = 0;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+0
+SET @@global.bulk_insert_buffer_size = 1;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+1
+SET @@global.bulk_insert_buffer_size = 4294967295;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+4294967295
+SET @@global.bulk_insert_buffer_size = 429496;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+429496
+'#--------------------FN_DYNVARS_007_04-------------------------#'
+SET @@session.bulk_insert_buffer_size = 0;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+0
+SET @@session.bulk_insert_buffer_size = 1;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+1
+SET @@session.bulk_insert_buffer_size = 4294967295;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+4294967295
+SET @@session.bulk_insert_buffer_size = 429496;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+429496
+'#------------------FN_DYNVARS_007_05-----------------------#'
+SET @@global.bulk_insert_buffer_size = 42949672950;
+Warnings:
+Warning	1292	Truncated incorrect bulk_insert_buffer_size value: '42949672950'
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+4294967295
+SET @@global.bulk_insert_buffer_size = -1024;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+0
+SET @@global.bulk_insert_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
+SET @@global.bulk_insert_buffer_size = ON;
+ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
+SET @@global.bulk_insert_buffer_size = 429496.10;
+ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
+SET @@session.bulk_insert_buffer_size = 42949672950;
+Warnings:
+Warning	1292	Truncated incorrect bulk_insert_buffer_size value: '42949672950'
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+4294967295
+SET @@session.bulk_insert_buffer_size = -2;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+0
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@session.bulk_insert_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
+SET @@session.bulk_insert_buffer_size = 429496.10;
+ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
+'#------------------FN_DYNVARS_007_06-----------------------#'
+SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='bulk_insert_buffer_size';
+@@global.bulk_insert_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_007_07-----------------------#'
+SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='bulk_insert_buffer_size';
+@@session.bulk_insert_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_007_08-----------------------#'
+SET @@global.bulk_insert_buffer_size = TRUE;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+1
+SET @@global.bulk_insert_buffer_size = FALSE;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+0
+SET @@session.bulk_insert_buffer_size = TRUE;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+1
+SET @@session.bulk_insert_buffer_size = FALSE;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+0
+'#---------------------FN_DYNVARS_007_09----------------------#'
+SET @@bulk_insert_buffer_size = 100;
+SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size;
+@@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size
+1
+SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
+@@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size
+1
+'#---------------------FN_DYNVARS_007_10----------------------#'
+SET bulk_insert_buffer_size = 1;
+SELECT @@bulk_insert_buffer_size;
+@@bulk_insert_buffer_size
+1
+SET local.bulk_insert_buffer_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1
+SELECT local.bulk_insert_buffer_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET session.bulk_insert_buffer_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1
+SELECT session.bulk_insert_buffer_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
+ERROR 42S22: Unknown column 'bulk_insert_buffer_size' in 'field list'
+SET @@global.bulk_insert_buffer_size = @start_global_value;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+8388608
+SET @@session.bulk_insert_buffer_size = @start_session_value;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+8388608
diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result
new file mode 100644
index 00000000000..9e0e8e07470
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result
@@ -0,0 +1,150 @@
+SET @start_global_value = @@global.bulk_insert_buffer_size;
+SELECT @start_global_value;
+@start_global_value
+8388608
+SET @start_session_value = @@session.bulk_insert_buffer_size;
+SELECT @start_session_value;
+@start_session_value
+8388608
+'#--------------------FN_DYNVARS_007_01-------------------------#'
+SET @@global.bulk_insert_buffer_size = 100;
+SET @@global.bulk_insert_buffer_size = DEFAULT;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+8388608
+SET @@session.bulk_insert_buffer_size = 200;
+SET @@session.bulk_insert_buffer_size = DEFAULT;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+8388608
+'#--------------------FN_DYNVARS_007_02-------------------------#'
+SET @@global.bulk_insert_buffer_size = @start_global_value;
+SELECT @@global.bulk_insert_buffer_size = 8388608;
+@@global.bulk_insert_buffer_size = 8388608
+1
+SET @@session.bulk_insert_buffer_size = @start_session_value;
+SELECT @@session.bulk_insert_buffer_size = 8388608;
+@@session.bulk_insert_buffer_size = 8388608
+1
+'#--------------------FN_DYNVARS_007_03-------------------------#'
+SET @@global.bulk_insert_buffer_size = 0;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+0
+SET @@global.bulk_insert_buffer_size = 1;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+1
+SET @@global.bulk_insert_buffer_size = 4294967295;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+4294967295
+SET @@global.bulk_insert_buffer_size = 429496;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+429496
+'#--------------------FN_DYNVARS_007_04-------------------------#'
+SET @@session.bulk_insert_buffer_size = 0;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+0
+SET @@session.bulk_insert_buffer_size = 1;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+1
+SET @@session.bulk_insert_buffer_size = 4294967295;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+4294967295
+SET @@session.bulk_insert_buffer_size = 429496;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+429496
+'#------------------FN_DYNVARS_007_05-----------------------#'
+SET @@global.bulk_insert_buffer_size = 42949672950;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+42949672950
+SET @@global.bulk_insert_buffer_size = -1024;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+0
+SET @@global.bulk_insert_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
+SET @@global.bulk_insert_buffer_size = ON;
+ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
+SET @@global.bulk_insert_buffer_size = 429496.10;
+ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
+SET @@session.bulk_insert_buffer_size = 42949672950;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+42949672950
+SET @@session.bulk_insert_buffer_size = -2;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+0
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@session.bulk_insert_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
+SET @@session.bulk_insert_buffer_size = 429496.10;
+ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size'
+'#------------------FN_DYNVARS_007_06-----------------------#'
+SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='bulk_insert_buffer_size';
+@@global.bulk_insert_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_007_07-----------------------#'
+SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='bulk_insert_buffer_size';
+@@session.bulk_insert_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_007_08-----------------------#'
+SET @@global.bulk_insert_buffer_size = TRUE;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+1
+SET @@global.bulk_insert_buffer_size = FALSE;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+0
+SET @@session.bulk_insert_buffer_size = TRUE;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+1
+SET @@session.bulk_insert_buffer_size = FALSE;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+0
+'#---------------------FN_DYNVARS_007_09----------------------#'
+SET @@bulk_insert_buffer_size = 100;
+SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size;
+@@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size
+1
+SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
+@@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size
+1
+'#---------------------FN_DYNVARS_007_10----------------------#'
+SET bulk_insert_buffer_size = 1;
+SELECT @@bulk_insert_buffer_size;
+@@bulk_insert_buffer_size
+1
+SET local.bulk_insert_buffer_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1
+SELECT local.bulk_insert_buffer_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET session.bulk_insert_buffer_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1
+SELECT session.bulk_insert_buffer_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size;
+ERROR 42S22: Unknown column 'bulk_insert_buffer_size' in 'field list'
+SET @@global.bulk_insert_buffer_size = @start_global_value;
+SELECT @@global.bulk_insert_buffer_size;
+@@global.bulk_insert_buffer_size
+8388608
+SET @@session.bulk_insert_buffer_size = @start_session_value;
+SELECT @@session.bulk_insert_buffer_size;
+@@session.bulk_insert_buffer_size
+8388608
diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result
new file mode 100644
index 00000000000..cb6820b2941
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result
@@ -0,0 +1,112 @@
+SET @start_value = @@global.delayed_insert_limit;
+SELECT @start_value;
+@start_value
+100
+'#--------------------FN_DYNVARS_024_01------------------------#'
+SET @@global.delayed_insert_limit = 100;
+SET @@global.delayed_insert_limit = DEFAULT;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+100
+'#---------------------FN_DYNVARS_024_02-------------------------#'
+SET @@global.delayed_insert_limit = @start_value;
+SELECT @@global.delayed_insert_limit = 100;
+@@global.delayed_insert_limit = 100
+1
+'#--------------------FN_DYNVARS_024_03------------------------#'
+SET @@global.delayed_insert_limit = 10000;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+10000
+SET @@global.delayed_insert_limit = 4294967295;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+4294967295
+SET @@global.delayed_insert_limit = 1;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+1
+'#--------------------FN_DYNVARS_024_04-------------------------#'
+SET @@global.delayed_insert_limit = 0;
+Warnings:
+Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+1
+SET @@global.delayed_insert_limit = -1024;
+Warnings:
+Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+1
+SET @@global.delayed_insert_limit = 42949672950;
+Warnings:
+Warning	1292	Truncated incorrect delayed_insert_limit value: '42949672950'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+4294967295
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@global.delayed_insert_limit = 429496729.5;
+ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+4294967295
+SET @@global.delayed_insert_limit = ON;
+ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+4294967295
+'#-------------------FN_DYNVARS_024_05----------------------------#'
+SET @@session.delayed_insert_limit = 0;
+ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@Session.delayed_insert_limit;
+ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable
+'#----------------------FN_DYNVARS_024_06------------------------#'
+SELECT @@global.delayed_insert_limit =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='delayed_insert_limit';
+@@global.delayed_insert_limit =
+VARIABLE_VALUE
+1
+SELECT @@delayed_insert_limit =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='delayed_insert_limit';
+@@delayed_insert_limit =
+VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_024_07----------------------#'
+SET @@global.delayed_insert_limit = TRUE;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+1
+SET @@global.delayed_insert_limit = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+1
+'#---------------------FN_DYNVARS_024_08----------------------#'
+SET @@global.delayed_insert_limit = 1;
+SELECT @@delayed_insert_limit = @@global.delayed_insert_limit;
+@@delayed_insert_limit = @@global.delayed_insert_limit
+1
+'#---------------------FN_DYNVARS_024_09----------------------#'
+SET delayed_insert_limit = 1;
+ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@delayed_insert_limit;
+@@delayed_insert_limit
+1
+SET local.delayed_insert_limit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1
+SELECT local.delayed_insert_limit;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.delayed_insert_limit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1
+SELECT global.delayed_insert_limit;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT delayed_insert_limit = @@session.delayed_insert_limit;
+ERROR 42S22: Unknown column 'delayed_insert_limit' in 'field list'
+SET @@global.delayed_insert_limit = @start_value;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+100
diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result
new file mode 100644
index 00000000000..246bf0e8734
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result
@@ -0,0 +1,110 @@
+SET @start_value = @@global.delayed_insert_limit;
+SELECT @start_value;
+@start_value
+100
+'#--------------------FN_DYNVARS_024_01------------------------#'
+SET @@global.delayed_insert_limit = 100;
+SET @@global.delayed_insert_limit = DEFAULT;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+100
+'#---------------------FN_DYNVARS_024_02-------------------------#'
+SET @@global.delayed_insert_limit = @start_value;
+SELECT @@global.delayed_insert_limit = 100;
+@@global.delayed_insert_limit = 100
+1
+'#--------------------FN_DYNVARS_024_03------------------------#'
+SET @@global.delayed_insert_limit = 10000;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+10000
+SET @@global.delayed_insert_limit = 4294967295;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+4294967295
+SET @@global.delayed_insert_limit = 1;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+1
+'#--------------------FN_DYNVARS_024_04-------------------------#'
+SET @@global.delayed_insert_limit = 0;
+Warnings:
+Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+1
+SET @@global.delayed_insert_limit = -1024;
+Warnings:
+Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+1
+SET @@global.delayed_insert_limit = 42949672950;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+42949672950
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@global.delayed_insert_limit = 429496729.5;
+ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+42949672950
+SET @@global.delayed_insert_limit = ON;
+ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+42949672950
+'#-------------------FN_DYNVARS_024_05----------------------------#'
+SET @@session.delayed_insert_limit = 0;
+ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@Session.delayed_insert_limit;
+ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable
+'#----------------------FN_DYNVARS_024_06------------------------#'
+SELECT @@global.delayed_insert_limit =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='delayed_insert_limit';
+@@global.delayed_insert_limit =
+VARIABLE_VALUE
+1
+SELECT @@delayed_insert_limit =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='delayed_insert_limit';
+@@delayed_insert_limit =
+VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_024_07----------------------#'
+SET @@global.delayed_insert_limit = TRUE;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+1
+SET @@global.delayed_insert_limit = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect delayed_insert_limit value: '0'
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+1
+'#---------------------FN_DYNVARS_024_08----------------------#'
+SET @@global.delayed_insert_limit = 1;
+SELECT @@delayed_insert_limit = @@global.delayed_insert_limit;
+@@delayed_insert_limit = @@global.delayed_insert_limit
+1
+'#---------------------FN_DYNVARS_024_09----------------------#'
+SET delayed_insert_limit = 1;
+ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@delayed_insert_limit;
+@@delayed_insert_limit
+1
+SET local.delayed_insert_limit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1
+SELECT local.delayed_insert_limit;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.delayed_insert_limit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1
+SELECT global.delayed_insert_limit;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT delayed_insert_limit = @@session.delayed_insert_limit;
+ERROR 42S22: Unknown column 'delayed_insert_limit' in 'field list'
+SET @@global.delayed_insert_limit = @start_value;
+SELECT @@global.delayed_insert_limit;
+@@global.delayed_insert_limit
+100
diff --git a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result
new file mode 100644
index 00000000000..6bfa6f0de40
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result
@@ -0,0 +1,110 @@
+SET @start_value = @@global.delayed_queue_size;
+SELECT @start_value;
+@start_value
+1000
+'#--------------------FN_DYNVARS_026_01------------------------#'
+SET @@global.delayed_queue_size = 100;
+SET @@global.delayed_queue_size = DEFAULT;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1000
+'#---------------------FN_DYNVARS_026_02-------------------------#'
+SET @@global.delayed_queue_size = @start_value;
+SELECT @@global.delayed_queue_size = 1000;
+@@global.delayed_queue_size = 1000
+1
+'#--------------------FN_DYNVARS_026_03------------------------#'
+SET @@global.delayed_queue_size = 10000;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+10000
+SET @@global.delayed_queue_size = 4294967295;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+4294967295
+SET @@global.delayed_queue_size = 1;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1
+'#--------------------FN_DYNVARS_026_04-------------------------#'
+SET @@global.delayed_queue_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect delayed_queue_size value: '0'
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1
+SET @@global.delayed_queue_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect delayed_queue_size value: '0'
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1
+SET @@global.delayed_queue_size = 42949672950;
+Warnings:
+Warning	1292	Truncated incorrect delayed_queue_size value: '42949672950'
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+4294967295
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@global.delayed_queue_size = 429496729.5;
+ERROR 42000: Incorrect argument type to variable 'delayed_queue_size'
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+4294967295
+SET @@global.delayed_queue_size = ON;
+ERROR 42000: Incorrect argument type to variable 'delayed_queue_size'
+SELECT @@delayed_queue_size;
+@@delayed_queue_size
+4294967295
+'#-------------------FN_DYNVARS_026_05----------------------------#'
+SET @@session.delayed_queue_size = 0;
+ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.delayed_queue_size;
+ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable
+'#----------------------FN_DYNVARS_026_06------------------------#'
+SELECT @@global.delayed_queue_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='delayed_queue_size';
+@@global.delayed_queue_size = VARIABLE_VALUE
+1
+SELECT @@delayed_queue_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='delayed_queue_size';
+@@delayed_queue_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_026_07----------------------#'
+SET @@global.delayed_queue_size = TRUE;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1
+SET @@global.delayed_queue_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect delayed_queue_size value: '0'
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1
+'#---------------------FN_DYNVARS_026_08----------------------#'
+SET @@global.delayed_queue_size = 1;
+SELECT @@delayed_queue_size = @@global.delayed_queue_size;
+@@delayed_queue_size = @@global.delayed_queue_size
+1
+'#---------------------FN_DYNVARS_026_09----------------------#'
+SET delayed_queue_size = 1;
+ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@delayed_queue_size;
+@@delayed_queue_size
+1
+SET local.delayed_queue_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1
+SELECT local.delayed_queue_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.delayed_queue_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1
+SELECT global.delayed_queue_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT delayed_queue_size = @@session.delayed_queue_size;
+ERROR 42S22: Unknown column 'delayed_queue_size' in 'field list'
+SET @@global.delayed_queue_size = @start_value;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1000
diff --git a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result
new file mode 100644
index 00000000000..d575626b0a1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result
@@ -0,0 +1,108 @@
+SET @start_value = @@global.delayed_queue_size;
+SELECT @start_value;
+@start_value
+1000
+'#--------------------FN_DYNVARS_026_01------------------------#'
+SET @@global.delayed_queue_size = 100;
+SET @@global.delayed_queue_size = DEFAULT;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1000
+'#---------------------FN_DYNVARS_026_02-------------------------#'
+SET @@global.delayed_queue_size = @start_value;
+SELECT @@global.delayed_queue_size = 1000;
+@@global.delayed_queue_size = 1000
+1
+'#--------------------FN_DYNVARS_026_03------------------------#'
+SET @@global.delayed_queue_size = 10000;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+10000
+SET @@global.delayed_queue_size = 4294967295;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+4294967295
+SET @@global.delayed_queue_size = 1;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1
+'#--------------------FN_DYNVARS_026_04-------------------------#'
+SET @@global.delayed_queue_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect delayed_queue_size value: '0'
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1
+SET @@global.delayed_queue_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect delayed_queue_size value: '0'
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1
+SET @@global.delayed_queue_size = 42949672950;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+42949672950
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@global.delayed_queue_size = 429496729.5;
+ERROR 42000: Incorrect argument type to variable 'delayed_queue_size'
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+42949672950
+SET @@global.delayed_queue_size = ON;
+ERROR 42000: Incorrect argument type to variable 'delayed_queue_size'
+SELECT @@delayed_queue_size;
+@@delayed_queue_size
+42949672950
+'#-------------------FN_DYNVARS_026_05----------------------------#'
+SET @@session.delayed_queue_size = 0;
+ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.delayed_queue_size;
+ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable
+'#----------------------FN_DYNVARS_026_06------------------------#'
+SELECT @@global.delayed_queue_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='delayed_queue_size';
+@@global.delayed_queue_size = VARIABLE_VALUE
+1
+SELECT @@delayed_queue_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='delayed_queue_size';
+@@delayed_queue_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_026_07----------------------#'
+SET @@global.delayed_queue_size = TRUE;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1
+SET @@global.delayed_queue_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect delayed_queue_size value: '0'
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1
+'#---------------------FN_DYNVARS_026_08----------------------#'
+SET @@global.delayed_queue_size = 1;
+SELECT @@delayed_queue_size = @@global.delayed_queue_size;
+@@delayed_queue_size = @@global.delayed_queue_size
+1
+'#---------------------FN_DYNVARS_026_09----------------------#'
+SET delayed_queue_size = 1;
+ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@delayed_queue_size;
+@@delayed_queue_size
+1
+SET local.delayed_queue_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1
+SELECT local.delayed_queue_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.delayed_queue_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1
+SELECT global.delayed_queue_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT delayed_queue_size = @@session.delayed_queue_size;
+ERROR 42S22: Unknown column 'delayed_queue_size' in 'field list'
+SET @@global.delayed_queue_size = @start_value;
+SELECT @@global.delayed_queue_size;
+@@global.delayed_queue_size
+1000
diff --git a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result
new file mode 100644
index 00000000000..1d1317d0d5e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result
@@ -0,0 +1,100 @@
+SET @global_start_value = @@global.innodb_concurrency_tickets;
+SELECT @global_start_value;
+@global_start_value
+500
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_concurrency_tickets = 0;
+Warnings:
+Warning	1292	Truncated incorrect concurrency_tickets value: '0'
+SET @@global.innodb_concurrency_tickets = DEFAULT;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+500
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_concurrency_tickets = 1;
+ERROR HY000: Variable 'innodb_concurrency_tickets' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_concurrency_tickets;
+@@innodb_concurrency_tickets
+500
+SELECT local.innodb_concurrency_tickets;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_concurrency_tickets = 0;
+Warnings:
+Warning	1292	Truncated incorrect concurrency_tickets value: '0'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_concurrency_tickets = 1;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
+SET @@global.innodb_concurrency_tickets = 1000;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1000
+SET @@global.innodb_concurrency_tickets = 4294967295;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+4294967295
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_concurrency_tickets = -1;
+Warnings:
+Warning	1292	Truncated incorrect concurrency_tickets value: '18446744073709551615'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+4294967295
+SET @@global.innodb_concurrency_tickets = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+4294967295
+SET @@global.innodb_concurrency_tickets = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+4294967295
+SET @@global.innodb_concurrency_tickets = 1001;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1001
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_concurrency_tickets =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_concurrency_tickets';
+@@global.innodb_concurrency_tickets =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1001
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_concurrency_tickets';
+VARIABLE_VALUE
+1001
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_concurrency_tickets = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1001
+SET @@global.innodb_concurrency_tickets = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1001
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_concurrency_tickets = TRUE;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
+SET @@global.innodb_concurrency_tickets = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect concurrency_tickets value: '0'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
+SET @@global.innodb_concurrency_tickets = @global_start_value;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+500
diff --git a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result
new file mode 100644
index 00000000000..40d307d8733
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result
@@ -0,0 +1,98 @@
+SET @global_start_value = @@global.innodb_concurrency_tickets;
+SELECT @global_start_value;
+@global_start_value
+500
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_concurrency_tickets = 0;
+Warnings:
+Warning	1292	Truncated incorrect concurrency_tickets value: '0'
+SET @@global.innodb_concurrency_tickets = DEFAULT;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+500
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_concurrency_tickets = 1;
+ERROR HY000: Variable 'innodb_concurrency_tickets' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_concurrency_tickets;
+@@innodb_concurrency_tickets
+500
+SELECT local.innodb_concurrency_tickets;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_concurrency_tickets = 0;
+Warnings:
+Warning	1292	Truncated incorrect concurrency_tickets value: '0'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_concurrency_tickets = 1;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
+SET @@global.innodb_concurrency_tickets = 1000;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1000
+SET @@global.innodb_concurrency_tickets = 4294967295;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+4294967295
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_concurrency_tickets = -1;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+18446744073709551615
+SET @@global.innodb_concurrency_tickets = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+18446744073709551615
+SET @@global.innodb_concurrency_tickets = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+18446744073709551615
+SET @@global.innodb_concurrency_tickets = 1001;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1001
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_concurrency_tickets =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_concurrency_tickets';
+@@global.innodb_concurrency_tickets =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1001
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_concurrency_tickets';
+VARIABLE_VALUE
+1001
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_concurrency_tickets = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1001
+SET @@global.innodb_concurrency_tickets = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1001
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_concurrency_tickets = TRUE;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
+SET @@global.innodb_concurrency_tickets = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect concurrency_tickets value: '0'
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+1
+SET @@global.innodb_concurrency_tickets = @global_start_value;
+SELECT @@global.innodb_concurrency_tickets;
+@@global.innodb_concurrency_tickets
+500
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result
new file mode 100644
index 00000000000..ed960f12ff1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result
@@ -0,0 +1,94 @@
+SET @global_start_value = @@global.innodb_max_purge_lag;
+SELECT @global_start_value;
+@global_start_value
+0
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_max_purge_lag = 0;
+SET @@global.innodb_max_purge_lag = DEFAULT;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_max_purge_lag = 1;
+ERROR HY000: Variable 'innodb_max_purge_lag' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_max_purge_lag;
+@@innodb_max_purge_lag
+0
+SELECT local.innodb_max_purge_lag;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_max_purge_lag = 0;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_max_purge_lag = 0;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
+SET @@global.innodb_max_purge_lag = 1;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1
+SET @@global.innodb_max_purge_lag = 4294967295;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+4294967295
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_max_purge_lag = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_purge_lag value: '18446744073709551615'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+4294967295
+SET @@global.innodb_max_purge_lag = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+4294967295
+SET @@global.innodb_max_purge_lag = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+4294967295
+SET @@global.innodb_max_purge_lag = 1001;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1001
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_max_purge_lag =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_purge_lag';
+@@global.innodb_max_purge_lag =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1001
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_purge_lag';
+VARIABLE_VALUE
+1001
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_max_purge_lag = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1001
+SET @@global.innodb_max_purge_lag = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1001
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_max_purge_lag = TRUE;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1
+SET @@global.innodb_max_purge_lag = FALSE;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
+SET @@global.innodb_max_purge_lag = @global_start_value;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result
new file mode 100644
index 00000000000..a6b669dde83
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result
@@ -0,0 +1,92 @@
+SET @global_start_value = @@global.innodb_max_purge_lag;
+SELECT @global_start_value;
+@global_start_value
+0
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_max_purge_lag = 0;
+SET @@global.innodb_max_purge_lag = DEFAULT;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_max_purge_lag = 1;
+ERROR HY000: Variable 'innodb_max_purge_lag' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_max_purge_lag;
+@@innodb_max_purge_lag
+0
+SELECT local.innodb_max_purge_lag;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_max_purge_lag = 0;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_max_purge_lag = 0;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
+SET @@global.innodb_max_purge_lag = 1;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1
+SET @@global.innodb_max_purge_lag = 4294967295;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+4294967295
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_max_purge_lag = -1;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+18446744073709551615
+SET @@global.innodb_max_purge_lag = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+18446744073709551615
+SET @@global.innodb_max_purge_lag = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+18446744073709551615
+SET @@global.innodb_max_purge_lag = 1001;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1001
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_max_purge_lag =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_purge_lag';
+@@global.innodb_max_purge_lag =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1001
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_purge_lag';
+VARIABLE_VALUE
+1001
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_max_purge_lag = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1001
+SET @@global.innodb_max_purge_lag = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag'
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1001
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_max_purge_lag = TRUE;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+1
+SET @@global.innodb_max_purge_lag = FALSE;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
+SET @@global.innodb_max_purge_lag = @global_start_value;
+SELECT @@global.innodb_max_purge_lag;
+@@global.innodb_max_purge_lag
+0
diff --git a/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result
new file mode 100644
index 00000000000..2b976e65b14
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result
@@ -0,0 +1,94 @@
+SET @global_start_value = @@global.innodb_sync_spin_loops;
+SELECT @global_start_value;
+@global_start_value
+20
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_sync_spin_loops = 0;
+SET @@global.innodb_sync_spin_loops = DEFAULT;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+20
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_sync_spin_loops = 1;
+ERROR HY000: Variable 'innodb_sync_spin_loops' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_sync_spin_loops;
+@@innodb_sync_spin_loops
+20
+SELECT local.innodb_sync_spin_loops;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_sync_spin_loops = 0;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+0
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_sync_spin_loops = 0;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+0
+SET @@global.innodb_sync_spin_loops = 1;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1
+SET @@global.innodb_sync_spin_loops = 1000;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1000
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_sync_spin_loops = -1;
+Warnings:
+Warning	1292	Truncated incorrect sync_spin_loops value: '18446744073709551615'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+4294967295
+SET @@global.innodb_sync_spin_loops = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+4294967295
+SET @@global.innodb_sync_spin_loops = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+4294967295
+SET @@global.innodb_sync_spin_loops = 1001;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1001
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_sync_spin_loops =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_sync_spin_loops';
+@@global.innodb_sync_spin_loops =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1001
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_sync_spin_loops';
+VARIABLE_VALUE
+1001
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_sync_spin_loops = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1001
+SET @@global.innodb_sync_spin_loops = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1001
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_sync_spin_loops = TRUE;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1
+SET @@global.innodb_sync_spin_loops = FALSE;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+0
+SET @@global.innodb_sync_spin_loops = @global_start_value;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+20
diff --git a/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result
new file mode 100644
index 00000000000..1b99ad8e3db
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result
@@ -0,0 +1,92 @@
+SET @global_start_value = @@global.innodb_sync_spin_loops;
+SELECT @global_start_value;
+@global_start_value
+20
+'#--------------------FN_DYNVARS_046_01------------------------#'
+SET @@global.innodb_sync_spin_loops = 0;
+SET @@global.innodb_sync_spin_loops = DEFAULT;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+20
+'#---------------------FN_DYNVARS_046_02-------------------------#'
+SET innodb_sync_spin_loops = 1;
+ERROR HY000: Variable 'innodb_sync_spin_loops' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@innodb_sync_spin_loops;
+@@innodb_sync_spin_loops
+20
+SELECT local.innodb_sync_spin_loops;
+ERROR 42S02: Unknown table 'local' in field list
+SET global innodb_sync_spin_loops = 0;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+0
+'#--------------------FN_DYNVARS_046_03------------------------#'
+SET @@global.innodb_sync_spin_loops = 0;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+0
+SET @@global.innodb_sync_spin_loops = 1;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1
+SET @@global.innodb_sync_spin_loops = 1000;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1000
+'#--------------------FN_DYNVARS_046_04-------------------------#'
+SET @@global.innodb_sync_spin_loops = -1;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+18446744073709551615
+SET @@global.innodb_sync_spin_loops = "T";
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+18446744073709551615
+SET @@global.innodb_sync_spin_loops = "Y";
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+18446744073709551615
+SET @@global.innodb_sync_spin_loops = 1001;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1001
+'#----------------------FN_DYNVARS_046_05------------------------#'
+SELECT @@global.innodb_sync_spin_loops =
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_sync_spin_loops';
+@@global.innodb_sync_spin_loops =
+VARIABLE_VALUE
+1
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1001
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_sync_spin_loops';
+VARIABLE_VALUE
+1001
+'#---------------------FN_DYNVARS_046_06-------------------------#'
+SET @@global.innodb_sync_spin_loops = OFF;
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1001
+SET @@global.innodb_sync_spin_loops = ON;
+ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops'
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1001
+'#---------------------FN_DYNVARS_046_07----------------------#'
+SET @@global.innodb_sync_spin_loops = TRUE;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+1
+SET @@global.innodb_sync_spin_loops = FALSE;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+0
+SET @@global.innodb_sync_spin_loops = @global_start_value;
+SELECT @@global.innodb_sync_spin_loops;
+@@global.innodb_sync_spin_loops
+20
diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
new file mode 100644
index 00000000000..fc3061d2f59
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result
@@ -0,0 +1,198 @@
+SET @start_global_value = @@global.join_buffer_size;
+SELECT @start_global_value;
+@start_global_value
+131072
+SET @start_session_value = @@session.join_buffer_size;
+SELECT @start_session_value;
+@start_session_value
+131072
+'#--------------------FN_DYNVARS_053_01-------------------------#'
+SET @@global.join_buffer_size = 8200;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8200'
+SET @@global.join_buffer_size = DEFAULT;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+131072
+SET @@session.join_buffer_size = 8200;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8200'
+SET @@session.join_buffer_size = DEFAULT;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+131072
+'#--------------------FN_DYNVARS_053_02-------------------------#'
+SET @@global.join_buffer_size = DEFAULT;
+SELECT @@global.join_buffer_size = 131072;
+@@global.join_buffer_size = 131072
+1
+SET @@session.join_buffer_size = DEFAULT;
+SELECT @@session.join_buffer_size = 131072;
+@@session.join_buffer_size = 131072
+1
+'#--------------------FN_DYNVARS_053_03-------------------------#'
+SET @@global.join_buffer_size = 8200;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8200'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+SET @@global.join_buffer_size = 65536;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+65536
+SET @@global.join_buffer_size = 4294967295;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+4294963200
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+'#--------------------FN_DYNVARS_053_04-------------------------#'
+SET @@session.join_buffer_size = 8200;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8200'
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
+1
+SET @@session.join_buffer_size = 65536;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+65536
+SET @@session.join_buffer_size = 4294967295;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+4294963200
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+'#------------------FN_DYNVARS_053_05-----------------------#'
+SET @@global.join_buffer_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '0'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+SET @@global.join_buffer_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '0'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+SET @@global.join_buffer_size = 8199;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8199'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+SET @@global.join_buffer_size = 42949672951;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '42949672951'
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+4294963200
+SET @@global.join_buffer_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+4294963200
+SET @@global.join_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+4294963200
+SET @@session.join_buffer_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '0'
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
+1
+SET @@session.join_buffer_size = -2;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '0'
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
+1
+SET @@session.join_buffer_size = 8199;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8199'
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
+1
+SET @@session.join_buffer_size = 42949672951;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '42949672951'
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+4294963200
+SET @@session.join_buffer_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+4294963200
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@session.join_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+4294963200
+'#------------------FN_DYNVARS_053_06-----------------------#'
+SELECT @@global.join_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='join_buffer_size';
+@@global.join_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_053_07-----------------------#'
+SELECT @@session.join_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='join_buffer_size';
+@@session.join_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_053_08-----------------------#'
+SET @@global.join_buffer_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '1'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+SET @@global.join_buffer_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '0'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.join_buffer_size = 10;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '10'
+SELECT @@join_buffer_size = @@global.join_buffer_size;
+@@join_buffer_size = @@global.join_buffer_size
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@join_buffer_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '100'
+SELECT @@join_buffer_size = @@local.join_buffer_size;
+@@join_buffer_size = @@local.join_buffer_size
+1
+SELECT @@local.join_buffer_size = @@session.join_buffer_size;
+@@local.join_buffer_size = @@session.join_buffer_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET join_buffer_size = 1;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '1'
+SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
+@@join_buffer_size=8200 OR @@join_buffer_size= 8228
+1
+SELECT local.join_buffer_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.join_buffer_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT join_buffer_size = @@session.join_buffer_size;
+ERROR 42S22: Unknown column 'join_buffer_size' in 'field list'
+SET @@global.join_buffer_size = @start_global_value;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+131072
+SET @@session.join_buffer_size = @start_session_value;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+131072
diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result
new file mode 100644
index 00000000000..ed652af67d2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result
@@ -0,0 +1,194 @@
+SET @start_global_value = @@global.join_buffer_size;
+SELECT @start_global_value;
+@start_global_value
+131072
+SET @start_session_value = @@session.join_buffer_size;
+SELECT @start_session_value;
+@start_session_value
+131072
+'#--------------------FN_DYNVARS_053_01-------------------------#'
+SET @@global.join_buffer_size = 8200;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8200'
+SET @@global.join_buffer_size = DEFAULT;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+131072
+SET @@session.join_buffer_size = 8200;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8200'
+SET @@session.join_buffer_size = DEFAULT;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+131072
+'#--------------------FN_DYNVARS_053_02-------------------------#'
+SET @@global.join_buffer_size = DEFAULT;
+SELECT @@global.join_buffer_size = 131072;
+@@global.join_buffer_size = 131072
+1
+SET @@session.join_buffer_size = DEFAULT;
+SELECT @@session.join_buffer_size = 131072;
+@@session.join_buffer_size = 131072
+1
+'#--------------------FN_DYNVARS_053_03-------------------------#'
+SET @@global.join_buffer_size = 8200;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8200'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+SET @@global.join_buffer_size = 65536;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+65536
+SET @@global.join_buffer_size = 4294967295;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+4294963200
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+'#--------------------FN_DYNVARS_053_04-------------------------#'
+SET @@session.join_buffer_size = 8200;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8200'
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
+1
+SET @@session.join_buffer_size = 65536;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+65536
+SET @@session.join_buffer_size = 4294967295;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+4294963200
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+'#------------------FN_DYNVARS_053_05-----------------------#'
+SET @@global.join_buffer_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '0'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+SET @@global.join_buffer_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '0'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+SET @@global.join_buffer_size = 8199;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8199'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+SET @@global.join_buffer_size = 42949672951;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+42949668864
+SET @@global.join_buffer_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+42949668864
+SET @@global.join_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+42949668864
+SET @@session.join_buffer_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '0'
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
+1
+SET @@session.join_buffer_size = -2;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '0'
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
+1
+SET @@session.join_buffer_size = 8199;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '8199'
+SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
+@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228
+1
+SET @@session.join_buffer_size = 42949672951;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+42949668864
+SET @@session.join_buffer_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+42949668864
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@session.join_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'join_buffer_size'
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+42949668864
+'#------------------FN_DYNVARS_053_06-----------------------#'
+SELECT @@global.join_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='join_buffer_size';
+@@global.join_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_053_07-----------------------#'
+SELECT @@session.join_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='join_buffer_size';
+@@session.join_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_053_08-----------------------#'
+SET @@global.join_buffer_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '1'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+SET @@global.join_buffer_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '0'
+SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
+@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228
+1
+'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.join_buffer_size = 10;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '10'
+SELECT @@join_buffer_size = @@global.join_buffer_size;
+@@join_buffer_size = @@global.join_buffer_size
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@join_buffer_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '100'
+SELECT @@join_buffer_size = @@local.join_buffer_size;
+@@join_buffer_size = @@local.join_buffer_size
+1
+SELECT @@local.join_buffer_size = @@session.join_buffer_size;
+@@local.join_buffer_size = @@session.join_buffer_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET join_buffer_size = 1;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '1'
+SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
+@@join_buffer_size=8200 OR @@join_buffer_size= 8228
+1
+SELECT local.join_buffer_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.join_buffer_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT join_buffer_size = @@session.join_buffer_size;
+ERROR 42S22: Unknown column 'join_buffer_size' in 'field list'
+SET @@global.join_buffer_size = @start_global_value;
+SELECT @@global.join_buffer_size;
+@@global.join_buffer_size
+131072
+SET @@session.join_buffer_size = @start_session_value;
+SELECT @@session.join_buffer_size;
+@@session.join_buffer_size
+131072
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
new file mode 100644
index 00000000000..981988a1d4d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result
@@ -0,0 +1,111 @@
+SET @start_value = @@global.key_buffer_size;
+SELECT @start_value;
+@start_value
+1048576
+'#--------------------FN_DYNVARS_055_01------------------------#'
+SET @@global.key_buffer_size = 99;
+SET @@global.key_buffer_size = DEFAULT;
+ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
+'Bug# 34878: This variable has default value according to documentation';
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+'#---------------------FN_DYNVARS_055_02-------------------------#'
+SET @@global.key_buffer_size = @start_value;
+SELECT @@global.key_buffer_size = @start_value;
+@@global.key_buffer_size = @start_value
+1
+'#--------------------FN_DYNVARS_055_03------------------------#'
+SET @@global.key_buffer_size = @min_key_buffer_size;
+SELECT @@global.key_buffer_size= @min_key_buffer_size;
+@@global.key_buffer_size= @min_key_buffer_size
+1
+SET @@global.key_buffer_size = 1800;
+Warnings:
+Warning	1292	Truncated incorrect key_buffer_size value: '1800'
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+SET @@global.key_buffer_size = 65535;
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+61440
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+'#--------------------FN_DYNVARS_055_04-------------------------#'
+SET @@global.key_buffer_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+61440
+SET @@global.key_buffer_size = 4;
+Warnings:
+Warning	1292	Truncated incorrect key_buffer_size value: '4'
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.key_buffer_size = ON;
+ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+SET @@global.key_buffer_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+'#-------------------FN_DYNVARS_055_05----------------------------#'
+SET @@session.key_buffer_size = 0;
+ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_buffer_size = @min_key_buffer_size;
+@@key_buffer_size = @min_key_buffer_size
+1
+'#----------------------FN_DYNVARS_055_06------------------------#'
+SELECT @@global.key_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_buffer_size';
+@@global.key_buffer_size = VARIABLE_VALUE
+1
+SELECT @@key_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_buffer_size';
+@@key_buffer_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_055_07----------------------#'
+SET @@global.key_buffer_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect key_buffer_size value: '1'
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+SET @@global.key_buffer_size = FALSE;
+Warnings:
+Warning	1438	Cannot drop default keycache
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+'#---------------------FN_DYNVARS_055_08----------------------#'
+SET @@global.key_buffer_size = @min_key_buffer_size;
+SELECT @@key_buffer_size = @@global.key_buffer_size;
+@@key_buffer_size = @@global.key_buffer_size
+1
+'#---------------------FN_DYNVARS_055_09----------------------#'
+SET key_buffer_size = @min_key_buffer_size;
+ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_buffer_size = @min_key_buffer_size;
+@@key_buffer_size = @min_key_buffer_size
+1
+SET local.key_buffer_size = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
+SELECT local.key_buffer_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.key_buffer_size = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
+SELECT global.key_buffer_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT key_buffer_size = @@session.key_buffer_size;
+ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
+SET @@global.key_buffer_size = @start_value;
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+1048576
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
new file mode 100644
index 00000000000..981988a1d4d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result
@@ -0,0 +1,111 @@
+SET @start_value = @@global.key_buffer_size;
+SELECT @start_value;
+@start_value
+1048576
+'#--------------------FN_DYNVARS_055_01------------------------#'
+SET @@global.key_buffer_size = 99;
+SET @@global.key_buffer_size = DEFAULT;
+ERROR 42000: Variable 'key_buffer_size' doesn't have a default value
+'Bug# 34878: This variable has default value according to documentation';
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+'#---------------------FN_DYNVARS_055_02-------------------------#'
+SET @@global.key_buffer_size = @start_value;
+SELECT @@global.key_buffer_size = @start_value;
+@@global.key_buffer_size = @start_value
+1
+'#--------------------FN_DYNVARS_055_03------------------------#'
+SET @@global.key_buffer_size = @min_key_buffer_size;
+SELECT @@global.key_buffer_size= @min_key_buffer_size;
+@@global.key_buffer_size= @min_key_buffer_size
+1
+SET @@global.key_buffer_size = 1800;
+Warnings:
+Warning	1292	Truncated incorrect key_buffer_size value: '1800'
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+SET @@global.key_buffer_size = 65535;
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+61440
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+'#--------------------FN_DYNVARS_055_04-------------------------#'
+SET @@global.key_buffer_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+61440
+SET @@global.key_buffer_size = 4;
+Warnings:
+Warning	1292	Truncated incorrect key_buffer_size value: '4'
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.key_buffer_size = ON;
+ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+SET @@global.key_buffer_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'key_buffer_size'
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+'#-------------------FN_DYNVARS_055_05----------------------------#'
+SET @@session.key_buffer_size = 0;
+ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_buffer_size = @min_key_buffer_size;
+@@key_buffer_size = @min_key_buffer_size
+1
+'#----------------------FN_DYNVARS_055_06------------------------#'
+SELECT @@global.key_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_buffer_size';
+@@global.key_buffer_size = VARIABLE_VALUE
+1
+SELECT @@key_buffer_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_buffer_size';
+@@key_buffer_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_055_07----------------------#'
+SET @@global.key_buffer_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect key_buffer_size value: '1'
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+SET @@global.key_buffer_size = FALSE;
+Warnings:
+Warning	1438	Cannot drop default keycache
+SELECT @@global.key_buffer_size = @min_key_buffer_size;
+@@global.key_buffer_size = @min_key_buffer_size
+1
+'#---------------------FN_DYNVARS_055_08----------------------#'
+SET @@global.key_buffer_size = @min_key_buffer_size;
+SELECT @@key_buffer_size = @@global.key_buffer_size;
+@@key_buffer_size = @@global.key_buffer_size
+1
+'#---------------------FN_DYNVARS_055_09----------------------#'
+SET key_buffer_size = @min_key_buffer_size;
+ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_buffer_size = @min_key_buffer_size;
+@@key_buffer_size = @min_key_buffer_size
+1
+SET local.key_buffer_size = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
+SELECT local.key_buffer_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.key_buffer_size = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1
+SELECT global.key_buffer_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT key_buffer_size = @@session.key_buffer_size;
+ERROR 42S22: Unknown column 'key_buffer_size' in 'field list'
+SET @@global.key_buffer_size = @start_value;
+SELECT @@global.key_buffer_size;
+@@global.key_buffer_size
+1048576
diff --git a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result
new file mode 100644
index 00000000000..023b23ea425
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result
@@ -0,0 +1,126 @@
+SET @start_value = @@global.key_cache_age_threshold;
+SELECT @start_value;
+@start_value
+300
+'#--------------------FN_DYNVARS_056_01------------------------#'
+SET @@global.key_cache_age_threshold = 99;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '99'
+SET @@global.key_cache_age_threshold = DEFAULT;
+ERROR 42000: Variable 'key_cache_age_threshold' doesn't have a default value
+'Bug# 34878: This variable has default value according to documentation';
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+'#---------------------FN_DYNVARS_056_02-------------------------#'
+SET @@global.key_cache_age_threshold = @start_value;
+SELECT @@global.key_cache_age_threshold = 300;
+@@global.key_cache_age_threshold = 300
+1
+'#--------------------FN_DYNVARS_056_03------------------------#'
+SET @@global.key_cache_age_threshold = 100;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+SET @@global.key_cache_age_threshold = 4294967295;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+4294967200
+SET @@global.key_cache_age_threshold = 1800;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+1800
+SET @@global.key_cache_age_threshold = 65535;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+65500
+'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
+'#--------------------FN_DYNVARS_056_04-------------------------#'
+SET @@global.key_cache_age_threshold = -1;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+4294967200
+SET @@global.key_cache_age_threshold = 42949672951;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+4294967200
+SET @@global.key_cache_age_threshold = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+4294967200
+SET @@global.key_cache_age_threshold = -1024;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+4294966200
+SET @@global.key_cache_age_threshold = 99;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '99'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@global.key_cache_age_threshold = ON;
+ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+SET @@global.key_cache_age_threshold = 'test';
+ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+'#-------------------FN_DYNVARS_056_05----------------------------#'
+SET @@session.key_cache_age_threshold = 0;
+ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.key_cache_age_threshold;
+ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable
+'#----------------------FN_DYNVARS_056_06------------------------#'
+SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_age_threshold';
+@@global.key_cache_age_threshold = VARIABLE_VALUE
+1
+SELECT @@key_cache_age_threshold = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_age_threshold';
+@@key_cache_age_threshold = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_056_07----------------------#'
+SET @@global.key_cache_age_threshold = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '1'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+SET @@global.key_cache_age_threshold = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '0'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+'#---------------------FN_DYNVARS_056_08----------------------#'
+SET @@global.key_cache_age_threshold = 101;
+SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold;
+@@key_cache_age_threshold = @@global.key_cache_age_threshold
+1
+'#---------------------FN_DYNVARS_056_09----------------------#'
+SET key_cache_age_threshold = 8000;
+ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_cache_age_threshold;
+@@key_cache_age_threshold
+100
+SET local.key_cache_age_threshold = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1
+SELECT local.key_cache_age_threshold;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.key_cache_age_threshold = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1
+SELECT global.key_cache_age_threshold;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT key_cache_age_threshold = @@session.key_cache_age_threshold;
+ERROR 42S22: Unknown column 'key_cache_age_threshold' in 'field list'
+SET @@global.key_cache_age_threshold = @start_value;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+300
diff --git a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result
new file mode 100644
index 00000000000..5e05dd7bacf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result
@@ -0,0 +1,126 @@
+SET @start_value = @@global.key_cache_age_threshold;
+SELECT @start_value;
+@start_value
+300
+'#--------------------FN_DYNVARS_056_01------------------------#'
+SET @@global.key_cache_age_threshold = 99;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '99'
+SET @@global.key_cache_age_threshold = DEFAULT;
+ERROR 42000: Variable 'key_cache_age_threshold' doesn't have a default value
+'Bug# 34878: This variable has default value according to documentation';
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+'#---------------------FN_DYNVARS_056_02-------------------------#'
+SET @@global.key_cache_age_threshold = @start_value;
+SELECT @@global.key_cache_age_threshold = 300;
+@@global.key_cache_age_threshold = 300
+1
+'#--------------------FN_DYNVARS_056_03------------------------#'
+SET @@global.key_cache_age_threshold = 100;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+SET @@global.key_cache_age_threshold = 4294967295;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+4294967200
+SET @@global.key_cache_age_threshold = 1800;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+1800
+SET @@global.key_cache_age_threshold = 65535;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+65500
+'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
+'#--------------------FN_DYNVARS_056_04-------------------------#'
+SET @@global.key_cache_age_threshold = -1;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+18446744073709551600
+SET @@global.key_cache_age_threshold = 42949672951;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+42949672900
+SET @@global.key_cache_age_threshold = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+42949672900
+SET @@global.key_cache_age_threshold = -1024;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+18446744073709550500
+SET @@global.key_cache_age_threshold = 99;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '99'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@global.key_cache_age_threshold = ON;
+ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+SET @@global.key_cache_age_threshold = 'test';
+ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+'#-------------------FN_DYNVARS_056_05----------------------------#'
+SET @@session.key_cache_age_threshold = 0;
+ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.key_cache_age_threshold;
+ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable
+'#----------------------FN_DYNVARS_056_06------------------------#'
+SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_age_threshold';
+@@global.key_cache_age_threshold = VARIABLE_VALUE
+1
+SELECT @@key_cache_age_threshold = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_age_threshold';
+@@key_cache_age_threshold = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_056_07----------------------#'
+SET @@global.key_cache_age_threshold = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '1'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+SET @@global.key_cache_age_threshold = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_age_threshold value: '0'
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+100
+'#---------------------FN_DYNVARS_056_08----------------------#'
+SET @@global.key_cache_age_threshold = 101;
+SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold;
+@@key_cache_age_threshold = @@global.key_cache_age_threshold
+1
+'#---------------------FN_DYNVARS_056_09----------------------#'
+SET key_cache_age_threshold = 8000;
+ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_cache_age_threshold;
+@@key_cache_age_threshold
+100
+SET local.key_cache_age_threshold = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1
+SELECT local.key_cache_age_threshold;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.key_cache_age_threshold = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1
+SELECT global.key_cache_age_threshold;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT key_cache_age_threshold = @@session.key_cache_age_threshold;
+ERROR 42S22: Unknown column 'key_cache_age_threshold' in 'field list'
+SET @@global.key_cache_age_threshold = @start_value;
+SELECT @@global.key_cache_age_threshold;
+@@global.key_cache_age_threshold
+300
diff --git a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result
new file mode 100644
index 00000000000..ac78acb8244
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result
@@ -0,0 +1,142 @@
+SET @start_value = @@global.key_cache_block_size;
+SELECT @start_value;
+@start_value
+1024
+'#--------------------FN_DYNVARS_057_01------------------------#'
+SET @@global.key_cache_block_size = 600;
+SET @@global.key_cache_block_size = DEFAULT;
+ERROR 42000: Variable 'key_cache_block_size' doesn't have a default value
+'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+512
+'#---------------------FN_DYNVARS_057_02-------------------------#'
+SET @@global.key_cache_block_size = @start_value;
+SELECT @@global.key_cache_block_size = 1024;
+@@global.key_cache_block_size = 1024
+1
+'#--------------------FN_DYNVARS_057_03------------------------#'
+SET @@global.key_cache_block_size = 1024;
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+1024
+SET @@global.key_cache_block_size = 16384;
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = 1800;
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+1536
+SET @@global.key_cache_block_size = 16383;
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+15872
+'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
+'#--------------------FN_DYNVARS_057_04-------------------------#'
+SET @@global.key_cache_block_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '4294967295'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = 42949672951;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '4294967287'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '4294966272'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = 256;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '256'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+512
+SET @@global.key_cache_block_size = 511;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '511'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+512
+SET @@global.key_cache_block_size = 16385;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '16385'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@global.key_cache_block_size = ON;
+ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+'#-------------------FN_DYNVARS_057_05----------------------------#'
+SET @@session.key_cache_block_size = 0;
+ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.key_cache_block_size;
+ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable
+'#----------------------FN_DYNVARS_057_06------------------------#'
+SELECT @@global.key_cache_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_block_size';
+@@global.key_cache_block_size = VARIABLE_VALUE
+1
+SELECT @@key_cache_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_block_size';
+@@key_cache_block_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_057_07----------------------#'
+SET @@global.key_cache_block_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '1'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+512
+SET @@global.key_cache_block_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '0'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+512
+'#---------------------FN_DYNVARS_057_08----------------------#'
+SET @@global.key_cache_block_size = 1024;
+SELECT @@key_cache_block_size = @@global.key_cache_block_size;
+@@key_cache_block_size = @@global.key_cache_block_size
+1
+'#---------------------FN_DYNVARS_057_09----------------------#'
+SET key_cache_block_size = 8000;
+ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_cache_block_size;
+@@key_cache_block_size
+1024
+SET local.key_cache_block_size = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1
+SELECT local.key_cache_block_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.key_cache_block_size = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1
+SELECT global.key_cache_block_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT key_cache_block_size = @@session.key_cache_block_size;
+ERROR 42S22: Unknown column 'key_cache_block_size' in 'field list'
+SET @@global.key_cache_block_size = @start_value;
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+1024
diff --git a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result
new file mode 100644
index 00000000000..46ce1f26b29
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result
@@ -0,0 +1,142 @@
+SET @start_value = @@global.key_cache_block_size;
+SELECT @start_value;
+@start_value
+1024
+'#--------------------FN_DYNVARS_057_01------------------------#'
+SET @@global.key_cache_block_size = 600;
+SET @@global.key_cache_block_size = DEFAULT;
+ERROR 42000: Variable 'key_cache_block_size' doesn't have a default value
+'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+512
+'#---------------------FN_DYNVARS_057_02-------------------------#'
+SET @@global.key_cache_block_size = @start_value;
+SELECT @@global.key_cache_block_size = 1024;
+@@global.key_cache_block_size = 1024
+1
+'#--------------------FN_DYNVARS_057_03------------------------#'
+SET @@global.key_cache_block_size = 1024;
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+1024
+SET @@global.key_cache_block_size = 16384;
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = 1800;
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+1536
+SET @@global.key_cache_block_size = 16383;
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+15872
+'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming';
+'#--------------------FN_DYNVARS_057_04-------------------------#'
+SET @@global.key_cache_block_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '18446744073709551615'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = 42949672951;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '42949672951'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '18446744073709550592'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = 256;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '256'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+512
+SET @@global.key_cache_block_size = 511;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '511'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+512
+SET @@global.key_cache_block_size = 16385;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '16385'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@global.key_cache_block_size = ON;
+ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+SET @@global.key_cache_block_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'key_cache_block_size'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+16384
+'#-------------------FN_DYNVARS_057_05----------------------------#'
+SET @@session.key_cache_block_size = 0;
+ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.key_cache_block_size;
+ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable
+'#----------------------FN_DYNVARS_057_06------------------------#'
+SELECT @@global.key_cache_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_block_size';
+@@global.key_cache_block_size = VARIABLE_VALUE
+1
+SELECT @@key_cache_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_block_size';
+@@key_cache_block_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_057_07----------------------#'
+SET @@global.key_cache_block_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '1'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+512
+SET @@global.key_cache_block_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_block_size value: '0'
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+512
+'#---------------------FN_DYNVARS_057_08----------------------#'
+SET @@global.key_cache_block_size = 1024;
+SELECT @@key_cache_block_size = @@global.key_cache_block_size;
+@@key_cache_block_size = @@global.key_cache_block_size
+1
+'#---------------------FN_DYNVARS_057_09----------------------#'
+SET key_cache_block_size = 8000;
+ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_cache_block_size;
+@@key_cache_block_size
+1024
+SET local.key_cache_block_size = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1
+SELECT local.key_cache_block_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.key_cache_block_size = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1
+SELECT global.key_cache_block_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT key_cache_block_size = @@session.key_cache_block_size;
+ERROR 42S22: Unknown column 'key_cache_block_size' in 'field list'
+SET @@global.key_cache_block_size = @start_value;
+SELECT @@global.key_cache_block_size;
+@@global.key_cache_block_size
+1024
diff --git a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result
new file mode 100644
index 00000000000..5902dbcdf89
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result
@@ -0,0 +1,139 @@
+SET @start_value = @@global.key_cache_division_limit;
+SELECT @start_value;
+@start_value
+100
+'#--------------------FN_DYNVARS_058_01------------------------#'
+SET @@global.key_cache_division_limit = 50;
+SET @@global.key_cache_division_limit = DEFAULT;
+ERROR 42000: Variable 'key_cache_division_limit' doesn't have a default value
+'Bug# 34878: This variable has default value according to documentation';
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+50
+'#---------------------FN_DYNVARS_058_02-------------------------#'
+SET @@global.key_cache_division_limit = @start_value;
+SELECT @@global.key_cache_division_limit = 100;
+@@global.key_cache_division_limit = 100
+1
+'#--------------------FN_DYNVARS_058_03------------------------#'
+SET @@global.key_cache_division_limit = 1;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+1
+SET @@global.key_cache_division_limit = 50;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+50
+SET @@global.key_cache_division_limit = 99;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+99
+SET @@global.key_cache_division_limit = 2;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+2
+'#--------------------FN_DYNVARS_058_04-------------------------#'
+SET @@global.key_cache_division_limit = -1;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '4294967295'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = 101;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '101'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = -1024;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '4294966272'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = 0;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '0'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+1
+SET @@global.key_cache_division_limit = 200;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '200'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = 65535;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '65535'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@global.key_cache_division_limit = ON;
+ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = 'test';
+ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+'#-------------------FN_DYNVARS_058_05----------------------------#'
+SET @@session.key_cache_division_limit = 0;
+ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.key_cache_division_limit;
+ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable
+'#----------------------FN_DYNVARS_058_06------------------------#'
+SELECT @@global.key_cache_division_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_division_limit';
+@@global.key_cache_division_limit = VARIABLE_VALUE
+1
+SELECT @@key_cache_division_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_division_limit';
+@@key_cache_division_limit = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_058_07----------------------#'
+SET @@global.key_cache_division_limit = TRUE;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+1
+SET @@global.key_cache_division_limit = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '0'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+1
+'#---------------------FN_DYNVARS_058_08----------------------#'
+SET @@global.key_cache_division_limit = 90;
+SELECT @@key_cache_division_limit = @@global.key_cache_division_limit;
+@@key_cache_division_limit = @@global.key_cache_division_limit
+1
+'#---------------------FN_DYNVARS_058_09----------------------#'
+SET key_cache_division_limit = 80;
+ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_cache_division_limit;
+@@key_cache_division_limit
+90
+SET local.key_cache_division_limit = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1
+SELECT local.key_cache_division_limit;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.key_cache_division_limit = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1
+SELECT global.key_cache_division_limit;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT key_cache_division_limit = @@session.key_cache_division_limit;
+ERROR 42S22: Unknown column 'key_cache_division_limit' in 'field list'
+SET @@global.key_cache_division_limit = @start_value;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
diff --git a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result
new file mode 100644
index 00000000000..cd0cdcbca05
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result
@@ -0,0 +1,139 @@
+SET @start_value = @@global.key_cache_division_limit;
+SELECT @start_value;
+@start_value
+100
+'#--------------------FN_DYNVARS_058_01------------------------#'
+SET @@global.key_cache_division_limit = 50;
+SET @@global.key_cache_division_limit = DEFAULT;
+ERROR 42000: Variable 'key_cache_division_limit' doesn't have a default value
+'Bug# 34878: This variable has default value according to documentation';
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+50
+'#---------------------FN_DYNVARS_058_02-------------------------#'
+SET @@global.key_cache_division_limit = @start_value;
+SELECT @@global.key_cache_division_limit = 100;
+@@global.key_cache_division_limit = 100
+1
+'#--------------------FN_DYNVARS_058_03------------------------#'
+SET @@global.key_cache_division_limit = 1;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+1
+SET @@global.key_cache_division_limit = 50;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+50
+SET @@global.key_cache_division_limit = 99;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+99
+SET @@global.key_cache_division_limit = 2;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+2
+'#--------------------FN_DYNVARS_058_04-------------------------#'
+SET @@global.key_cache_division_limit = -1;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '18446744073709551615'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = 101;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '101'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = -1024;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '18446744073709550592'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = 0;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '0'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+1
+SET @@global.key_cache_division_limit = 200;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '200'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = 65535;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '65535'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+'Bug # 34837: Errors are not coming on assigning invalid values to variable'
+SET @@global.key_cache_division_limit = ON;
+ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+SET @@global.key_cache_division_limit = 'test';
+ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
+'#-------------------FN_DYNVARS_058_05----------------------------#'
+SET @@session.key_cache_division_limit = 0;
+ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.key_cache_division_limit;
+ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable
+'#----------------------FN_DYNVARS_058_06------------------------#'
+SELECT @@global.key_cache_division_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_division_limit';
+@@global.key_cache_division_limit = VARIABLE_VALUE
+1
+SELECT @@key_cache_division_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='key_cache_division_limit';
+@@key_cache_division_limit = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_058_07----------------------#'
+SET @@global.key_cache_division_limit = TRUE;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+1
+SET @@global.key_cache_division_limit = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect key_cache_division_limit value: '0'
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+1
+'#---------------------FN_DYNVARS_058_08----------------------#'
+SET @@global.key_cache_division_limit = 90;
+SELECT @@key_cache_division_limit = @@global.key_cache_division_limit;
+@@key_cache_division_limit = @@global.key_cache_division_limit
+1
+'#---------------------FN_DYNVARS_058_09----------------------#'
+SET key_cache_division_limit = 80;
+ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@key_cache_division_limit;
+@@key_cache_division_limit
+90
+SET local.key_cache_division_limit = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1
+SELECT local.key_cache_division_limit;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.key_cache_division_limit = 10;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1
+SELECT global.key_cache_division_limit;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT key_cache_division_limit = @@session.key_cache_division_limit;
+ERROR 42S22: Unknown column 'key_cache_division_limit' in 'field list'
+SET @@global.key_cache_division_limit = @start_value;
+SELECT @@global.key_cache_division_limit;
+@@global.key_cache_division_limit
+100
diff --git a/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result b/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
new file mode 100644
index 00000000000..702e95b1383
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result
@@ -0,0 +1,162 @@
+SET @start_global_value = @@global.log_warnings;
+SELECT @start_global_value;
+@start_global_value
+1
+SET @start_session_value = @@session.log_warnings;
+SELECT @start_session_value;
+@start_session_value
+1
+'#--------------------FN_DYNVARS_067_01-------------------------#'
+SET @@global.log_warnings = 100;
+SET @@global.log_warnings = DEFAULT;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+1
+SET @@session.log_warnings = 200;
+SET @@session.log_warnings = DEFAULT;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+1
+'#--------------------FN_DYNVARS_067_02-------------------------#'
+SET @@global.log_warnings = DEFAULT;
+SELECT @@global.log_warnings = 1;
+@@global.log_warnings = 1
+1
+SET @@session.log_warnings = DEFAULT;
+SELECT @@session.log_warnings = 1;
+@@session.log_warnings = 1
+1
+'#--------------------FN_DYNVARS_067_03-------------------------#'
+SET @@global.log_warnings = 0;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+0
+SET @@global.log_warnings = 1;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+1
+SET @@global.log_warnings = 60020;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+60020
+SET @@global.log_warnings = 65535;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+65535
+SET @@global.log_warnings = 65536;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+65536
+'#--------------------FN_DYNVARS_067_04-------------------------#'
+SET @@session.log_warnings = 0;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+0
+SET @@session.log_warnings = 1;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+1
+SET @@session.log_warnings = 50050;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+50050
+SET @@session.log_warnings = 65535;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+65535
+SET @@session.log_warnings = 65550;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+65550
+'#------------------FN_DYNVARS_067_05-----------------------#'
+SET @@global.log_warnings = 100000000000;
+Warnings:
+Warning	1292	Truncated incorrect log-warnings value: '100000000000'
+SELECT @@global.log_warnings;
+@@global.log_warnings
+4294967295
+SET @@global.log_warnings = -1024;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+0
+SET @@global.log_warnings = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.log_warnings;
+@@global.log_warnings
+0
+SET @@global.log_warnings = test;
+ERROR 42000: Incorrect argument type to variable 'log_warnings'
+SELECT @@global.log_warnings;
+@@global.log_warnings
+0
+SET @@session.log_warnings = 100000000000;
+Warnings:
+Warning	1292	Truncated incorrect log-warnings value: '100000000000'
+SELECT @@session.log_warnings;
+@@session.log_warnings
+4294967295
+SET @@session.log_warnings = -2;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+0
+SET @@session.log_warnings = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.log_warnings = test;
+ERROR 42000: Incorrect argument type to variable 'log_warnings'
+SELECT @@session.log_warnings;
+@@session.log_warnings
+0
+'#------------------FN_DYNVARS_067_06-----------------------#'
+SELECT @@global.log_warnings = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='log_warnings';
+@@global.log_warnings = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_067_07-----------------------#'
+SELECT @@session.log_warnings = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='log_warnings';
+@@session.log_warnings = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_067_08-----------------------#'
+SET @@global.log_warnings = TRUE;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+1
+SET @@global.log_warnings = FALSE;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+0
+'#---------------------FN_DYNVARS_067_09----------------------#'
+SET @@global.log_warnings = 10;
+SELECT @@log_warnings = @@global.log_warnings;
+@@log_warnings = @@global.log_warnings
+0
+'#---------------------FN_DYNVARS_067_10----------------------#'
+SET @@log_warnings = 100;
+SELECT @@log_warnings = @@local.log_warnings;
+@@log_warnings = @@local.log_warnings
+1
+SELECT @@local.log_warnings = @@session.log_warnings;
+@@local.log_warnings = @@session.log_warnings
+1
+'#---------------------FN_DYNVARS_067_11----------------------#'
+SET log_warnings = 1;
+SELECT @@log_warnings;
+@@log_warnings
+1
+SELECT local.log_warnings;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.log_warnings;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT log_warnings = @@session.log_warnings;
+ERROR 42S22: Unknown column 'log_warnings' in 'field list'
+SET @@global.log_warnings = @start_global_value;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+1
+SET @@session.log_warnings = @start_session_value;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+1
diff --git a/mysql-test/suite/sys_vars/r/log_warnings_basic_64.result b/mysql-test/suite/sys_vars/r/log_warnings_basic_64.result
new file mode 100644
index 00000000000..ba6671c87a4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_warnings_basic_64.result
@@ -0,0 +1,158 @@
+SET @start_global_value = @@global.log_warnings;
+SELECT @start_global_value;
+@start_global_value
+1
+SET @start_session_value = @@session.log_warnings;
+SELECT @start_session_value;
+@start_session_value
+1
+'#--------------------FN_DYNVARS_067_01-------------------------#'
+SET @@global.log_warnings = 100;
+SET @@global.log_warnings = DEFAULT;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+1
+SET @@session.log_warnings = 200;
+SET @@session.log_warnings = DEFAULT;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+1
+'#--------------------FN_DYNVARS_067_02-------------------------#'
+SET @@global.log_warnings = DEFAULT;
+SELECT @@global.log_warnings = 1;
+@@global.log_warnings = 1
+1
+SET @@session.log_warnings = DEFAULT;
+SELECT @@session.log_warnings = 1;
+@@session.log_warnings = 1
+1
+'#--------------------FN_DYNVARS_067_03-------------------------#'
+SET @@global.log_warnings = 0;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+0
+SET @@global.log_warnings = 1;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+1
+SET @@global.log_warnings = 60020;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+60020
+SET @@global.log_warnings = 65535;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+65535
+SET @@global.log_warnings = 65536;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+65536
+'#--------------------FN_DYNVARS_067_04-------------------------#'
+SET @@session.log_warnings = 0;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+0
+SET @@session.log_warnings = 1;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+1
+SET @@session.log_warnings = 50050;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+50050
+SET @@session.log_warnings = 65535;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+65535
+SET @@session.log_warnings = 65550;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+65550
+'#------------------FN_DYNVARS_067_05-----------------------#'
+SET @@global.log_warnings = 100000000000;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+100000000000
+SET @@global.log_warnings = -1024;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+0
+SET @@global.log_warnings = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.log_warnings;
+@@global.log_warnings
+0
+SET @@global.log_warnings = test;
+ERROR 42000: Incorrect argument type to variable 'log_warnings'
+SELECT @@global.log_warnings;
+@@global.log_warnings
+0
+SET @@session.log_warnings = 100000000000;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+100000000000
+SET @@session.log_warnings = -2;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+0
+SET @@session.log_warnings = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.log_warnings = test;
+ERROR 42000: Incorrect argument type to variable 'log_warnings'
+SELECT @@session.log_warnings;
+@@session.log_warnings
+0
+'#------------------FN_DYNVARS_067_06-----------------------#'
+SELECT @@global.log_warnings = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='log_warnings';
+@@global.log_warnings = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_067_07-----------------------#'
+SELECT @@session.log_warnings = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='log_warnings';
+@@session.log_warnings = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_067_08-----------------------#'
+SET @@global.log_warnings = TRUE;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+1
+SET @@global.log_warnings = FALSE;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+0
+'#---------------------FN_DYNVARS_067_09----------------------#'
+SET @@global.log_warnings = 10;
+SELECT @@log_warnings = @@global.log_warnings;
+@@log_warnings = @@global.log_warnings
+0
+'#---------------------FN_DYNVARS_067_10----------------------#'
+SET @@log_warnings = 100;
+SELECT @@log_warnings = @@local.log_warnings;
+@@log_warnings = @@local.log_warnings
+1
+SELECT @@local.log_warnings = @@session.log_warnings;
+@@local.log_warnings = @@session.log_warnings
+1
+'#---------------------FN_DYNVARS_067_11----------------------#'
+SET log_warnings = 1;
+SELECT @@log_warnings;
+@@log_warnings
+1
+SELECT local.log_warnings;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.log_warnings;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT log_warnings = @@session.log_warnings;
+ERROR 42S22: Unknown column 'log_warnings' in 'field list'
+SET @@global.log_warnings = @start_global_value;
+SELECT @@global.log_warnings;
+@@global.log_warnings
+1
+SET @@session.log_warnings = @start_session_value;
+SELECT @@session.log_warnings;
+@@session.log_warnings
+1
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result
new file mode 100644
index 00000000000..1dbeb50ff90
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result
@@ -0,0 +1,145 @@
+SET @start_value = @@global.max_binlog_cache_size;
+SELECT @start_value;
+@start_value
+4294967295
+'#--------------------FN_DYNVARS_072_01------------------------#'
+SET @@global.max_binlog_cache_size = 5000;
+SET @@global.max_binlog_cache_size = DEFAULT;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4294963200
+'#---------------------FN_DYNVARS_072_02-------------------------#'
+SET @@global.max_binlog_cache_size = @start_value;
+SELECT @@global.max_binlog_cache_size = 4294967295;
+@@global.max_binlog_cache_size = 4294967295
+0
+'Bug# 34876: Incorrect Default Value is assigned to variable';
+'#--------------------FN_DYNVARS_072_03------------------------#'
+SET @@global.max_binlog_cache_size = 4096;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 4294967295;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4294963200
+SET @@global.max_binlog_cache_size = 4294967294;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4294963200
+SET @@global.max_binlog_cache_size = 4097;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 65535;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+61440
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_072_04-------------------------#'
+SET @@global.max_binlog_cache_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 100000000000;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '100000000000'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4294963200
+SET @@global.max_binlog_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4294963200
+SET @@global.max_binlog_cache_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 1024;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '1024'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '4294967296'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4294963200
+SET @@global.max_binlog_cache_size = 4095;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '4095'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.max_binlog_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+'#-------------------FN_DYNVARS_072_05----------------------------#'
+SET @@session.max_binlog_cache_size = 4096;
+ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.max_binlog_cache_size;
+ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable
+'#----------------------FN_DYNVARS_072_06------------------------#'
+SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_binlog_cache_size';
+@@global.max_binlog_cache_size = VARIABLE_VALUE
+1
+SELECT @@max_binlog_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_binlog_cache_size';
+@@max_binlog_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_072_07----------------------#'
+SET @@global.max_binlog_cache_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '1'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+'#---------------------FN_DYNVARS_072_08----------------------#'
+SET @@global.max_binlog_cache_size = 5000;
+SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
+@@max_binlog_cache_size = @@global.max_binlog_cache_size
+1
+'#---------------------FN_DYNVARS_072_09----------------------#'
+SET max_binlog_cache_size = 6000;
+ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@max_binlog_cache_size;
+@@max_binlog_cache_size
+4096
+SET local.max_binlog_cache_size = 7000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 7000' at line 1
+SELECT local.max_binlog_cache_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.max_binlog_cache_size = 8000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 8000' at line 1
+SELECT global.max_binlog_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
+ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list'
+SET @@global.max_binlog_cache_size = @start_value;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4294963200
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result
new file mode 100644
index 00000000000..30db3f14dd4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result
@@ -0,0 +1,141 @@
+SET @start_value = @@global.max_binlog_cache_size;
+SELECT @start_value;
+@start_value
+18446744073709551615
+'#--------------------FN_DYNVARS_072_01------------------------#'
+SET @@global.max_binlog_cache_size = 5000;
+SET @@global.max_binlog_cache_size = DEFAULT;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+18446744073709547520
+'#---------------------FN_DYNVARS_072_02-------------------------#'
+SET @@global.max_binlog_cache_size = @start_value;
+SELECT @@global.max_binlog_cache_size = 4294967295;
+@@global.max_binlog_cache_size = 4294967295
+0
+'Bug# 34876: Incorrect Default Value is assigned to variable';
+'#--------------------FN_DYNVARS_072_03------------------------#'
+SET @@global.max_binlog_cache_size = 4096;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 4294967295;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4294963200
+SET @@global.max_binlog_cache_size = 4294967294;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4294963200
+SET @@global.max_binlog_cache_size = 4097;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 65535;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+61440
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_072_04-------------------------#'
+SET @@global.max_binlog_cache_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 100000000000;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+99999997952
+SET @@global.max_binlog_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+99999997952
+SET @@global.max_binlog_cache_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 1024;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '1024'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 4294967296;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4294967296
+SET @@global.max_binlog_cache_size = 4095;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '4095'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.max_binlog_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+'#-------------------FN_DYNVARS_072_05----------------------------#'
+SET @@session.max_binlog_cache_size = 4096;
+ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.max_binlog_cache_size;
+ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable
+'#----------------------FN_DYNVARS_072_06------------------------#'
+SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_binlog_cache_size';
+@@global.max_binlog_cache_size = VARIABLE_VALUE
+1
+SELECT @@max_binlog_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_binlog_cache_size';
+@@max_binlog_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_072_07----------------------#'
+SET @@global.max_binlog_cache_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '1'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+SET @@global.max_binlog_cache_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '0'
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+4096
+'#---------------------FN_DYNVARS_072_08----------------------#'
+SET @@global.max_binlog_cache_size = 5000;
+SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
+@@max_binlog_cache_size = @@global.max_binlog_cache_size
+1
+'#---------------------FN_DYNVARS_072_09----------------------#'
+SET max_binlog_cache_size = 6000;
+ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@max_binlog_cache_size;
+@@max_binlog_cache_size
+4096
+SET local.max_binlog_cache_size = 7000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 7000' at line 1
+SELECT local.max_binlog_cache_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.max_binlog_cache_size = 8000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 8000' at line 1
+SELECT global.max_binlog_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
+ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list'
+SET @@global.max_binlog_cache_size = @start_value;
+SELECT @@global.max_binlog_cache_size;
+@@global.max_binlog_cache_size
+18446744073709547520
diff --git a/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result
new file mode 100644
index 00000000000..b786e0ce31a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result
@@ -0,0 +1,137 @@
+SET @start_value = @@global.max_connect_errors;
+SELECT @start_value;
+@start_value
+10
+'#--------------------FN_DYNVARS_073_01------------------------#'
+SET @@global.max_connect_errors = 5000;
+SET @@global.max_connect_errors = DEFAULT;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+10
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#---------------------FN_DYNVARS_073_02-------------------------#'
+SET @@global.max_connect_errors = @start_value;
+SELECT @@global.max_connect_errors = 10;
+@@global.max_connect_errors = 10
+1
+'#--------------------FN_DYNVARS_073_03------------------------#'
+SET @@global.max_connect_errors = 4096;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4096
+SET @@global.max_connect_errors = 4294967294;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967294
+SET @@global.max_connect_errors = 4294967295;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967295
+SET @@global.max_connect_errors = 1;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+SET @@global.max_connect_errors = 2;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+2
+'Bug# 34877:  Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_073_04-------------------------#'
+SET @@global.max_connect_errors = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_connect_errors value: '0'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+SET @@global.max_connect_errors = 100000000000;
+Warnings:
+Warning	1292	Truncated incorrect max_connect_errors value: '100000000000'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967295
+SET @@global.max_connect_errors = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967295
+SET @@global.max_connect_errors = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_connect_errors value: '0'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+SET @@global.max_connect_errors = 0;
+Warnings:
+Warning	1292	Truncated incorrect max_connect_errors value: '0'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+SET @@global.max_connect_errors = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect max_connect_errors value: '4294967296'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967295
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.max_connect_errors = ON;
+ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967295
+SET @@global.max_connect_errors = 'test';
+ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967295
+'#-------------------FN_DYNVARS_073_05----------------------------#'
+SET @@session.max_connect_errors = 4096;
+ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.max_connect_errors;
+ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable
+'#----------------------FN_DYNVARS_073_06------------------------#'
+SELECT @@global.max_connect_errors = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_connect_errors';
+@@global.max_connect_errors = VARIABLE_VALUE
+1
+SELECT @@max_connect_errors = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_connect_errors';
+@@max_connect_errors = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_073_07----------------------#'
+SET @@global.max_connect_errors = TRUE;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+SET @@global.max_connect_errors = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_connect_errors value: '0'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+'#---------------------FN_DYNVARS_073_08----------------------#'
+SET @@global.max_connect_errors = 5000;
+SELECT @@max_connect_errors = @@global.max_connect_errors;
+@@max_connect_errors = @@global.max_connect_errors
+1
+'#---------------------FN_DYNVARS_073_09----------------------#'
+SET max_connect_errors = 6000;
+ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@max_connect_errors;
+@@max_connect_errors
+5000
+SET local.max_connect_errors = 7000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 7000' at line 1
+SELECT local.max_connect_errors;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.max_connect_errors = 8000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 8000' at line 1
+SELECT global.max_connect_errors;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT max_connect_errors = @@session.max_connect_errors;
+ERROR 42S22: Unknown column 'max_connect_errors' in 'field list'
+SET @@global.max_connect_errors = @start_value;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+10
diff --git a/mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result
new file mode 100644
index 00000000000..8117b650651
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result
@@ -0,0 +1,133 @@
+SET @start_value = @@global.max_connect_errors;
+SELECT @start_value;
+@start_value
+10
+'#--------------------FN_DYNVARS_073_01------------------------#'
+SET @@global.max_connect_errors = 5000;
+SET @@global.max_connect_errors = DEFAULT;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+10
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#---------------------FN_DYNVARS_073_02-------------------------#'
+SET @@global.max_connect_errors = @start_value;
+SELECT @@global.max_connect_errors = 10;
+@@global.max_connect_errors = 10
+1
+'#--------------------FN_DYNVARS_073_03------------------------#'
+SET @@global.max_connect_errors = 4096;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4096
+SET @@global.max_connect_errors = 4294967294;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967294
+SET @@global.max_connect_errors = 4294967295;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967295
+SET @@global.max_connect_errors = 1;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+SET @@global.max_connect_errors = 2;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+2
+'Bug# 34877:  Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_073_04-------------------------#'
+SET @@global.max_connect_errors = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_connect_errors value: '0'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+SET @@global.max_connect_errors = 100000000000;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+100000000000
+SET @@global.max_connect_errors = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+100000000000
+SET @@global.max_connect_errors = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_connect_errors value: '0'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+SET @@global.max_connect_errors = 0;
+Warnings:
+Warning	1292	Truncated incorrect max_connect_errors value: '0'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+SET @@global.max_connect_errors = 4294967296;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967296
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.max_connect_errors = ON;
+ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967296
+SET @@global.max_connect_errors = 'test';
+ERROR 42000: Incorrect argument type to variable 'max_connect_errors'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+4294967296
+'#-------------------FN_DYNVARS_073_05----------------------------#'
+SET @@session.max_connect_errors = 4096;
+ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.max_connect_errors;
+ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable
+'#----------------------FN_DYNVARS_073_06------------------------#'
+SELECT @@global.max_connect_errors = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_connect_errors';
+@@global.max_connect_errors = VARIABLE_VALUE
+1
+SELECT @@max_connect_errors = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_connect_errors';
+@@max_connect_errors = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_073_07----------------------#'
+SET @@global.max_connect_errors = TRUE;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+SET @@global.max_connect_errors = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_connect_errors value: '0'
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+1
+'#---------------------FN_DYNVARS_073_08----------------------#'
+SET @@global.max_connect_errors = 5000;
+SELECT @@max_connect_errors = @@global.max_connect_errors;
+@@max_connect_errors = @@global.max_connect_errors
+1
+'#---------------------FN_DYNVARS_073_09----------------------#'
+SET max_connect_errors = 6000;
+ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@max_connect_errors;
+@@max_connect_errors
+5000
+SET local.max_connect_errors = 7000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 7000' at line 1
+SELECT local.max_connect_errors;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.max_connect_errors = 8000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 8000' at line 1
+SELECT global.max_connect_errors;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT max_connect_errors = @@session.max_connect_errors;
+ERROR 42S22: Unknown column 'max_connect_errors' in 'field list'
+SET @@global.max_connect_errors = @start_value;
+SELECT @@global.max_connect_errors;
+@@global.max_connect_errors
+10
diff --git a/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result
new file mode 100644
index 00000000000..04eaa3ddd19
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result
@@ -0,0 +1,196 @@
+SET @start_global_value = @@global.max_heap_table_size;
+SELECT @start_global_value;
+@start_global_value
+1048576
+SET @start_session_value = @@session.max_heap_table_size;
+SELECT @start_session_value;
+@start_session_value
+1048576
+'#--------------------FN_DYNVARS_077_01-------------------------#'
+SET @@global.max_heap_table_size = 1677721610;
+SET @@global.max_heap_table_size = DEFAULT;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16777216
+SET @@session.max_heap_table_size = 1677721610;
+SET @@session.max_heap_table_size = DEFAULT;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+16777216
+'#--------------------FN_DYNVARS_077_02-------------------------#'
+SET @@global.max_heap_table_size = DEFAULT;
+SELECT @@global.max_heap_table_size = 16777216;
+@@global.max_heap_table_size = 16777216
+1
+SET @@session.max_heap_table_size = DEFAULT;
+SELECT @@session.max_heap_table_size = 16777216;
+@@session.max_heap_table_size = 16777216
+1
+'#--------------------FN_DYNVARS_077_03-------------------------#'
+SET @@global.max_heap_table_size = 16384;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = 16385;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = 65535;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+64512
+SET @@global.max_heap_table_size = 4294967294;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+4294966272
+SET @@global.max_heap_table_size = 4294967295;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+4294966272
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_077_04-------------------------#'
+SET @@session.max_heap_table_size = 16384;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+16384
+SET @@session.max_heap_table_size = 16385;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+16384
+SET @@session.max_heap_table_size = 65535;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+64512
+SET @@session.max_heap_table_size = 4294967294;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+4294966272
+SET @@session.max_heap_table_size = 4294967295;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+4294966272
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#------------------FN_DYNVARS_077_05-----------------------#'
+SET @@global.max_heap_table_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = 1024;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '1024'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = 16383;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '16383'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = 4294967296;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+4294966272
+SET @@global.max_heap_table_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+4294966272
+SET @@global.max_heap_table_size = test;
+ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+4294966272
+SET @@session.max_heap_table_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+16384
+SET @@session.max_heap_table_size = 16383;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '16383'
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+16384
+SET @@session.max_heap_table_size = 4294967296;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+4294966272
+SET @@session.max_heap_table_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_heap_table_size = 10737418241;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+4294966272
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.max_heap_table_size = test;
+ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+4294966272
+'#------------------FN_DYNVARS_077_06-----------------------#'
+SELECT @@global.max_heap_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_heap_table_size';
+@@global.max_heap_table_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_077_07-----------------------#'
+SELECT @@session.max_heap_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_heap_table_size';
+@@session.max_heap_table_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_077_08-----------------------#'
+SET @@global.max_heap_table_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '1'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+'#---------------------FN_DYNVARS_077_09----------------------#'
+SET @@global.max_heap_table_size = 163845;
+SELECT @@max_heap_table_size = @@global.max_heap_table_size;
+@@max_heap_table_size = @@global.max_heap_table_size
+0
+'#---------------------FN_DYNVARS_077_10----------------------#'
+SET @@max_heap_table_size = 16777216;
+SELECT @@max_heap_table_size = @@local.max_heap_table_size;
+@@max_heap_table_size = @@local.max_heap_table_size
+1
+SELECT @@local.max_heap_table_size = @@session.max_heap_table_size;
+@@local.max_heap_table_size = @@session.max_heap_table_size
+1
+'#---------------------FN_DYNVARS_077_11----------------------#'
+SET max_heap_table_size = 316777216;
+SELECT @@max_heap_table_size;
+@@max_heap_table_size
+316776448
+SELECT local.max_heap_table_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.max_heap_table_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT max_heap_table_size = @@session.max_heap_table_size;
+ERROR 42S22: Unknown column 'max_heap_table_size' in 'field list'
+SET @@global.max_heap_table_size = @start_global_value;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+1048576
+SET @@session.max_heap_table_size = @start_session_value;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+1048576
diff --git a/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result
new file mode 100644
index 00000000000..ebab80f376b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result
@@ -0,0 +1,196 @@
+SET @start_global_value = @@global.max_heap_table_size;
+SELECT @start_global_value;
+@start_global_value
+1048576
+SET @start_session_value = @@session.max_heap_table_size;
+SELECT @start_session_value;
+@start_session_value
+1048576
+'#--------------------FN_DYNVARS_077_01-------------------------#'
+SET @@global.max_heap_table_size = 1677721610;
+SET @@global.max_heap_table_size = DEFAULT;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16777216
+SET @@session.max_heap_table_size = 1677721610;
+SET @@session.max_heap_table_size = DEFAULT;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+16777216
+'#--------------------FN_DYNVARS_077_02-------------------------#'
+SET @@global.max_heap_table_size = DEFAULT;
+SELECT @@global.max_heap_table_size = 16777216;
+@@global.max_heap_table_size = 16777216
+1
+SET @@session.max_heap_table_size = DEFAULT;
+SELECT @@session.max_heap_table_size = 16777216;
+@@session.max_heap_table_size = 16777216
+1
+'#--------------------FN_DYNVARS_077_03-------------------------#'
+SET @@global.max_heap_table_size = 16384;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = 16385;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = 65535;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+64512
+SET @@global.max_heap_table_size = 4294967294;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+4294966272
+SET @@global.max_heap_table_size = 4294967295;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+4294966272
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_077_04-------------------------#'
+SET @@session.max_heap_table_size = 16384;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+16384
+SET @@session.max_heap_table_size = 16385;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+16384
+SET @@session.max_heap_table_size = 65535;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+64512
+SET @@session.max_heap_table_size = 4294967294;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+4294966272
+SET @@session.max_heap_table_size = 4294967295;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+4294966272
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#------------------FN_DYNVARS_077_05-----------------------#'
+SET @@global.max_heap_table_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = 1024;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '1024'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = 16383;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '16383'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = 4294967296;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+4294967296
+SET @@global.max_heap_table_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+4294967296
+SET @@global.max_heap_table_size = test;
+ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+4294967296
+SET @@session.max_heap_table_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+16384
+SET @@session.max_heap_table_size = 16383;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '16383'
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+16384
+SET @@session.max_heap_table_size = 4294967296;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+4294967296
+SET @@session.max_heap_table_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_heap_table_size = 10737418241;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+10737418240
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.max_heap_table_size = test;
+ERROR 42000: Incorrect argument type to variable 'max_heap_table_size'
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+10737418240
+'#------------------FN_DYNVARS_077_06-----------------------#'
+SELECT @@global.max_heap_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_heap_table_size';
+@@global.max_heap_table_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_077_07-----------------------#'
+SELECT @@session.max_heap_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_heap_table_size';
+@@session.max_heap_table_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_077_08-----------------------#'
+SET @@global.max_heap_table_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '1'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+SET @@global.max_heap_table_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '0'
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+16384
+'#---------------------FN_DYNVARS_077_09----------------------#'
+SET @@global.max_heap_table_size = 163845;
+SELECT @@max_heap_table_size = @@global.max_heap_table_size;
+@@max_heap_table_size = @@global.max_heap_table_size
+0
+'#---------------------FN_DYNVARS_077_10----------------------#'
+SET @@max_heap_table_size = 16777216;
+SELECT @@max_heap_table_size = @@local.max_heap_table_size;
+@@max_heap_table_size = @@local.max_heap_table_size
+1
+SELECT @@local.max_heap_table_size = @@session.max_heap_table_size;
+@@local.max_heap_table_size = @@session.max_heap_table_size
+1
+'#---------------------FN_DYNVARS_077_11----------------------#'
+SET max_heap_table_size = 316777216;
+SELECT @@max_heap_table_size;
+@@max_heap_table_size
+316776448
+SELECT local.max_heap_table_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.max_heap_table_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT max_heap_table_size = @@session.max_heap_table_size;
+ERROR 42S22: Unknown column 'max_heap_table_size' in 'field list'
+SET @@global.max_heap_table_size = @start_global_value;
+SELECT @@global.max_heap_table_size;
+@@global.max_heap_table_size
+1048576
+SET @@session.max_heap_table_size = @start_session_value;
+SELECT @@session.max_heap_table_size;
+@@session.max_heap_table_size
+1048576
diff --git a/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result
new file mode 100644
index 00000000000..64828fbe619
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result
@@ -0,0 +1,180 @@
+SET @start_global_value = @@global.max_seeks_for_key;
+SELECT @start_global_value;
+@start_global_value
+4294967295
+SET @start_session_value = @@session.max_seeks_for_key;
+SELECT @start_session_value;
+@start_session_value
+4294967295
+'#--------------------FN_DYNVARS_083_01-------------------------#'
+SET @@global.max_seeks_for_key = 100;
+SET @@global.max_seeks_for_key = DEFAULT;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967295
+SET @@session.max_seeks_for_key = 200;
+SET @@session.max_seeks_for_key = DEFAULT;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+4294967295
+'#--------------------FN_DYNVARS_083_02-------------------------#'
+SET @@global.max_seeks_for_key = DEFAULT;
+SELECT @@global.max_seeks_for_key = 4294967295;
+@@global.max_seeks_for_key = 4294967295
+1
+SET @@session.max_seeks_for_key = DEFAULT;
+SELECT @@session.max_seeks_for_key = 4294967295;
+@@session.max_seeks_for_key = 4294967295
+1
+'#--------------------FN_DYNVARS_083_03-------------------------#'
+SET @@global.max_seeks_for_key = 1;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+1
+SET @@global.max_seeks_for_key = 2;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+2
+SET @@global.max_seeks_for_key = 65536;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+65536
+SET @@global.max_seeks_for_key = 4294967295;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967295
+SET @@global.max_seeks_for_key = 4294967294;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967294
+'#--------------------FN_DYNVARS_083_04-------------------------#'
+SET @@session.max_seeks_for_key = 1;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+1
+SET @@session.max_seeks_for_key = 2;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+2
+SET @@session.max_seeks_for_key = 4294967295;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+4294967295
+SET @@session.max_seeks_for_key = 4294967294;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+4294967294
+SET @@session.max_seeks_for_key = 65535;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+65535
+'#------------------FN_DYNVARS_083_05-----------------------#'
+SET @@global.max_seeks_for_key = 0;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+1
+SET @@global.max_seeks_for_key = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+1
+SET @@global.max_seeks_for_key = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '4294967296'
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967295
+SET @@global.max_seeks_for_key = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967295
+SET @@global.max_seeks_for_key = test;
+ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967295
+SET @@session.max_seeks_for_key = 0;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+1
+SET @@session.max_seeks_for_key = -2;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+1
+SET @@session.max_seeks_for_key = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_seeks_for_key = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '4294967296'
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+4294967295
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.max_seeks_for_key = test;
+ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+4294967295
+'#------------------FN_DYNVARS_083_06-----------------------#'
+SELECT @@global.max_seeks_for_key = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_seeks_for_key';
+@@global.max_seeks_for_key = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_083_07-----------------------#'
+SELECT @@session.max_seeks_for_key = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_seeks_for_key';
+@@session.max_seeks_for_key = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_083_08-----------------------#'
+SET @@global.max_seeks_for_key = TRUE;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+1
+SET @@global.max_seeks_for_key = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+1
+'#---------------------FN_DYNVARS_083_09----------------------#'
+SET @@global.max_seeks_for_key = 10;
+SELECT @@max_seeks_for_key = @@global.max_seeks_for_key;
+@@max_seeks_for_key = @@global.max_seeks_for_key
+0
+'#---------------------FN_DYNVARS_083_10----------------------#'
+SET @@max_seeks_for_key = 100;
+SELECT @@max_seeks_for_key = @@local.max_seeks_for_key;
+@@max_seeks_for_key = @@local.max_seeks_for_key
+1
+SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key;
+@@local.max_seeks_for_key = @@session.max_seeks_for_key
+1
+'#---------------------FN_DYNVARS_083_11----------------------#'
+SET max_seeks_for_key = 1;
+SELECT @@max_seeks_for_key;
+@@max_seeks_for_key
+1
+SELECT local.max_seeks_for_key;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.max_seeks_for_key;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT max_seeks_for_key = @@session.max_seeks_for_key;
+ERROR 42S22: Unknown column 'max_seeks_for_key' in 'field list'
+SET @@global.max_seeks_for_key = @start_global_value;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967295
+SET @@session.max_seeks_for_key = @start_session_value;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+4294967295
diff --git a/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result
new file mode 100644
index 00000000000..eefb829cdae
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result
@@ -0,0 +1,176 @@
+SET @start_global_value = @@global.max_seeks_for_key;
+SELECT @start_global_value;
+@start_global_value
+18446744073709551615
+SET @start_session_value = @@session.max_seeks_for_key;
+SELECT @start_session_value;
+@start_session_value
+18446744073709551615
+'#--------------------FN_DYNVARS_083_01-------------------------#'
+SET @@global.max_seeks_for_key = 100;
+SET @@global.max_seeks_for_key = DEFAULT;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+18446744073709551615
+SET @@session.max_seeks_for_key = 200;
+SET @@session.max_seeks_for_key = DEFAULT;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+18446744073709551615
+'#--------------------FN_DYNVARS_083_02-------------------------#'
+SET @@global.max_seeks_for_key = DEFAULT;
+SELECT @@global.max_seeks_for_key = 4294967295;
+@@global.max_seeks_for_key = 4294967295
+0
+SET @@session.max_seeks_for_key = DEFAULT;
+SELECT @@session.max_seeks_for_key = 4294967295;
+@@session.max_seeks_for_key = 4294967295
+0
+'#--------------------FN_DYNVARS_083_03-------------------------#'
+SET @@global.max_seeks_for_key = 1;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+1
+SET @@global.max_seeks_for_key = 2;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+2
+SET @@global.max_seeks_for_key = 65536;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+65536
+SET @@global.max_seeks_for_key = 4294967295;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967295
+SET @@global.max_seeks_for_key = 4294967294;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967294
+'#--------------------FN_DYNVARS_083_04-------------------------#'
+SET @@session.max_seeks_for_key = 1;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+1
+SET @@session.max_seeks_for_key = 2;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+2
+SET @@session.max_seeks_for_key = 4294967295;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+4294967295
+SET @@session.max_seeks_for_key = 4294967294;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+4294967294
+SET @@session.max_seeks_for_key = 65535;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+65535
+'#------------------FN_DYNVARS_083_05-----------------------#'
+SET @@global.max_seeks_for_key = 0;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+1
+SET @@global.max_seeks_for_key = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+1
+SET @@global.max_seeks_for_key = 4294967296;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967296
+SET @@global.max_seeks_for_key = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967296
+SET @@global.max_seeks_for_key = test;
+ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+4294967296
+SET @@session.max_seeks_for_key = 0;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+1
+SET @@session.max_seeks_for_key = -2;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+1
+SET @@session.max_seeks_for_key = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_seeks_for_key = 4294967296;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+4294967296
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.max_seeks_for_key = test;
+ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key'
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+4294967296
+'#------------------FN_DYNVARS_083_06-----------------------#'
+SELECT @@global.max_seeks_for_key = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_seeks_for_key';
+@@global.max_seeks_for_key = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_083_07-----------------------#'
+SELECT @@session.max_seeks_for_key = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_seeks_for_key';
+@@session.max_seeks_for_key = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_083_08-----------------------#'
+SET @@global.max_seeks_for_key = TRUE;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+1
+SET @@global.max_seeks_for_key = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_seeks_for_key value: '0'
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+1
+'#---------------------FN_DYNVARS_083_09----------------------#'
+SET @@global.max_seeks_for_key = 10;
+SELECT @@max_seeks_for_key = @@global.max_seeks_for_key;
+@@max_seeks_for_key = @@global.max_seeks_for_key
+0
+'#---------------------FN_DYNVARS_083_10----------------------#'
+SET @@max_seeks_for_key = 100;
+SELECT @@max_seeks_for_key = @@local.max_seeks_for_key;
+@@max_seeks_for_key = @@local.max_seeks_for_key
+1
+SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key;
+@@local.max_seeks_for_key = @@session.max_seeks_for_key
+1
+'#---------------------FN_DYNVARS_083_11----------------------#'
+SET max_seeks_for_key = 1;
+SELECT @@max_seeks_for_key;
+@@max_seeks_for_key
+1
+SELECT local.max_seeks_for_key;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.max_seeks_for_key;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT max_seeks_for_key = @@session.max_seeks_for_key;
+ERROR 42S22: Unknown column 'max_seeks_for_key' in 'field list'
+SET @@global.max_seeks_for_key = @start_global_value;
+SELECT @@global.max_seeks_for_key;
+@@global.max_seeks_for_key
+18446744073709551615
+SET @@session.max_seeks_for_key = @start_session_value;
+SELECT @@session.max_seeks_for_key;
+@@session.max_seeks_for_key
+18446744073709551615
diff --git a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result
new file mode 100644
index 00000000000..5f959069661
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result
@@ -0,0 +1,197 @@
+SET @start_global_value = @@global.max_tmp_tables;
+SELECT @start_global_value;
+@start_global_value
+32
+SET @start_session_value = @@session.max_tmp_tables;
+SELECT @start_session_value;
+@start_session_value
+32
+'#--------------------FN_DYNVARS_086_01-------------------------#'
+SET @@global.max_tmp_tables = 1000;
+SET @@global.max_tmp_tables = DEFAULT;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+32
+SET @@session.max_tmp_tables = 1000;
+SET @@session.max_tmp_tables = DEFAULT;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+32
+'#--------------------FN_DYNVARS_086_02-------------------------#'
+SET @@global.max_tmp_tables = DEFAULT;
+SELECT @@global.max_tmp_tables = 32;
+@@global.max_tmp_tables = 32
+1
+SET @@session.max_tmp_tables = DEFAULT;
+SELECT @@session.max_tmp_tables = 32;
+@@session.max_tmp_tables = 32
+1
+'#--------------------FN_DYNVARS_086_03-------------------------#'
+SET @@global.max_tmp_tables = 1;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+1
+SET @@global.max_tmp_tables = 2;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+2
+SET @@global.max_tmp_tables = 65536;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+65536
+SET @@global.max_tmp_tables = 4294967295;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+4294967295
+SET @@global.max_tmp_tables = 4294967294;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+4294967294
+'#--------------------FN_DYNVARS_086_04-------------------------#'
+SET @@session.max_tmp_tables = 1;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+1
+SET @@session.max_tmp_tables = 2;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+2
+SET @@session.max_tmp_tables = 65536;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+65536
+SET @@session.max_tmp_tables = 4294967295;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+4294967295
+SET @@session.max_tmp_tables = 4294967294;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+4294967294
+'#------------------FN_DYNVARS_086_05-----------------------#'
+SET @@global.max_tmp_tables = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+1
+SET @@global.max_tmp_tables = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '4294967296'
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+4294967295
+SET @@global.max_tmp_tables = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+1
+SET @@global.max_tmp_tables = 429496729500;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '429496729500'
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+4294967295
+SET @@global.max_tmp_tables = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+4294967295
+SET @@global.max_tmp_tables = test;
+ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+4294967295
+SET @@session.max_tmp_tables = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '4294967296'
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+4294967295
+SET @@session.max_tmp_tables = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+1
+SET @@session.max_tmp_tables = 429496729500;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '429496729500'
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+4294967295
+SET @@session.max_tmp_tables = -001;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+1
+SET @@session.max_tmp_tables = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_tmp_tables = 10737418241;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '10737418241'
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+4294967295
+SET @@session.max_tmp_tables = test;
+ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+4294967295
+'#------------------FN_DYNVARS_086_06-----------------------#'
+SELECT @@global.max_tmp_tables = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_tmp_tables';
+@@global.max_tmp_tables = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_086_07-----------------------#'
+SELECT @@session.max_tmp_tables = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_tmp_tables';
+@@session.max_tmp_tables = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_086_08-----------------------#'
+SET @@global.max_tmp_tables = TRUE;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+1
+SET @@global.max_tmp_tables = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+1
+'#---------------------FN_DYNVARS_086_09----------------------#'
+SET @@global.max_tmp_tables = 20;
+SELECT @@max_tmp_tables = @@global.max_tmp_tables;
+@@max_tmp_tables = @@global.max_tmp_tables
+0
+'#---------------------FN_DYNVARS_086_10----------------------#'
+SET @@max_tmp_tables = 255;
+SELECT @@max_tmp_tables = @@local.max_tmp_tables;
+@@max_tmp_tables = @@local.max_tmp_tables
+1
+SELECT @@local.max_tmp_tables = @@session.max_tmp_tables;
+@@local.max_tmp_tables = @@session.max_tmp_tables
+1
+'#---------------------FN_DYNVARS_086_11----------------------#'
+SET max_tmp_tables = 102;
+SELECT @@max_tmp_tables;
+@@max_tmp_tables
+102
+SELECT local.max_tmp_tables;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.max_tmp_tables;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT max_tmp_tables = @@session.max_tmp_tables;
+ERROR 42S22: Unknown column 'max_tmp_tables' in 'field list'
+SET @@global.max_tmp_tables = @start_global_value;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+32
+SET @@session.max_tmp_tables = @start_session_value;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+32
diff --git a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result
new file mode 100644
index 00000000000..4b9f68c509e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result
@@ -0,0 +1,187 @@
+SET @start_global_value = @@global.max_tmp_tables;
+SELECT @start_global_value;
+@start_global_value
+32
+SET @start_session_value = @@session.max_tmp_tables;
+SELECT @start_session_value;
+@start_session_value
+32
+'#--------------------FN_DYNVARS_086_01-------------------------#'
+SET @@global.max_tmp_tables = 1000;
+SET @@global.max_tmp_tables = DEFAULT;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+32
+SET @@session.max_tmp_tables = 1000;
+SET @@session.max_tmp_tables = DEFAULT;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+32
+'#--------------------FN_DYNVARS_086_02-------------------------#'
+SET @@global.max_tmp_tables = DEFAULT;
+SELECT @@global.max_tmp_tables = 32;
+@@global.max_tmp_tables = 32
+1
+SET @@session.max_tmp_tables = DEFAULT;
+SELECT @@session.max_tmp_tables = 32;
+@@session.max_tmp_tables = 32
+1
+'#--------------------FN_DYNVARS_086_03-------------------------#'
+SET @@global.max_tmp_tables = 1;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+1
+SET @@global.max_tmp_tables = 2;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+2
+SET @@global.max_tmp_tables = 65536;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+65536
+SET @@global.max_tmp_tables = 4294967295;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+4294967295
+SET @@global.max_tmp_tables = 4294967294;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+4294967294
+'#--------------------FN_DYNVARS_086_04-------------------------#'
+SET @@session.max_tmp_tables = 1;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+1
+SET @@session.max_tmp_tables = 2;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+2
+SET @@session.max_tmp_tables = 65536;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+65536
+SET @@session.max_tmp_tables = 4294967295;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+4294967295
+SET @@session.max_tmp_tables = 4294967294;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+4294967294
+'#------------------FN_DYNVARS_086_05-----------------------#'
+SET @@global.max_tmp_tables = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+1
+SET @@global.max_tmp_tables = 4294967296;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+4294967296
+SET @@global.max_tmp_tables = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+1
+SET @@global.max_tmp_tables = 429496729500;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+429496729500
+SET @@global.max_tmp_tables = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+429496729500
+SET @@global.max_tmp_tables = test;
+ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+429496729500
+SET @@session.max_tmp_tables = 4294967296;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+4294967296
+SET @@session.max_tmp_tables = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+1
+SET @@session.max_tmp_tables = 429496729500;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+429496729500
+SET @@session.max_tmp_tables = -001;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+1
+SET @@session.max_tmp_tables = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.max_tmp_tables = 10737418241;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+10737418241
+SET @@session.max_tmp_tables = test;
+ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+10737418241
+'#------------------FN_DYNVARS_086_06-----------------------#'
+SELECT @@global.max_tmp_tables = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_tmp_tables';
+@@global.max_tmp_tables = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_086_07-----------------------#'
+SELECT @@session.max_tmp_tables = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='max_tmp_tables';
+@@session.max_tmp_tables = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_086_08-----------------------#'
+SET @@global.max_tmp_tables = TRUE;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+1
+SET @@global.max_tmp_tables = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_tmp_tables value: '0'
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+1
+'#---------------------FN_DYNVARS_086_09----------------------#'
+SET @@global.max_tmp_tables = 20;
+SELECT @@max_tmp_tables = @@global.max_tmp_tables;
+@@max_tmp_tables = @@global.max_tmp_tables
+0
+'#---------------------FN_DYNVARS_086_10----------------------#'
+SET @@max_tmp_tables = 255;
+SELECT @@max_tmp_tables = @@local.max_tmp_tables;
+@@max_tmp_tables = @@local.max_tmp_tables
+1
+SELECT @@local.max_tmp_tables = @@session.max_tmp_tables;
+@@local.max_tmp_tables = @@session.max_tmp_tables
+1
+'#---------------------FN_DYNVARS_086_11----------------------#'
+SET max_tmp_tables = 102;
+SELECT @@max_tmp_tables;
+@@max_tmp_tables
+102
+SELECT local.max_tmp_tables;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.max_tmp_tables;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT max_tmp_tables = @@session.max_tmp_tables;
+ERROR 42S22: Unknown column 'max_tmp_tables' in 'field list'
+SET @@global.max_tmp_tables = @start_global_value;
+SELECT @@global.max_tmp_tables;
+@@global.max_tmp_tables
+32
+SET @@session.max_tmp_tables = @start_session_value;
+SELECT @@session.max_tmp_tables;
+@@session.max_tmp_tables
+32
diff --git a/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result
new file mode 100644
index 00000000000..0c9c3c00c1f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result
@@ -0,0 +1,108 @@
+SET @start_global_value = @@global.max_write_lock_count;
+SELECT @start_global_value;
+@start_global_value
+4294967295
+'#--------------------FN_DYNVARS_088_01-------------------------#'
+SET @@global.max_write_lock_count = 1000;
+SET @@global.max_write_lock_count = DEFAULT;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967295
+'#--------------------FN_DYNVARS_088_02-------------------------#'
+SET @@global.max_write_lock_count = DEFAULT;
+SELECT @@global.max_write_lock_count = 4294967295;
+@@global.max_write_lock_count = 4294967295
+1
+'#--------------------FN_DYNVARS_088_03-------------------------#'
+SET @@global.max_write_lock_count = 1;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+1
+SET @@global.max_write_lock_count = 2;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+2
+SET @@global.max_write_lock_count = 65536;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+65536
+SET @@global.max_write_lock_count = 4294967295;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967295
+SET @@global.max_write_lock_count = 4294967294;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967294
+'#------------------FN_DYNVARS_088_04-----------------------#'
+SET @@global.max_write_lock_count = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_write_lock_count value: '0'
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+1
+SET @@global.max_write_lock_count = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect max_write_lock_count value: '4294967296'
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967295
+SET @@global.max_write_lock_count = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_write_lock_count value: '0'
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+1
+SET @@global.max_write_lock_count = 429496729500;
+Warnings:
+Warning	1292	Truncated incorrect max_write_lock_count value: '429496729500'
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967295
+SET @@global.max_write_lock_count = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967295
+SET @@global.max_write_lock_count = test;
+ERROR 42000: Incorrect argument type to variable 'max_write_lock_count'
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967295
+'#------------------FN_DYNVARS_088_05-----------------------#'
+SELECT @@global.max_write_lock_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_write_lock_count';
+@@global.max_write_lock_count = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_088_06-----------------------#'
+SET @@global.max_write_lock_count = TRUE;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+1
+SET @@global.max_write_lock_count = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_write_lock_count value: '0'
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+1
+'#---------------------FN_DYNVARS_088_07----------------------#'
+SET @@global.max_write_lock_count = 20;
+SELECT @@max_write_lock_count = @@global.max_write_lock_count;
+@@max_write_lock_count = @@global.max_write_lock_count
+1
+'#---------------------FN_DYNVARS_088_08----------------------#'
+SET @@global.max_write_lock_count = 102;
+SELECT @@max_write_lock_count;
+@@max_write_lock_count
+102
+SELECT local.max_write_lock_count;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT global.max_write_lock_count;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT max_write_lock_count = @@global.max_write_lock_count;
+ERROR 42S22: Unknown column 'max_write_lock_count' in 'field list'
+SET @@global.max_write_lock_count = @start_global_value;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967295
diff --git a/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result
new file mode 100644
index 00000000000..d74586841dd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result
@@ -0,0 +1,104 @@
+SET @start_global_value = @@global.max_write_lock_count;
+SELECT @start_global_value;
+@start_global_value
+18446744073709551615
+'#--------------------FN_DYNVARS_088_01-------------------------#'
+SET @@global.max_write_lock_count = 1000;
+SET @@global.max_write_lock_count = DEFAULT;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+18446744073709551615
+'#--------------------FN_DYNVARS_088_02-------------------------#'
+SET @@global.max_write_lock_count = DEFAULT;
+SELECT @@global.max_write_lock_count = 4294967295;
+@@global.max_write_lock_count = 4294967295
+0
+'#--------------------FN_DYNVARS_088_03-------------------------#'
+SET @@global.max_write_lock_count = 1;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+1
+SET @@global.max_write_lock_count = 2;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+2
+SET @@global.max_write_lock_count = 65536;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+65536
+SET @@global.max_write_lock_count = 4294967295;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967295
+SET @@global.max_write_lock_count = 4294967294;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967294
+'#------------------FN_DYNVARS_088_04-----------------------#'
+SET @@global.max_write_lock_count = -1024;
+Warnings:
+Warning	1292	Truncated incorrect max_write_lock_count value: '0'
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+1
+SET @@global.max_write_lock_count = 4294967296;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+4294967296
+SET @@global.max_write_lock_count = -1;
+Warnings:
+Warning	1292	Truncated incorrect max_write_lock_count value: '0'
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+1
+SET @@global.max_write_lock_count = 429496729500;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+429496729500
+SET @@global.max_write_lock_count = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+429496729500
+SET @@global.max_write_lock_count = test;
+ERROR 42000: Incorrect argument type to variable 'max_write_lock_count'
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+429496729500
+'#------------------FN_DYNVARS_088_05-----------------------#'
+SELECT @@global.max_write_lock_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='max_write_lock_count';
+@@global.max_write_lock_count = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_088_06-----------------------#'
+SET @@global.max_write_lock_count = TRUE;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+1
+SET @@global.max_write_lock_count = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect max_write_lock_count value: '0'
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+1
+'#---------------------FN_DYNVARS_088_07----------------------#'
+SET @@global.max_write_lock_count = 20;
+SELECT @@max_write_lock_count = @@global.max_write_lock_count;
+@@max_write_lock_count = @@global.max_write_lock_count
+1
+'#---------------------FN_DYNVARS_088_08----------------------#'
+SET @@global.max_write_lock_count = 102;
+SELECT @@max_write_lock_count;
+@@max_write_lock_count
+102
+SELECT local.max_write_lock_count;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT global.max_write_lock_count;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT max_write_lock_count = @@global.max_write_lock_count;
+ERROR 42S22: Unknown column 'max_write_lock_count' in 'field list'
+SET @@global.max_write_lock_count = @start_global_value;
+SELECT @@global.max_write_lock_count;
+@@global.max_write_lock_count
+18446744073709551615
diff --git a/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result
new file mode 100644
index 00000000000..c0315944a8a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result
@@ -0,0 +1,180 @@
+SET @start_global_value = @@global.min_examined_row_limit;
+SELECT @start_global_value;
+@start_global_value
+0
+SET @start_session_value = @@session.min_examined_row_limit;
+SELECT @start_session_value;
+@start_session_value
+0
+'#--------------------FN_DYNVARS_089_01-------------------------#'
+SET @@global.min_examined_row_limit = 100;
+SET @@global.min_examined_row_limit = DEFAULT;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+0
+SET @@session.min_examined_row_limit = 200;
+SET @@session.min_examined_row_limit = DEFAULT;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+0
+'#--------------------FN_DYNVARS_089_02-------------------------#'
+SET @@global.min_examined_row_limit = DEFAULT;
+SELECT @@global.min_examined_row_limit = 0;
+@@global.min_examined_row_limit = 0
+1
+SET @@session.min_examined_row_limit = DEFAULT;
+SELECT @@session.min_examined_row_limit = 0;
+@@session.min_examined_row_limit = 0
+1
+'#--------------------FN_DYNVARS_089_03-------------------------#'
+SET @@global.min_examined_row_limit = 0;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+0
+SET @@global.min_examined_row_limit = 1;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+1
+SET @@global.min_examined_row_limit = 60020;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+60020
+SET @@global.min_examined_row_limit = 65535;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+65535
+SET @@global.min_examined_row_limit = 4294967295;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+4294967295
+SET @@global.min_examined_row_limit = 4294967294;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+4294967294
+'#--------------------FN_DYNVARS_089_04-------------------------#'
+SET @@session.min_examined_row_limit = 0;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+0
+SET @@session.min_examined_row_limit = 1;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+1
+SET @@session.min_examined_row_limit = 50050;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+50050
+SET @@session.min_examined_row_limit = 65535;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+65535
+SET @@session.min_examined_row_limit = 4294967295;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+4294967295
+SET @@session.min_examined_row_limit = 4294967294;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+4294967294
+'#------------------FN_DYNVARS_089_05-----------------------#'
+SET @@global.min_examined_row_limit = 429496726;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+429496726
+SET @@global.min_examined_row_limit = -1024;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+0
+SET @@global.min_examined_row_limit = 429496729500;
+Warnings:
+Warning	1292	Truncated incorrect min_examined_row_limit value: '429496729500'
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+4294967295
+SET @@global.min_examined_row_limit = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+4294967295
+SET @@global.min_examined_row_limit = test;
+ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+4294967295
+SET @@session.min_examined_row_limit = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect min_examined_row_limit value: '4294967296'
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+4294967295
+SET @@session.min_examined_row_limit = -1;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+0
+SET @@session.min_examined_row_limit = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.min_examined_row_limit = 4294967295021;
+Warnings:
+Warning	1292	Truncated incorrect min_examined_row_limit value: '4294967295021'
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+4294967295
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.min_examined_row_limit = test;
+ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+4294967295
+'#------------------FN_DYNVARS_089_06-----------------------#'
+SELECT @@global.min_examined_row_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='min_examined_row_limit';
+@@global.min_examined_row_limit = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_089_07-----------------------#'
+SELECT @@session.min_examined_row_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='min_examined_row_limit';
+@@session.min_examined_row_limit = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_089_08-----------------------#'
+SET @@global.min_examined_row_limit = TRUE;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+1
+SET @@global.min_examined_row_limit = FALSE;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+0
+'#---------------------FN_DYNVARS_089_09----------------------#'
+SET @@global.min_examined_row_limit = 10;
+SELECT @@min_examined_row_limit = @@global.min_examined_row_limit;
+@@min_examined_row_limit = @@global.min_examined_row_limit
+0
+'#---------------------FN_DYNVARS_089_10----------------------#'
+SET @@min_examined_row_limit = 100;
+SELECT @@min_examined_row_limit = @@local.min_examined_row_limit;
+@@min_examined_row_limit = @@local.min_examined_row_limit
+1
+SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit;
+@@local.min_examined_row_limit = @@session.min_examined_row_limit
+1
+'#---------------------FN_DYNVARS_089_11----------------------#'
+SET min_examined_row_limit = 1;
+SELECT @@min_examined_row_limit;
+@@min_examined_row_limit
+1
+SELECT local.min_examined_row_limit;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.min_examined_row_limit;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT min_examined_row_limit = @@session.min_examined_row_limit;
+ERROR 42S22: Unknown column 'min_examined_row_limit' in 'field list'
+SET @@global.min_examined_row_limit = @start_global_value;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+0
+SET @@session.min_examined_row_limit = @start_session_value;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+0
diff --git a/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result
new file mode 100644
index 00000000000..fa11659c6c5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result
@@ -0,0 +1,174 @@
+SET @start_global_value = @@global.min_examined_row_limit;
+SELECT @start_global_value;
+@start_global_value
+0
+SET @start_session_value = @@session.min_examined_row_limit;
+SELECT @start_session_value;
+@start_session_value
+0
+'#--------------------FN_DYNVARS_089_01-------------------------#'
+SET @@global.min_examined_row_limit = 100;
+SET @@global.min_examined_row_limit = DEFAULT;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+0
+SET @@session.min_examined_row_limit = 200;
+SET @@session.min_examined_row_limit = DEFAULT;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+0
+'#--------------------FN_DYNVARS_089_02-------------------------#'
+SET @@global.min_examined_row_limit = DEFAULT;
+SELECT @@global.min_examined_row_limit = 0;
+@@global.min_examined_row_limit = 0
+1
+SET @@session.min_examined_row_limit = DEFAULT;
+SELECT @@session.min_examined_row_limit = 0;
+@@session.min_examined_row_limit = 0
+1
+'#--------------------FN_DYNVARS_089_03-------------------------#'
+SET @@global.min_examined_row_limit = 0;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+0
+SET @@global.min_examined_row_limit = 1;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+1
+SET @@global.min_examined_row_limit = 60020;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+60020
+SET @@global.min_examined_row_limit = 65535;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+65535
+SET @@global.min_examined_row_limit = 4294967295;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+4294967295
+SET @@global.min_examined_row_limit = 4294967294;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+4294967294
+'#--------------------FN_DYNVARS_089_04-------------------------#'
+SET @@session.min_examined_row_limit = 0;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+0
+SET @@session.min_examined_row_limit = 1;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+1
+SET @@session.min_examined_row_limit = 50050;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+50050
+SET @@session.min_examined_row_limit = 65535;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+65535
+SET @@session.min_examined_row_limit = 4294967295;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+4294967295
+SET @@session.min_examined_row_limit = 4294967294;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+4294967294
+'#------------------FN_DYNVARS_089_05-----------------------#'
+SET @@global.min_examined_row_limit = 429496726;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+429496726
+SET @@global.min_examined_row_limit = -1024;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+0
+SET @@global.min_examined_row_limit = 429496729500;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+429496729500
+SET @@global.min_examined_row_limit = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+429496729500
+SET @@global.min_examined_row_limit = test;
+ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+429496729500
+SET @@session.min_examined_row_limit = 4294967296;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+4294967296
+SET @@session.min_examined_row_limit = -1;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+0
+SET @@session.min_examined_row_limit = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.min_examined_row_limit = 4294967295021;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+4294967295021
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.min_examined_row_limit = test;
+ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit'
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+4294967295021
+'#------------------FN_DYNVARS_089_06-----------------------#'
+SELECT @@global.min_examined_row_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='min_examined_row_limit';
+@@global.min_examined_row_limit = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_089_07-----------------------#'
+SELECT @@session.min_examined_row_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='min_examined_row_limit';
+@@session.min_examined_row_limit = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_089_08-----------------------#'
+SET @@global.min_examined_row_limit = TRUE;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+1
+SET @@global.min_examined_row_limit = FALSE;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+0
+'#---------------------FN_DYNVARS_089_09----------------------#'
+SET @@global.min_examined_row_limit = 10;
+SELECT @@min_examined_row_limit = @@global.min_examined_row_limit;
+@@min_examined_row_limit = @@global.min_examined_row_limit
+0
+'#---------------------FN_DYNVARS_089_10----------------------#'
+SET @@min_examined_row_limit = 100;
+SELECT @@min_examined_row_limit = @@local.min_examined_row_limit;
+@@min_examined_row_limit = @@local.min_examined_row_limit
+1
+SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit;
+@@local.min_examined_row_limit = @@session.min_examined_row_limit
+1
+'#---------------------FN_DYNVARS_089_11----------------------#'
+SET min_examined_row_limit = 1;
+SELECT @@min_examined_row_limit;
+@@min_examined_row_limit
+1
+SELECT local.min_examined_row_limit;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.min_examined_row_limit;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT min_examined_row_limit = @@session.min_examined_row_limit;
+ERROR 42S22: Unknown column 'min_examined_row_limit' in 'field list'
+SET @@global.min_examined_row_limit = @start_global_value;
+SELECT @@global.min_examined_row_limit;
+@@global.min_examined_row_limit
+0
+SET @@session.min_examined_row_limit = @start_session_value;
+SELECT @@session.min_examined_row_limit;
+@@session.min_examined_row_limit
+0
diff --git a/mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result b/mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result
new file mode 100644
index 00000000000..f6ac6490479
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result
@@ -0,0 +1,192 @@
+SET @start_global_value = @@global.multi_range_count;
+SELECT @start_global_value;
+@start_global_value
+256
+SET @start_session_value = @@session.multi_range_count;
+SELECT @start_session_value;
+@start_session_value
+256
+'#--------------------FN_DYNVARS_090_01-------------------------#'
+SET @@global.multi_range_count = 100;
+SET @@global.multi_range_count = DEFAULT;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+256
+SET @@session.multi_range_count = 200;
+SET @@session.multi_range_count = DEFAULT;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+256
+'#--------------------FN_DYNVARS_090_02-------------------------#'
+SET @@global.multi_range_count = DEFAULT;
+SELECT @@global.multi_range_count = 256;
+@@global.multi_range_count = 256
+1
+SET @@session.multi_range_count = DEFAULT;
+SELECT @@session.multi_range_count = 256;
+@@session.multi_range_count = 256
+1
+'#--------------------FN_DYNVARS_090_03-------------------------#'
+SET @@global.multi_range_count = 1;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+1
+SET @@global.multi_range_count = 60020;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+60020
+SET @@global.multi_range_count = 65535;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+65535
+SET @@global.multi_range_count = 4294967295;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+4294967295
+SET @@global.multi_range_count = 4294967294;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+4294967294
+'#--------------------FN_DYNVARS_090_04-------------------------#'
+SET @@session.multi_range_count = 1;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+1
+SET @@session.multi_range_count = 50050;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+50050
+SET @@session.multi_range_count = 65535;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+65535
+SET @@session.multi_range_count = 4294967295;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+4294967295
+SET @@session.multi_range_count = 4294967294;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+4294967294
+'#------------------FN_DYNVARS_090_05-----------------------#'
+SET @@global.multi_range_count = 0;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '0'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+1
+SET @@global.multi_range_count = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '4294967296'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+4294967295
+SET @@global.multi_range_count = -1024;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '0'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+1
+SET @@global.multi_range_count = 429496729500;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '429496729500'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+4294967295
+SET @@global.multi_range_count = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'multi_range_count'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+4294967295
+SET @@global.multi_range_count = test;
+ERROR 42000: Incorrect argument type to variable 'multi_range_count'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+4294967295
+SET @@session.multi_range_count = 0;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '0'
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+1
+SET @@session.multi_range_count = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '4294967296'
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+4294967295
+SET @@session.multi_range_count = -1;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '0'
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+1
+SET @@session.multi_range_count = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.multi_range_count = 4294967295021;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '4294967295021'
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+4294967295
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.multi_range_count = test;
+ERROR 42000: Incorrect argument type to variable 'multi_range_count'
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+4294967295
+'#------------------FN_DYNVARS_090_06-----------------------#'
+SELECT @@global.multi_range_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='multi_range_count';
+@@global.multi_range_count = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_090_07-----------------------#'
+SELECT @@session.multi_range_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='multi_range_count';
+@@session.multi_range_count = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_090_08-----------------------#'
+SET @@global.multi_range_count = TRUE;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+1
+SET @@global.multi_range_count = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '0'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+1
+'#---------------------FN_DYNVARS_090_09----------------------#'
+SET @@global.multi_range_count = 10;
+SELECT @@multi_range_count = @@global.multi_range_count;
+@@multi_range_count = @@global.multi_range_count
+0
+'#---------------------FN_DYNVARS_090_10----------------------#'
+SET @@multi_range_count = 100;
+SELECT @@multi_range_count = @@local.multi_range_count;
+@@multi_range_count = @@local.multi_range_count
+1
+SELECT @@local.multi_range_count = @@session.multi_range_count;
+@@local.multi_range_count = @@session.multi_range_count
+1
+'#---------------------FN_DYNVARS_090_11----------------------#'
+SET multi_range_count = 1;
+SELECT @@multi_range_count;
+@@multi_range_count
+1
+SELECT local.multi_range_count;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.multi_range_count;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT multi_range_count = @@session.multi_range_count;
+ERROR 42S22: Unknown column 'multi_range_count' in 'field list'
+SET @@global.multi_range_count = @start_global_value;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+256
+SET @@session.multi_range_count = @start_session_value;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+256
diff --git a/mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result b/mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result
new file mode 100644
index 00000000000..f2115aec2e2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result
@@ -0,0 +1,184 @@
+SET @start_global_value = @@global.multi_range_count;
+SELECT @start_global_value;
+@start_global_value
+256
+SET @start_session_value = @@session.multi_range_count;
+SELECT @start_session_value;
+@start_session_value
+256
+'#--------------------FN_DYNVARS_090_01-------------------------#'
+SET @@global.multi_range_count = 100;
+SET @@global.multi_range_count = DEFAULT;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+256
+SET @@session.multi_range_count = 200;
+SET @@session.multi_range_count = DEFAULT;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+256
+'#--------------------FN_DYNVARS_090_02-------------------------#'
+SET @@global.multi_range_count = DEFAULT;
+SELECT @@global.multi_range_count = 256;
+@@global.multi_range_count = 256
+1
+SET @@session.multi_range_count = DEFAULT;
+SELECT @@session.multi_range_count = 256;
+@@session.multi_range_count = 256
+1
+'#--------------------FN_DYNVARS_090_03-------------------------#'
+SET @@global.multi_range_count = 1;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+1
+SET @@global.multi_range_count = 60020;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+60020
+SET @@global.multi_range_count = 65535;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+65535
+SET @@global.multi_range_count = 4294967295;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+4294967295
+SET @@global.multi_range_count = 4294967294;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+4294967294
+'#--------------------FN_DYNVARS_090_04-------------------------#'
+SET @@session.multi_range_count = 1;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+1
+SET @@session.multi_range_count = 50050;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+50050
+SET @@session.multi_range_count = 65535;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+65535
+SET @@session.multi_range_count = 4294967295;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+4294967295
+SET @@session.multi_range_count = 4294967294;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+4294967294
+'#------------------FN_DYNVARS_090_05-----------------------#'
+SET @@global.multi_range_count = 0;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '0'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+1
+SET @@global.multi_range_count = 4294967296;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+4294967296
+SET @@global.multi_range_count = -1024;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '0'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+1
+SET @@global.multi_range_count = 429496729500;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+429496729500
+SET @@global.multi_range_count = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'multi_range_count'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+429496729500
+SET @@global.multi_range_count = test;
+ERROR 42000: Incorrect argument type to variable 'multi_range_count'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+429496729500
+SET @@session.multi_range_count = 0;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '0'
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+1
+SET @@session.multi_range_count = 4294967296;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+4294967296
+SET @@session.multi_range_count = -1;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '0'
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+1
+SET @@session.multi_range_count = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.multi_range_count = 4294967295021;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+4294967295021
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.multi_range_count = test;
+ERROR 42000: Incorrect argument type to variable 'multi_range_count'
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+4294967295021
+'#------------------FN_DYNVARS_090_06-----------------------#'
+SELECT @@global.multi_range_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='multi_range_count';
+@@global.multi_range_count = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_090_07-----------------------#'
+SELECT @@session.multi_range_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='multi_range_count';
+@@session.multi_range_count = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_090_08-----------------------#'
+SET @@global.multi_range_count = TRUE;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+1
+SET @@global.multi_range_count = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect multi_range_count value: '0'
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+1
+'#---------------------FN_DYNVARS_090_09----------------------#'
+SET @@global.multi_range_count = 10;
+SELECT @@multi_range_count = @@global.multi_range_count;
+@@multi_range_count = @@global.multi_range_count
+0
+'#---------------------FN_DYNVARS_090_10----------------------#'
+SET @@multi_range_count = 100;
+SELECT @@multi_range_count = @@local.multi_range_count;
+@@multi_range_count = @@local.multi_range_count
+1
+SELECT @@local.multi_range_count = @@session.multi_range_count;
+@@local.multi_range_count = @@session.multi_range_count
+1
+'#---------------------FN_DYNVARS_090_11----------------------#'
+SET multi_range_count = 1;
+SELECT @@multi_range_count;
+@@multi_range_count
+1
+SELECT local.multi_range_count;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.multi_range_count;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT multi_range_count = @@session.multi_range_count;
+ERROR 42S22: Unknown column 'multi_range_count' in 'field list'
+SET @@global.multi_range_count = @start_global_value;
+SELECT @@global.multi_range_count;
+@@global.multi_range_count
+256
+SET @@session.multi_range_count = @start_session_value;
+SELECT @@session.multi_range_count;
+@@session.multi_range_count
+256
diff --git a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
new file mode 100644
index 00000000000..64d1168685c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result
@@ -0,0 +1,114 @@
+SET @start_global_value = @@global.myisam_max_sort_file_size;
+SELECT @start_global_value;
+@start_global_value
+2147483647
+'#--------------------FN_DYNVARS_094_01-------------------------#'
+SET @@global.myisam_max_sort_file_size = 500000;
+SET @@global.myisam_max_sort_file_size = DEFAULT;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+2146435072
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#--------------------FN_DYNVARS_094_02-------------------------#'
+SET @@global.myisam_max_sort_file_size = DEFAULT;
+SELECT @@global.myisam_max_sort_file_size = 2147483648;
+@@global.myisam_max_sort_file_size = 2147483648
+0
+'#--------------------FN_DYNVARS_094_03-------------------------#'
+SET @@global.myisam_max_sort_file_size = 0;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = 1024;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = 123456789;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+122683392
+SET @@global.myisam_max_sort_file_size = 2147483648*2;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+4294967296
+SET @@global.myisam_max_sort_file_size = 2147483648*1024;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+2199023255552
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+2199023255552
+SET @@global.myisam_max_sort_file_size = 2147483648*2147483648;
+'#--------------------FN_DYNVARS_094_04-------------------------#'
+SET @@myisam_max_sort_file_size = 2;
+ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.myisam_max_sort_file_size = 3;
+ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@local.myisam_max_sort_file_size = 4;
+ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+'#------------------FN_DYNVARS_094_05-----------------------#'
+SET @@global.myisam_max_sort_file_size = -1;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = -2147483648;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = -2147483649;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = 2147483649.56;
+ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = 1G;
+ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+'#------------------FN_DYNVARS_094_06-----------------------#'
+SET @@global.myisam_max_sort_file_size = 3000;
+SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='myisam_max_sort_file_size';
+@@global.myisam_max_sort_file_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_094_07-----------------------#'
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='myisam_max_sort_file_size';
+count(VARIABLE_VALUE)
+1
+'#------------------FN_DYNVARS_094_08-----------------------#'
+SET @@global.myisam_max_sort_file_size = TRUE;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = FALSE;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.myisam_max_sort_file_size = 512;
+SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size;
+@@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size
+1
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET myisam_max_sort_file_size = 2048;
+ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT myisam_max_sort_file_size;
+ERROR 42S22: Unknown column 'myisam_max_sort_file_size' in 'field list'
+SELECT @@myisam_max_sort_file_size;
+@@myisam_max_sort_file_size
+0
+SET global myisam_max_sort_file_size = 64;
+SET @@global.myisam_max_sort_file_size = @start_global_value;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+2146435072
diff --git a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result
new file mode 100644
index 00000000000..00ff1dfc1ab
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result
@@ -0,0 +1,114 @@
+SET @start_global_value = @@global.myisam_max_sort_file_size;
+SELECT @start_global_value;
+@start_global_value
+9223372036854775807
+'#--------------------FN_DYNVARS_094_01-------------------------#'
+SET @@global.myisam_max_sort_file_size = 500000;
+SET @@global.myisam_max_sort_file_size = DEFAULT;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+9223372036853727232
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#--------------------FN_DYNVARS_094_02-------------------------#'
+SET @@global.myisam_max_sort_file_size = DEFAULT;
+SELECT @@global.myisam_max_sort_file_size = 2147483648;
+@@global.myisam_max_sort_file_size = 2147483648
+0
+'#--------------------FN_DYNVARS_094_03-------------------------#'
+SET @@global.myisam_max_sort_file_size = 0;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = 1024;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = 123456789;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+122683392
+SET @@global.myisam_max_sort_file_size = 2147483648*2;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+4294967296
+SET @@global.myisam_max_sort_file_size = 2147483648*1024;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+2199023255552
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+2199023255552
+SET @@global.myisam_max_sort_file_size = 2147483648*2147483648;
+'#--------------------FN_DYNVARS_094_04-------------------------#'
+SET @@myisam_max_sort_file_size = 2;
+ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.myisam_max_sort_file_size = 3;
+ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@local.myisam_max_sort_file_size = 4;
+ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+'#------------------FN_DYNVARS_094_05-----------------------#'
+SET @@global.myisam_max_sort_file_size = -1;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = -2147483648;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = -2147483649;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = 2147483649.56;
+ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = 1G;
+ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size'
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+'#------------------FN_DYNVARS_094_06-----------------------#'
+SET @@global.myisam_max_sort_file_size = 3000;
+SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='myisam_max_sort_file_size';
+@@global.myisam_max_sort_file_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_094_07-----------------------#'
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='myisam_max_sort_file_size';
+count(VARIABLE_VALUE)
+1
+'#------------------FN_DYNVARS_094_08-----------------------#'
+SET @@global.myisam_max_sort_file_size = TRUE;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+SET @@global.myisam_max_sort_file_size = FALSE;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+0
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.myisam_max_sort_file_size = 512;
+SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size;
+@@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size
+1
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET myisam_max_sort_file_size = 2048;
+ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT myisam_max_sort_file_size;
+ERROR 42S22: Unknown column 'myisam_max_sort_file_size' in 'field list'
+SELECT @@myisam_max_sort_file_size;
+@@myisam_max_sort_file_size
+0
+SET global myisam_max_sort_file_size = 64;
+SET @@global.myisam_max_sort_file_size = @start_global_value;
+SELECT @@global.myisam_max_sort_file_size;
+@@global.myisam_max_sort_file_size
+9223372036853727232
diff --git a/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result
new file mode 100644
index 00000000000..c91128e3f4c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result
@@ -0,0 +1,180 @@
+SET @start_global_value = @@global.myisam_repair_threads;
+SELECT @start_global_value;
+@start_global_value
+1
+SET @start_session_value = @@session.myisam_repair_threads;
+SELECT @start_session_value;
+@start_session_value
+1
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.myisam_repair_threads  = 100;
+SET @@global.myisam_repair_threads  = DEFAULT;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = 200;
+SET @@session.myisam_repair_threads  = DEFAULT;
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.myisam_repair_threads  = DEFAULT;
+SELECT @@global.myisam_repair_threads  = 1;
+@@global.myisam_repair_threads  = 1
+1
+SET @@session.myisam_repair_threads  = DEFAULT;
+SELECT @@session.myisam_repair_threads  = 1;
+@@session.myisam_repair_threads  = 1
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.myisam_repair_threads  = 1;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@global.myisam_repair_threads  = 4294967295;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+4294967295
+SET @@global.myisam_repair_threads  = 655354;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+655354
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.myisam_repair_threads  = 1;
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = 4294967295;
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+4294967295
+SET @@session.myisam_repair_threads  = 655345;
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+655345
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.myisam_repair_threads  = 0;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@global.myisam_repair_threads  = -1024;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@global.myisam_repair_threads  = 429496729533;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '429496729533'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+4294967295
+SET @@global.myisam_repair_threads  = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+4294967295
+SET @@global.myisam_repair_threads  = test;
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+4294967295
+SET @@global.myisam_repair_threads  = "test";
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+4294967295
+SET @@global.myisam_repair_threads  = 'test';
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+4294967295
+SET @@global.myisam_repair_threads  = ON;
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+4294967295
+SET @@session.myisam_repair_threads  = 0;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = -2;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = test;
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = "test";
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.myisam_repair_threads  = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='myisam_repair_threads ';
+@@global.myisam_repair_threads  = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.myisam_repair_threads  = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='myisam_repair_threads ';
+@@session.myisam_repair_threads  = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_08-----------------------#'
+SET @@global.myisam_repair_threads  = TRUE;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@global.myisam_repair_threads  = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.myisam_repair_threads  = 10;
+SELECT @@myisam_repair_threads  = @@global.myisam_repair_threads ;
+@@myisam_repair_threads  = @@global.myisam_repair_threads
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@myisam_repair_threads  = 100;
+SELECT @@myisam_repair_threads  = @@local.myisam_repair_threads ;
+@@myisam_repair_threads  = @@local.myisam_repair_threads
+1
+SELECT @@local.myisam_repair_threads  = @@session.myisam_repair_threads ;
+@@local.myisam_repair_threads  = @@session.myisam_repair_threads
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET myisam_repair_threads  = 1;
+SELECT @@myisam_repair_threads ;
+@@myisam_repair_threads
+1
+SELECT local.myisam_repair_threads ;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.myisam_repair_threads ;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT myisam_repair_threads  = @@session.myisam_repair_threads ;
+ERROR 42S22: Unknown column 'myisam_repair_threads' in 'field list'
+SET @@global.myisam_repair_threads  = @start_global_value;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = @start_session_value;
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
diff --git a/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result
new file mode 100644
index 00000000000..8271451cc9e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result
@@ -0,0 +1,178 @@
+SET @start_global_value = @@global.myisam_repair_threads;
+SELECT @start_global_value;
+@start_global_value
+1
+SET @start_session_value = @@session.myisam_repair_threads;
+SELECT @start_session_value;
+@start_session_value
+1
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.myisam_repair_threads  = 100;
+SET @@global.myisam_repair_threads  = DEFAULT;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = 200;
+SET @@session.myisam_repair_threads  = DEFAULT;
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.myisam_repair_threads  = DEFAULT;
+SELECT @@global.myisam_repair_threads  = 1;
+@@global.myisam_repair_threads  = 1
+1
+SET @@session.myisam_repair_threads  = DEFAULT;
+SELECT @@session.myisam_repair_threads  = 1;
+@@session.myisam_repair_threads  = 1
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.myisam_repair_threads  = 1;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@global.myisam_repair_threads  = 4294967295;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+4294967295
+SET @@global.myisam_repair_threads  = 655354;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+655354
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.myisam_repair_threads  = 1;
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = 4294967295;
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+4294967295
+SET @@session.myisam_repair_threads  = 655345;
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+655345
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.myisam_repair_threads  = 0;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@global.myisam_repair_threads  = -1024;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@global.myisam_repair_threads  = 429496729533;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+429496729533
+SET @@global.myisam_repair_threads  = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+429496729533
+SET @@global.myisam_repair_threads  = test;
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+429496729533
+SET @@global.myisam_repair_threads  = "test";
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+429496729533
+SET @@global.myisam_repair_threads  = 'test';
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+429496729533
+SET @@global.myisam_repair_threads  = ON;
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+429496729533
+SET @@session.myisam_repair_threads  = 0;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = -2;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = test;
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = "test";
+ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads'
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.myisam_repair_threads  = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='myisam_repair_threads ';
+@@global.myisam_repair_threads  = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.myisam_repair_threads  = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='myisam_repair_threads ';
+@@session.myisam_repair_threads  = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_08-----------------------#'
+SET @@global.myisam_repair_threads  = TRUE;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@global.myisam_repair_threads  = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect myisam_repair_threads value: '0'
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.myisam_repair_threads  = 10;
+SELECT @@myisam_repair_threads  = @@global.myisam_repair_threads ;
+@@myisam_repair_threads  = @@global.myisam_repair_threads
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@myisam_repair_threads  = 100;
+SELECT @@myisam_repair_threads  = @@local.myisam_repair_threads ;
+@@myisam_repair_threads  = @@local.myisam_repair_threads
+1
+SELECT @@local.myisam_repair_threads  = @@session.myisam_repair_threads ;
+@@local.myisam_repair_threads  = @@session.myisam_repair_threads
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET myisam_repair_threads  = 1;
+SELECT @@myisam_repair_threads ;
+@@myisam_repair_threads
+1
+SELECT local.myisam_repair_threads ;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.myisam_repair_threads ;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT myisam_repair_threads  = @@session.myisam_repair_threads ;
+ERROR 42S22: Unknown column 'myisam_repair_threads' in 'field list'
+SET @@global.myisam_repair_threads  = @start_global_value;
+SELECT @@global.myisam_repair_threads ;
+@@global.myisam_repair_threads
+1
+SET @@session.myisam_repair_threads  = @start_session_value;
+SELECT @@session.myisam_repair_threads ;
+@@session.myisam_repair_threads
+1
diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
new file mode 100644
index 00000000000..74d2fb3ec86
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result
@@ -0,0 +1,184 @@
+SET @start_global_value = @@global.myisam_sort_buffer_size ;
+SELECT @start_global_value;
+@start_global_value
+8388608
+SET @start_session_value = @@session.myisam_sort_buffer_size ;
+SELECT @start_session_value;
+@start_session_value
+8388608
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.myisam_sort_buffer_size   = 100;
+SET @@global.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+8388608
+SET @@session.myisam_sort_buffer_size   = 200;
+SET @@session.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+8388608
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@global.myisam_sort_buffer_size   = 8388608;
+@@global.myisam_sort_buffer_size   = 8388608
+1
+SET @@session.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@session.myisam_sort_buffer_size   = 8388608;
+@@session.myisam_sort_buffer_size   = 8388608
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.myisam_sort_buffer_size   = 4;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4
+SET @@global.myisam_sort_buffer_size   = 4294967295;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4294967295
+SET @@global.myisam_sort_buffer_size   = 655354;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+655354
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.myisam_sort_buffer_size   = 4;
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+SET @@session.myisam_sort_buffer_size   = 4294967295;
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4294967295
+SET @@session.myisam_sort_buffer_size   = 655345;
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+655345
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.myisam_sort_buffer_size   = 0;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4
+SET @@global.myisam_sort_buffer_size   = -1024;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4
+SET @@global.myisam_sort_buffer_size   = 429496729533;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '429496729533'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4294967295
+SET @@global.myisam_sort_buffer_size   = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4294967295
+SET @@global.myisam_sort_buffer_size   = test;
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4294967295
+SET @@global.myisam_sort_buffer_size   = "test";
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4294967295
+SET @@global.myisam_sort_buffer_size   = 'test';
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4294967295
+SET @@global.myisam_sort_buffer_size   = ON;
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4294967295
+SET @@session.myisam_sort_buffer_size   = 0;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+SET @@session.myisam_sort_buffer_size   = -2;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+SET @@session.myisam_sort_buffer_size   = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+SET @@session.myisam_sort_buffer_size   = test;
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+SET @@session.myisam_sort_buffer_size   = "test";
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.myisam_sort_buffer_size   = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
+@@global.myisam_sort_buffer_size   = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.myisam_sort_buffer_size   = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
+@@session.myisam_sort_buffer_size   = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_08-----------------------#'
+SET @@global.myisam_sort_buffer_size   = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '1'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4
+SET @@global.myisam_sort_buffer_size   = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.myisam_sort_buffer_size   = 10;
+SELECT @@myisam_sort_buffer_size   = @@global.myisam_sort_buffer_size  ;
+@@myisam_sort_buffer_size   = @@global.myisam_sort_buffer_size
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@myisam_sort_buffer_size   = 100;
+SELECT @@myisam_sort_buffer_size   = @@local.myisam_sort_buffer_size  ;
+@@myisam_sort_buffer_size   = @@local.myisam_sort_buffer_size
+1
+SELECT @@local.myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
+@@local.myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET myisam_sort_buffer_size   = 1;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '1'
+SELECT @@myisam_sort_buffer_size  ;
+@@myisam_sort_buffer_size
+4
+SELECT local.myisam_sort_buffer_size  ;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.myisam_sort_buffer_size  ;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
+ERROR 42S22: Unknown column 'myisam_sort_buffer_size' in 'field list'
+SET @@global.myisam_sort_buffer_size   = @start_global_value;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+8388608
+SET @@session.myisam_sort_buffer_size   = @start_session_value;
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+8388608
diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result
new file mode 100644
index 00000000000..bfcada76a46
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result
@@ -0,0 +1,182 @@
+SET @start_global_value = @@global.myisam_sort_buffer_size ;
+SELECT @start_global_value;
+@start_global_value
+8388608
+SET @start_session_value = @@session.myisam_sort_buffer_size ;
+SELECT @start_session_value;
+@start_session_value
+8388608
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.myisam_sort_buffer_size   = 100;
+SET @@global.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+8388608
+SET @@session.myisam_sort_buffer_size   = 200;
+SET @@session.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+8388608
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@global.myisam_sort_buffer_size   = 8388608;
+@@global.myisam_sort_buffer_size   = 8388608
+1
+SET @@session.myisam_sort_buffer_size   = DEFAULT;
+SELECT @@session.myisam_sort_buffer_size   = 8388608;
+@@session.myisam_sort_buffer_size   = 8388608
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.myisam_sort_buffer_size   = 4;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4
+SET @@global.myisam_sort_buffer_size   = 4294967295;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4294967295
+SET @@global.myisam_sort_buffer_size   = 655354;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+655354
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.myisam_sort_buffer_size   = 4;
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+SET @@session.myisam_sort_buffer_size   = 4294967295;
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4294967295
+SET @@session.myisam_sort_buffer_size   = 655345;
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+655345
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.myisam_sort_buffer_size   = 0;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4
+SET @@global.myisam_sort_buffer_size   = -1024;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4
+SET @@global.myisam_sort_buffer_size   = 429496729533;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+429496729533
+SET @@global.myisam_sort_buffer_size   = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+429496729533
+SET @@global.myisam_sort_buffer_size   = test;
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+429496729533
+SET @@global.myisam_sort_buffer_size   = "test";
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+429496729533
+SET @@global.myisam_sort_buffer_size   = 'test';
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+429496729533
+SET @@global.myisam_sort_buffer_size   = ON;
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+429496729533
+SET @@session.myisam_sort_buffer_size   = 0;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+SET @@session.myisam_sort_buffer_size   = -2;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+SET @@session.myisam_sort_buffer_size   = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+SET @@session.myisam_sort_buffer_size   = test;
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+SET @@session.myisam_sort_buffer_size   = "test";
+ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size'
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+4
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.myisam_sort_buffer_size   = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
+@@global.myisam_sort_buffer_size   = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.myisam_sort_buffer_size   = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='myisam_sort_buffer_size  ';
+@@session.myisam_sort_buffer_size   = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_08-----------------------#'
+SET @@global.myisam_sort_buffer_size   = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '1'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4
+SET @@global.myisam_sort_buffer_size   = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '0'
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+4
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.myisam_sort_buffer_size   = 10;
+SELECT @@myisam_sort_buffer_size   = @@global.myisam_sort_buffer_size  ;
+@@myisam_sort_buffer_size   = @@global.myisam_sort_buffer_size
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@myisam_sort_buffer_size   = 100;
+SELECT @@myisam_sort_buffer_size   = @@local.myisam_sort_buffer_size  ;
+@@myisam_sort_buffer_size   = @@local.myisam_sort_buffer_size
+1
+SELECT @@local.myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
+@@local.myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET myisam_sort_buffer_size   = 1;
+Warnings:
+Warning	1292	Truncated incorrect myisam_sort_buffer_size value: '1'
+SELECT @@myisam_sort_buffer_size  ;
+@@myisam_sort_buffer_size
+4
+SELECT local.myisam_sort_buffer_size  ;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.myisam_sort_buffer_size  ;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT myisam_sort_buffer_size   = @@session.myisam_sort_buffer_size  ;
+ERROR 42S22: Unknown column 'myisam_sort_buffer_size' in 'field list'
+SET @@global.myisam_sort_buffer_size   = @start_global_value;
+SELECT @@global.myisam_sort_buffer_size  ;
+@@global.myisam_sort_buffer_size
+8388608
+SET @@session.myisam_sort_buffer_size   = @start_session_value;
+SELECT @@session.myisam_sort_buffer_size  ;
+@@session.myisam_sort_buffer_size
+8388608
diff --git a/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result b/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result
new file mode 100644
index 00000000000..3923df539e7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result
@@ -0,0 +1,192 @@
+SET @start_global_value = @@global.net_retry_count;
+SELECT @start_global_value;
+@start_global_value
+10
+SET @start_session_value = @@session.net_retry_count;
+SELECT @start_session_value;
+@start_session_value
+10
+'#--------------------FN_DYNVARS_111_01-------------------------#'
+SET @@global.net_retry_count = 100;
+SET @@global.net_retry_count = DEFAULT;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+10
+SET @@session.net_retry_count = 200;
+SET @@session.net_retry_count = DEFAULT;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+10
+'#--------------------FN_DYNVARS_111_02-------------------------#'
+SET @@global.net_retry_count = DEFAULT;
+SELECT @@global.net_retry_count = 10;
+@@global.net_retry_count = 10
+1
+SET @@session.net_retry_count = DEFAULT;
+SELECT @@session.net_retry_count = 10;
+@@session.net_retry_count = 10
+1
+'#--------------------FN_DYNVARS_111_03-------------------------#'
+SET @@global.net_retry_count = 1;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+1
+SET @@global.net_retry_count = 2;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+2
+SET @@global.net_retry_count = 4294967295;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+4294967295
+SET @@global.net_retry_count = 4294967294;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+4294967294
+SET @@global.net_retry_count = 65536;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+65536
+'#--------------------FN_DYNVARS_111_04-------------------------#'
+SET @@session.net_retry_count = 1;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+1
+SET @@session.net_retry_count = 2;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+2
+SET @@session.net_retry_count = 65535;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+65535
+SET @@session.net_retry_count = 4294967295;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+4294967295
+SET @@session.net_retry_count = 4294967294;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+4294967294
+'#------------------FN_DYNVARS_111_05-----------------------#'
+SET @@global.net_retry_count = 0;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '0'
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+1
+SET @@global.net_retry_count = -1024;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '0'
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+1
+SET @@global.net_retry_count = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '4294967296'
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+4294967295
+SET @@global.net_retry_count = 429496729500;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '429496729500'
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+4294967295
+SET @@global.net_retry_count = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+4294967295
+SET @@global.net_retry_count = test;
+ERROR 42000: Incorrect argument type to variable 'net_retry_count'
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+4294967295
+SET @@session.net_retry_count = 0;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '0'
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+1
+SET @@session.net_retry_count = -2;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '0'
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+1
+SET @@session.net_retry_count = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.net_retry_count = 6555015425;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '6555015425'
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+4294967295
+SET @@session.net_retry_count = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '4294967296'
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+4294967295
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.net_retry_count = test;
+ERROR 42000: Incorrect argument type to variable 'net_retry_count'
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+4294967295
+'#------------------FN_DYNVARS_111_06-----------------------#'
+SELECT @@global.net_retry_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='net_retry_count';
+@@global.net_retry_count = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_111_07-----------------------#'
+SELECT @@session.net_retry_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='net_retry_count';
+@@session.net_retry_count = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_111_08-----------------------#'
+SET @@global.net_retry_count = TRUE;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+1
+SET @@global.net_retry_count = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '0'
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+1
+'#---------------------FN_DYNVARS_111_09----------------------#'
+SET @@global.net_retry_count = 10;
+SELECT @@net_retry_count = @@global.net_retry_count;
+@@net_retry_count = @@global.net_retry_count
+0
+'#---------------------FN_DYNVARS_111_10----------------------#'
+SET @@net_retry_count = 100;
+SELECT @@net_retry_count = @@local.net_retry_count;
+@@net_retry_count = @@local.net_retry_count
+1
+SELECT @@local.net_retry_count = @@session.net_retry_count;
+@@local.net_retry_count = @@session.net_retry_count
+1
+'#---------------------FN_DYNVARS_111_11----------------------#'
+SET net_retry_count = 1;
+SELECT @@net_retry_count;
+@@net_retry_count
+1
+SELECT local.net_retry_count;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.net_retry_count;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT net_retry_count = @@session.net_retry_count;
+ERROR 42S22: Unknown column 'net_retry_count' in 'field list'
+SET @@global.net_retry_count = @start_global_value;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+10
+SET @@session.net_retry_count = @start_session_value;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+10
diff --git a/mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result b/mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result
new file mode 100644
index 00000000000..db133d23f79
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result
@@ -0,0 +1,184 @@
+SET @start_global_value = @@global.net_retry_count;
+SELECT @start_global_value;
+@start_global_value
+10
+SET @start_session_value = @@session.net_retry_count;
+SELECT @start_session_value;
+@start_session_value
+10
+'#--------------------FN_DYNVARS_111_01-------------------------#'
+SET @@global.net_retry_count = 100;
+SET @@global.net_retry_count = DEFAULT;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+10
+SET @@session.net_retry_count = 200;
+SET @@session.net_retry_count = DEFAULT;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+10
+'#--------------------FN_DYNVARS_111_02-------------------------#'
+SET @@global.net_retry_count = DEFAULT;
+SELECT @@global.net_retry_count = 10;
+@@global.net_retry_count = 10
+1
+SET @@session.net_retry_count = DEFAULT;
+SELECT @@session.net_retry_count = 10;
+@@session.net_retry_count = 10
+1
+'#--------------------FN_DYNVARS_111_03-------------------------#'
+SET @@global.net_retry_count = 1;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+1
+SET @@global.net_retry_count = 2;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+2
+SET @@global.net_retry_count = 4294967295;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+4294967295
+SET @@global.net_retry_count = 4294967294;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+4294967294
+SET @@global.net_retry_count = 65536;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+65536
+'#--------------------FN_DYNVARS_111_04-------------------------#'
+SET @@session.net_retry_count = 1;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+1
+SET @@session.net_retry_count = 2;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+2
+SET @@session.net_retry_count = 65535;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+65535
+SET @@session.net_retry_count = 4294967295;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+4294967295
+SET @@session.net_retry_count = 4294967294;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+4294967294
+'#------------------FN_DYNVARS_111_05-----------------------#'
+SET @@global.net_retry_count = 0;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '0'
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+1
+SET @@global.net_retry_count = -1024;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '0'
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+1
+SET @@global.net_retry_count = 4294967296;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+4294967296
+SET @@global.net_retry_count = 429496729500;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+429496729500
+SET @@global.net_retry_count = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+429496729500
+SET @@global.net_retry_count = test;
+ERROR 42000: Incorrect argument type to variable 'net_retry_count'
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+429496729500
+SET @@session.net_retry_count = 0;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '0'
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+1
+SET @@session.net_retry_count = -2;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '0'
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+1
+SET @@session.net_retry_count = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.net_retry_count = 6555015425;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+6555015425
+SET @@session.net_retry_count = 4294967296;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+4294967296
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.net_retry_count = test;
+ERROR 42000: Incorrect argument type to variable 'net_retry_count'
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+4294967296
+'#------------------FN_DYNVARS_111_06-----------------------#'
+SELECT @@global.net_retry_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='net_retry_count';
+@@global.net_retry_count = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_111_07-----------------------#'
+SELECT @@session.net_retry_count = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='net_retry_count';
+@@session.net_retry_count = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_111_08-----------------------#'
+SET @@global.net_retry_count = TRUE;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+1
+SET @@global.net_retry_count = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect net_retry_count value: '0'
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+1
+'#---------------------FN_DYNVARS_111_09----------------------#'
+SET @@global.net_retry_count = 10;
+SELECT @@net_retry_count = @@global.net_retry_count;
+@@net_retry_count = @@global.net_retry_count
+0
+'#---------------------FN_DYNVARS_111_10----------------------#'
+SET @@net_retry_count = 100;
+SELECT @@net_retry_count = @@local.net_retry_count;
+@@net_retry_count = @@local.net_retry_count
+1
+SELECT @@local.net_retry_count = @@session.net_retry_count;
+@@local.net_retry_count = @@session.net_retry_count
+1
+'#---------------------FN_DYNVARS_111_11----------------------#'
+SET net_retry_count = 1;
+SELECT @@net_retry_count;
+@@net_retry_count
+1
+SELECT local.net_retry_count;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.net_retry_count;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT net_retry_count = @@session.net_retry_count;
+ERROR 42S22: Unknown column 'net_retry_count' in 'field list'
+SET @@global.net_retry_count = @start_global_value;
+SELECT @@global.net_retry_count;
+@@global.net_retry_count
+10
+SET @@session.net_retry_count = @start_session_value;
+SELECT @@session.net_retry_count;
+@@session.net_retry_count
+10
diff --git a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
new file mode 100644
index 00000000000..3b7f06c8f81
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result
@@ -0,0 +1,203 @@
+SET @start_global_value = @@global.query_alloc_block_size;
+SELECT @start_global_value;
+@start_global_value
+8192
+SET @start_session_value = @@session.query_alloc_block_size;
+SELECT @start_session_value;
+@start_session_value
+8192
+'#--------------------FN_DYNVARS_130_01-------------------------#'
+SET @@global.query_alloc_block_size = 10000;
+SET @@global.query_alloc_block_size = DEFAULT;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+8192
+SET @@session.query_alloc_block_size = 20000;
+SET @@session.query_alloc_block_size = DEFAULT;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+8192
+'#--------------------FN_DYNVARS_130_02-------------------------#'
+SET @@global.query_alloc_block_size = DEFAULT;
+SELECT @@global.query_alloc_block_size = 8192;
+@@global.query_alloc_block_size = 8192
+1
+SET @@session.query_alloc_block_size = DEFAULT;
+SELECT @@session.query_alloc_block_size = 8192;
+@@session.query_alloc_block_size = 8192
+1
+'#--------------------FN_DYNVARS_130_03-------------------------#'
+SET @@global.query_alloc_block_size = 1024;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = 1025;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = 4294967295;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+4294966272
+SET @@global.query_alloc_block_size = 4294967294;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+4294966272
+SET @@global.query_alloc_block_size = 65536;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+65536
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_130_04-------------------------#'
+SET @@session.query_alloc_block_size = 1024;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+1024
+SET @@session.query_alloc_block_size = 1025;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+1024
+SET @@session.query_alloc_block_size = 4294967295;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+4294966272
+SET @@session.query_alloc_block_size = 4294967294;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+4294966272
+SET @@session.query_alloc_block_size = 655536;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+655360
+'#------------------FN_DYNVARS_130_05-----------------------#'
+SET @@global.query_alloc_block_size = 64;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '64'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = 1023;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '1023'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '4294967296'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+4294966272
+SET @@global.query_alloc_block_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+4294966272
+SET @@global.query_alloc_block_size = test;
+ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+4294966272
+SET @@session.query_alloc_block_size = 64;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '64'
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+1024
+SET @@session.query_alloc_block_size = -2;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+1024
+SET @@session.query_alloc_block_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.query_alloc_block_size = 1023;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '1023'
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+1024
+SET @@session.query_alloc_block_size = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '4294967296'
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+4294966272
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.query_alloc_block_size = test;
+ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+4294966272
+'#------------------FN_DYNVARS_130_06-----------------------#'
+'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement';
+SET @@global.query_alloc_block_size = 1;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '1'
+SET @@session.query_alloc_block_size = 12;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '12'
+SELECT @@global.query_alloc_block_size = 
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_alloc_block_size';
+@@global.query_alloc_block_size = 
+VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_130_07-----------------------#'
+SELECT @@session.query_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='query_alloc_block_size';
+@@session.query_alloc_block_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_130_08-----------------------#'
+SET @@global.query_alloc_block_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '1'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+'#---------------------FN_DYNVARS_130_09----------------------#'
+SET @@global.query_alloc_block_size = 2048;
+SELECT @@query_alloc_block_size = @@global.query_alloc_block_size;
+@@query_alloc_block_size = @@global.query_alloc_block_size
+0
+'#---------------------FN_DYNVARS_130_10----------------------#'
+SET @@query_alloc_block_size = 5000;
+SELECT @@query_alloc_block_size = @@local.query_alloc_block_size;
+@@query_alloc_block_size = @@local.query_alloc_block_size
+1
+SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size;
+@@local.query_alloc_block_size = @@session.query_alloc_block_size
+1
+'#---------------------FN_DYNVARS_130_11----------------------#'
+SET query_alloc_block_size = 1024;
+SELECT @@query_alloc_block_size;
+@@query_alloc_block_size
+1024
+SELECT local.query_alloc_block_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.query_alloc_block_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT query_alloc_block_size = @@session.query_alloc_block_size;
+ERROR 42S22: Unknown column 'query_alloc_block_size' in 'field list'
+SET @@global.query_alloc_block_size = @start_global_value;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+8192
+SET @@session.query_alloc_block_size = @start_session_value;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+8192
diff --git a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result
new file mode 100644
index 00000000000..57c96a8168a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result
@@ -0,0 +1,199 @@
+SET @start_global_value = @@global.query_alloc_block_size;
+SELECT @start_global_value;
+@start_global_value
+8192
+SET @start_session_value = @@session.query_alloc_block_size;
+SELECT @start_session_value;
+@start_session_value
+8192
+'#--------------------FN_DYNVARS_130_01-------------------------#'
+SET @@global.query_alloc_block_size = 10000;
+SET @@global.query_alloc_block_size = DEFAULT;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+8192
+SET @@session.query_alloc_block_size = 20000;
+SET @@session.query_alloc_block_size = DEFAULT;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+8192
+'#--------------------FN_DYNVARS_130_02-------------------------#'
+SET @@global.query_alloc_block_size = DEFAULT;
+SELECT @@global.query_alloc_block_size = 8192;
+@@global.query_alloc_block_size = 8192
+1
+SET @@session.query_alloc_block_size = DEFAULT;
+SELECT @@session.query_alloc_block_size = 8192;
+@@session.query_alloc_block_size = 8192
+1
+'#--------------------FN_DYNVARS_130_03-------------------------#'
+SET @@global.query_alloc_block_size = 1024;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = 1025;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = 4294967295;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+4294966272
+SET @@global.query_alloc_block_size = 4294967294;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+4294966272
+SET @@global.query_alloc_block_size = 65536;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+65536
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_130_04-------------------------#'
+SET @@session.query_alloc_block_size = 1024;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+1024
+SET @@session.query_alloc_block_size = 1025;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+1024
+SET @@session.query_alloc_block_size = 4294967295;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+4294966272
+SET @@session.query_alloc_block_size = 4294967294;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+4294966272
+SET @@session.query_alloc_block_size = 655536;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+655360
+'#------------------FN_DYNVARS_130_05-----------------------#'
+SET @@global.query_alloc_block_size = 64;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '64'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = -1;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = 1023;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '1023'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = 4294967296;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+4294967296
+SET @@global.query_alloc_block_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+4294967296
+SET @@global.query_alloc_block_size = test;
+ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+4294967296
+SET @@session.query_alloc_block_size = 64;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '64'
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+1024
+SET @@session.query_alloc_block_size = -2;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+1024
+SET @@session.query_alloc_block_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.query_alloc_block_size = 1023;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '1023'
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+1024
+SET @@session.query_alloc_block_size = 4294967296;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+4294967296
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.query_alloc_block_size = test;
+ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size'
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+4294967296
+'#------------------FN_DYNVARS_130_06-----------------------#'
+'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement';
+SET @@global.query_alloc_block_size = 1;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '1'
+SET @@session.query_alloc_block_size = 12;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '12'
+SELECT @@global.query_alloc_block_size = 
+VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_alloc_block_size';
+@@global.query_alloc_block_size = 
+VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_130_07-----------------------#'
+SELECT @@session.query_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='query_alloc_block_size';
+@@session.query_alloc_block_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_130_08-----------------------#'
+SET @@global.query_alloc_block_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '1'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+SET @@global.query_alloc_block_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect query_alloc_block_size value: '0'
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+1024
+'#---------------------FN_DYNVARS_130_09----------------------#'
+SET @@global.query_alloc_block_size = 2048;
+SELECT @@query_alloc_block_size = @@global.query_alloc_block_size;
+@@query_alloc_block_size = @@global.query_alloc_block_size
+0
+'#---------------------FN_DYNVARS_130_10----------------------#'
+SET @@query_alloc_block_size = 5000;
+SELECT @@query_alloc_block_size = @@local.query_alloc_block_size;
+@@query_alloc_block_size = @@local.query_alloc_block_size
+1
+SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size;
+@@local.query_alloc_block_size = @@session.query_alloc_block_size
+1
+'#---------------------FN_DYNVARS_130_11----------------------#'
+SET query_alloc_block_size = 1024;
+SELECT @@query_alloc_block_size;
+@@query_alloc_block_size
+1024
+SELECT local.query_alloc_block_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.query_alloc_block_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT query_alloc_block_size = @@session.query_alloc_block_size;
+ERROR 42S22: Unknown column 'query_alloc_block_size' in 'field list'
+SET @@global.query_alloc_block_size = @start_global_value;
+SELECT @@global.query_alloc_block_size;
+@@global.query_alloc_block_size
+8192
+SET @@session.query_alloc_block_size = @start_session_value;
+SELECT @@session.query_alloc_block_size;
+@@session.query_alloc_block_size
+8192
diff --git a/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result
new file mode 100644
index 00000000000..bb66233732d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result
@@ -0,0 +1,126 @@
+SET @start_value = @@global.query_cache_limit;
+SELECT @start_value;
+@start_value
+1048576
+'#--------------------FN_DYNVARS_131_01------------------------#'
+SET @@global.query_cache_limit = 99;
+SET @@global.query_cache_limit = DEFAULT;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1048576
+'#---------------------FN_DYNVARS_131_02-------------------------#'
+SET @@global.query_cache_limit = @start_value;
+SELECT @@global.query_cache_limit = 1048576;
+@@global.query_cache_limit = 1048576
+1
+'#--------------------FN_DYNVARS_131_03------------------------#'
+SET @@global.query_cache_limit = 0;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+0
+SET @@global.query_cache_limit = 1;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1
+SET @@global.query_cache_limit = 1048576;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1048576
+SET @@global.query_cache_limit = 1048575;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1048575
+'#--------------------FN_DYNVARS_131_04-------------------------#'
+SET @@global.query_cache_limit = -1;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+0
+SET @@global.query_cache_limit = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_limit value: '4294967296'
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+4294967295
+SET @@global.query_cache_limit = 10240022115;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_limit value: '10240022115'
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+4294967295
+SET @@global.query_cache_limit = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+4294967295
+SET @@global.query_cache_limit = -1024;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+0
+SET @@global.query_cache_limit = 42949672950;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_limit value: '42949672950'
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+4294967295
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.query_cache_limit = ON;
+ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+4294967295
+SET @@global.query_cache_limit = 'test';
+ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+4294967295
+'#-------------------FN_DYNVARS_131_05----------------------------#'
+SET @@session.query_cache_limit = 0;
+ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_limit;
+@@query_cache_limit
+4294967295
+'#----------------------FN_DYNVARS_131_06------------------------#'
+SELECT @@global.query_cache_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_limit';
+@@global.query_cache_limit = VARIABLE_VALUE
+1
+SELECT @@query_cache_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_limit';
+@@query_cache_limit = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_131_07----------------------#'
+SET @@global.query_cache_limit = TRUE;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1
+SET @@global.query_cache_limit = FALSE;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+0
+'#---------------------FN_DYNVARS_131_08----------------------#'
+SET @@global.query_cache_limit = 1;
+SELECT @@query_cache_limit = @@global.query_cache_limit;
+@@query_cache_limit = @@global.query_cache_limit
+1
+'#---------------------FN_DYNVARS_131_09----------------------#'
+SET query_cache_limit = 1;
+ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_limit;
+@@query_cache_limit
+1
+SET local.query_cache_limit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1
+SELECT local.query_cache_limit;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.query_cache_limit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1
+SELECT global.query_cache_limit;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT query_cache_limit = @@session.query_cache_limit;
+ERROR 42S22: Unknown column 'query_cache_limit' in 'field list'
+SET @@global.query_cache_limit = @start_value;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1048576
diff --git a/mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result
new file mode 100644
index 00000000000..a592883ef91
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result
@@ -0,0 +1,120 @@
+SET @start_value = @@global.query_cache_limit;
+SELECT @start_value;
+@start_value
+1048576
+'#--------------------FN_DYNVARS_131_01------------------------#'
+SET @@global.query_cache_limit = 99;
+SET @@global.query_cache_limit = DEFAULT;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1048576
+'#---------------------FN_DYNVARS_131_02-------------------------#'
+SET @@global.query_cache_limit = @start_value;
+SELECT @@global.query_cache_limit = 1048576;
+@@global.query_cache_limit = 1048576
+1
+'#--------------------FN_DYNVARS_131_03------------------------#'
+SET @@global.query_cache_limit = 0;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+0
+SET @@global.query_cache_limit = 1;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1
+SET @@global.query_cache_limit = 1048576;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1048576
+SET @@global.query_cache_limit = 1048575;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1048575
+'#--------------------FN_DYNVARS_131_04-------------------------#'
+SET @@global.query_cache_limit = -1;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+0
+SET @@global.query_cache_limit = 4294967296;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+4294967296
+SET @@global.query_cache_limit = 10240022115;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+10240022115
+SET @@global.query_cache_limit = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+10240022115
+SET @@global.query_cache_limit = -1024;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+0
+SET @@global.query_cache_limit = 42949672950;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+42949672950
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.query_cache_limit = ON;
+ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+42949672950
+SET @@global.query_cache_limit = 'test';
+ERROR 42000: Incorrect argument type to variable 'query_cache_limit'
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+42949672950
+'#-------------------FN_DYNVARS_131_05----------------------------#'
+SET @@session.query_cache_limit = 0;
+ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_limit;
+@@query_cache_limit
+42949672950
+'#----------------------FN_DYNVARS_131_06------------------------#'
+SELECT @@global.query_cache_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_limit';
+@@global.query_cache_limit = VARIABLE_VALUE
+1
+SELECT @@query_cache_limit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_limit';
+@@query_cache_limit = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_131_07----------------------#'
+SET @@global.query_cache_limit = TRUE;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1
+SET @@global.query_cache_limit = FALSE;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+0
+'#---------------------FN_DYNVARS_131_08----------------------#'
+SET @@global.query_cache_limit = 1;
+SELECT @@query_cache_limit = @@global.query_cache_limit;
+@@query_cache_limit = @@global.query_cache_limit
+1
+'#---------------------FN_DYNVARS_131_09----------------------#'
+SET query_cache_limit = 1;
+ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_limit;
+@@query_cache_limit
+1
+SET local.query_cache_limit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1
+SELECT local.query_cache_limit;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.query_cache_limit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1
+SELECT global.query_cache_limit;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT query_cache_limit = @@session.query_cache_limit;
+ERROR 42S22: Unknown column 'query_cache_limit' in 'field list'
+SET @@global.query_cache_limit = @start_value;
+SELECT @@global.query_cache_limit;
+@@global.query_cache_limit
+1048576
diff --git a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result
new file mode 100644
index 00000000000..e0d8a0d2a30
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result
@@ -0,0 +1,134 @@
+SET @start_value = @@global.query_cache_min_res_unit;
+SELECT @start_value;
+@start_value
+4096
+'#--------------------FN_DYNVARS_132_01------------------------#'
+SET @@global.query_cache_min_res_unit = 99;
+SET @@global.query_cache_min_res_unit = DEFAULT;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+4096
+'#---------------------FN_DYNVARS_132_02-------------------------#'
+SET @@global.query_cache_min_res_unit = @start_value;
+SELECT @@global.query_cache_min_res_unit = 4096;
+@@global.query_cache_min_res_unit = 4096
+1
+'#--------------------FN_DYNVARS_132_03------------------------#'
+SET @@global.query_cache_min_res_unit = 0;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = 1;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512';
+SET @@global.query_cache_min_res_unit = 512;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = 513;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+520
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.query_cache_min_res_unit = 1048576;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+1048576
+SET @@global.query_cache_min_res_unit = 1048575;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+1048576
+'#--------------------FN_DYNVARS_132_04-------------------------#'
+SET @@global.query_cache_min_res_unit = -1;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_min_res_unit value: '4294967296'
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+0
+SET @@global.query_cache_min_res_unit = 511;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = -1024;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = 42949672950;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_min_res_unit value: '42949672950'
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+0
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.query_cache_min_res_unit = ON;
+ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+0
+SET @@global.query_cache_min_res_unit = 'test';
+ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+0
+'#-------------------FN_DYNVARS_132_05----------------------------#'
+SET @@session.query_cache_min_res_unit = 0;
+ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_min_res_unit;
+@@query_cache_min_res_unit
+0
+'#----------------------FN_DYNVARS_132_06------------------------#'
+SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_min_res_unit';
+@@global.query_cache_min_res_unit = VARIABLE_VALUE
+1
+SELECT @@query_cache_min_res_unit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_min_res_unit';
+@@query_cache_min_res_unit = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_132_07----------------------#'
+SET @@global.query_cache_min_res_unit = TRUE;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = FALSE;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+'#---------------------FN_DYNVARS_132_08----------------------#'
+SET @@global.query_cache_min_res_unit = 1;
+SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit;
+@@query_cache_min_res_unit = @@global.query_cache_min_res_unit
+1
+'#---------------------FN_DYNVARS_132_09----------------------#'
+SET query_cache_min_res_unit = 1;
+ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_min_res_unit;
+@@query_cache_min_res_unit
+512
+SET local.query_cache_min_res_unit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1
+SELECT local.query_cache_min_res_unit;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.query_cache_min_res_unit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1
+SELECT global.query_cache_min_res_unit;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit;
+ERROR 42S22: Unknown column 'query_cache_min_res_unit' in 'field list'
+SET @@global.query_cache_min_res_unit = @start_value;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+4096
diff --git a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result
new file mode 100644
index 00000000000..e1c74d2bbc1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result
@@ -0,0 +1,130 @@
+SET @start_value = @@global.query_cache_min_res_unit;
+SELECT @start_value;
+@start_value
+4096
+'#--------------------FN_DYNVARS_132_01------------------------#'
+SET @@global.query_cache_min_res_unit = 99;
+SET @@global.query_cache_min_res_unit = DEFAULT;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+4096
+'#---------------------FN_DYNVARS_132_02-------------------------#'
+SET @@global.query_cache_min_res_unit = @start_value;
+SELECT @@global.query_cache_min_res_unit = 4096;
+@@global.query_cache_min_res_unit = 4096
+1
+'#--------------------FN_DYNVARS_132_03------------------------#'
+SET @@global.query_cache_min_res_unit = 0;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = 1;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512';
+SET @@global.query_cache_min_res_unit = 512;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = 513;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+520
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.query_cache_min_res_unit = 1048576;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+1048576
+SET @@global.query_cache_min_res_unit = 1048575;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+1048576
+'#--------------------FN_DYNVARS_132_04-------------------------#'
+SET @@global.query_cache_min_res_unit = -1;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = 4294967296;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+4294967296
+SET @@global.query_cache_min_res_unit = 511;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = -1024;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = 42949672950;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+42949672952
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.query_cache_min_res_unit = ON;
+ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+42949672952
+SET @@global.query_cache_min_res_unit = 'test';
+ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit'
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+42949672952
+'#-------------------FN_DYNVARS_132_05----------------------------#'
+SET @@session.query_cache_min_res_unit = 0;
+ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_min_res_unit;
+@@query_cache_min_res_unit
+42949672952
+'#----------------------FN_DYNVARS_132_06------------------------#'
+SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_min_res_unit';
+@@global.query_cache_min_res_unit = VARIABLE_VALUE
+1
+SELECT @@query_cache_min_res_unit = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_min_res_unit';
+@@query_cache_min_res_unit = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_132_07----------------------#'
+SET @@global.query_cache_min_res_unit = TRUE;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+SET @@global.query_cache_min_res_unit = FALSE;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+512
+'#---------------------FN_DYNVARS_132_08----------------------#'
+SET @@global.query_cache_min_res_unit = 1;
+SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit;
+@@query_cache_min_res_unit = @@global.query_cache_min_res_unit
+1
+'#---------------------FN_DYNVARS_132_09----------------------#'
+SET query_cache_min_res_unit = 1;
+ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_min_res_unit;
+@@query_cache_min_res_unit
+512
+SET local.query_cache_min_res_unit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1
+SELECT local.query_cache_min_res_unit;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.query_cache_min_res_unit = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1
+SELECT global.query_cache_min_res_unit;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit;
+ERROR 42S22: Unknown column 'query_cache_min_res_unit' in 'field list'
+SET @@global.query_cache_min_res_unit = @start_value;
+SELECT @@global.query_cache_min_res_unit;
+@@global.query_cache_min_res_unit
+4096
diff --git a/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result
new file mode 100644
index 00000000000..1af70b3af84
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result
@@ -0,0 +1,138 @@
+SET @start_value = @@global.query_cache_size;
+SELECT @start_value;
+@start_value
+0
+'#--------------------FN_DYNVARS_133_01------------------------#'
+SET @@global.query_cache_size = 99;
+SET @@global.query_cache_size = DEFAULT;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+'#---------------------FN_DYNVARS_133_02-------------------------#'
+SET @@global.query_cache_size = @start_value;
+SELECT @@global.query_cache_size = 0;
+@@global.query_cache_size = 0
+1
+'#--------------------FN_DYNVARS_133_03------------------------#'
+SET @@global.query_cache_size = 0;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 1;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 512;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 1024;
+Warnings:
+Warning	1282	Query cache failed to set size 1024; new query cache size is 0
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+: 'Bug#34880: Warnings are coming on assinging valid values to variable
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.query_cache_size = 1048576;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+1048576
+SET @@global.query_cache_size = 1048575;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+1047552
+'#--------------------FN_DYNVARS_133_04-------------------------#'
+SET @@global.query_cache_size = -1;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_size value: '4294967296'
+Warning	1282	Query cache failed to set size 4294966272; new query cache size is 0
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 511;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'query_cache_size'
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = -1024;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 42949672950;
+Warnings:
+Warning	1292	Truncated incorrect query_cache_size value: '42949672950'
+Warning	1282	Query cache failed to set size 4294966272; new query cache size is 0
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.query_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'query_cache_size'
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'query_cache_size'
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+'#-------------------FN_DYNVARS_133_05----------------------------#'
+SET @@session.query_cache_size = 0;
+ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_size;
+@@query_cache_size
+0
+'#----------------------FN_DYNVARS_133_06------------------------#'
+SELECT @@global.query_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_size';
+@@global.query_cache_size = VARIABLE_VALUE
+1
+SELECT @@query_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='query_cache_size';
+@@query_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_133_07----------------------#'
+SET @@global.query_cache_size = TRUE;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = FALSE;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+'#---------------------FN_DYNVARS_133_08----------------------#'
+SET @@global.query_cache_size = 1;
+SELECT @@query_cache_size = @@global.query_cache_size;
+@@query_cache_size = @@global.query_cache_size
+1
+'#---------------------FN_DYNVARS_133_09----------------------#'
+SET query_cache_size = 1;
+ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_size;
+@@query_cache_size
+0
+SET local.query_cache_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1
+SELECT local.query_cache_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.query_cache_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1
+SELECT global.query_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT query_cache_size = @@session.query_cache_size;
+ERROR 42S22: Unknown column 'query_cache_size' in 'field list'
+SET @@global.query_cache_size = @start_value;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
diff --git a/mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result
new file mode 100644
index 00000000000..0d67eec1ccc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result
@@ -0,0 +1,134 @@
+SET @start_value = @@global.query_cache_size;
+SELECT @start_value;
+@start_value
+0
+'#--------------------FN_DYNVARS_133_01------------------------#'
+SET @@global.query_cache_size = 99;
+SET @@global.query_cache_size = DEFAULT;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+'#---------------------FN_DYNVARS_133_02-------------------------#'
+SET @@global.query_cache_size = @start_value;
+SELECT @@global.query_cache_size = 0;
+@@global.query_cache_size = 0
+1
+'#--------------------FN_DYNVARS_133_03------------------------#'
+SET @@global.query_cache_size = 0;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 1;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 512;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 1024;
+Warnings:
+Warning	1282	Query cache failed to set size 1024; new query cache size is 0
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+: 'Bug#34880: Warnings are coming on assinging valid values to variable
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.query_cache_size = 1048576;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+1048576
+SET @@global.query_cache_size = 1048575;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+1047552
+'#--------------------FN_DYNVARS_133_04-------------------------#'
+SET @@global.query_cache_size = -1;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 4294967296;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+4294967296
+SET @@global.query_cache_size = 511;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'query_cache_size'
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = -1024;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 42949672950;
+Warnings:
+Warning	1282	Query cache failed to set size 42949671936; new query cache size is 0
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.query_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'query_cache_size'
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'query_cache_size'
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+'#-------------------FN_DYNVARS_133_05----------------------------#'
+SET @@session.query_cache_size = 0;
+ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_size;
+@@query_cache_size
+0
+'#----------------------FN_DYNVARS_133_06------------------------#'
+SELECT @@global.query_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='query_cache_size';
+@@global.query_cache_size = VARIABLE_VALUE
+1
+SELECT @@query_cache_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='query_cache_size';
+@@query_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_133_07----------------------#'
+SET @@global.query_cache_size = TRUE;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+SET @@global.query_cache_size = FALSE;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
+'#---------------------FN_DYNVARS_133_08----------------------#'
+SET @@global.query_cache_size = 1;
+SELECT @@query_cache_size = @@global.query_cache_size;
+@@query_cache_size = @@global.query_cache_size
+1
+'#---------------------FN_DYNVARS_133_09----------------------#'
+SET query_cache_size = 1;
+ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@query_cache_size;
+@@query_cache_size
+0
+SET local.query_cache_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1
+SELECT local.query_cache_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.query_cache_size = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1
+SELECT global.query_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT query_cache_size = @@session.query_cache_size;
+ERROR 42S22: Unknown column 'query_cache_size' in 'field list'
+SET @@global.query_cache_size = @start_value;
+SELECT @@global.query_cache_size;
+@@global.query_cache_size
+0
diff --git a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result
new file mode 100644
index 00000000000..cd5f1727d41
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result
@@ -0,0 +1,192 @@
+SET @start_global_value = @@global.query_prealloc_size ;
+SELECT @start_global_value;
+@start_global_value
+8192
+SET @start_session_value = @@session.query_prealloc_size ;
+SELECT @start_session_value;
+@start_session_value
+8192
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.query_prealloc_size   = 100;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '100'
+SET @@global.query_prealloc_size   = DEFAULT;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = 200;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '200'
+SET @@session.query_prealloc_size   = DEFAULT;
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.query_prealloc_size   = DEFAULT;
+SELECT @@global.query_prealloc_size   = 8192;
+@@global.query_prealloc_size   = 8192
+1
+SET @@session.query_prealloc_size   = DEFAULT;
+SELECT @@session.query_prealloc_size   = 8192;
+@@session.query_prealloc_size   = 8192
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.query_prealloc_size   = 8192;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@global.query_prealloc_size   = 4294967295;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+4294966272
+SET @@global.query_prealloc_size   = 655354;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+654336
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.query_prealloc_size   = 8192;
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = 4294967295;
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+4294966272
+SET @@session.query_prealloc_size   = 655345;
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+654336
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.query_prealloc_size   = 0;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '0'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@global.query_prealloc_size   = -1024;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '0'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@global.query_prealloc_size   = 429496729533;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '429496729533'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+4294966272
+SET @@global.query_prealloc_size   = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+4294966272
+SET @@global.query_prealloc_size   = test;
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+4294966272
+SET @@global.query_prealloc_size   = "test";
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+4294966272
+SET @@global.query_prealloc_size   = 'test';
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+4294966272
+SET @@global.query_prealloc_size   = ON;
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+4294966272
+SET @@session.query_prealloc_size   = 0;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '0'
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = -2;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '0'
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = test;
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = "test";
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.query_prealloc_size   = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='query_prealloc_size  ';
+@@global.query_prealloc_size   = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.query_prealloc_size   = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='query_prealloc_size  ';
+@@session.query_prealloc_size   = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_08-----------------------#'
+SET @@global.query_prealloc_size   = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '1'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@global.query_prealloc_size   = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '0'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.query_prealloc_size   = 10;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '10'
+SELECT @@query_prealloc_size   = @@global.query_prealloc_size  ;
+@@query_prealloc_size   = @@global.query_prealloc_size
+1
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@query_prealloc_size   = 100;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '100'
+SELECT @@query_prealloc_size   = @@local.query_prealloc_size  ;
+@@query_prealloc_size   = @@local.query_prealloc_size
+1
+SELECT @@local.query_prealloc_size   = @@session.query_prealloc_size  ;
+@@local.query_prealloc_size   = @@session.query_prealloc_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET query_prealloc_size   = 1;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '1'
+SELECT @@query_prealloc_size  ;
+@@query_prealloc_size
+8192
+SELECT local.query_prealloc_size  ;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.query_prealloc_size  ;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT query_prealloc_size   = @@session.query_prealloc_size  ;
+ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list'
+SET @@global.query_prealloc_size   = @start_global_value;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = @start_session_value;
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
diff --git a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result
new file mode 100644
index 00000000000..0e61fbcd4b5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result
@@ -0,0 +1,190 @@
+SET @start_global_value = @@global.query_prealloc_size ;
+SELECT @start_global_value;
+@start_global_value
+8192
+SET @start_session_value = @@session.query_prealloc_size ;
+SELECT @start_session_value;
+@start_session_value
+8192
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.query_prealloc_size   = 100;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '100'
+SET @@global.query_prealloc_size   = DEFAULT;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = 200;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '200'
+SET @@session.query_prealloc_size   = DEFAULT;
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.query_prealloc_size   = DEFAULT;
+SELECT @@global.query_prealloc_size   = 8192;
+@@global.query_prealloc_size   = 8192
+1
+SET @@session.query_prealloc_size   = DEFAULT;
+SELECT @@session.query_prealloc_size   = 8192;
+@@session.query_prealloc_size   = 8192
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.query_prealloc_size   = 8192;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@global.query_prealloc_size   = 4294967295;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+4294966272
+SET @@global.query_prealloc_size   = 655354;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+654336
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.query_prealloc_size   = 8192;
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = 4294967295;
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+4294966272
+SET @@session.query_prealloc_size   = 655345;
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+654336
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.query_prealloc_size   = 0;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '0'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@global.query_prealloc_size   = -1024;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '0'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@global.query_prealloc_size   = 429496729533;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+429496728576
+SET @@global.query_prealloc_size   = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+429496728576
+SET @@global.query_prealloc_size   = test;
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+429496728576
+SET @@global.query_prealloc_size   = "test";
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+429496728576
+SET @@global.query_prealloc_size   = 'test';
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+429496728576
+SET @@global.query_prealloc_size   = ON;
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+429496728576
+SET @@session.query_prealloc_size   = 0;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '0'
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = -2;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '0'
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = test;
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = "test";
+ERROR 42000: Incorrect argument type to variable 'query_prealloc_size'
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.query_prealloc_size   = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='query_prealloc_size  ';
+@@global.query_prealloc_size   = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.query_prealloc_size   = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='query_prealloc_size  ';
+@@session.query_prealloc_size   = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_08-----------------------#'
+SET @@global.query_prealloc_size   = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '1'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@global.query_prealloc_size   = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '0'
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.query_prealloc_size   = 10;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '10'
+SELECT @@query_prealloc_size   = @@global.query_prealloc_size  ;
+@@query_prealloc_size   = @@global.query_prealloc_size
+1
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@query_prealloc_size   = 100;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '100'
+SELECT @@query_prealloc_size   = @@local.query_prealloc_size  ;
+@@query_prealloc_size   = @@local.query_prealloc_size
+1
+SELECT @@local.query_prealloc_size   = @@session.query_prealloc_size  ;
+@@local.query_prealloc_size   = @@session.query_prealloc_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET query_prealloc_size   = 1;
+Warnings:
+Warning	1292	Truncated incorrect query_prealloc_size value: '1'
+SELECT @@query_prealloc_size  ;
+@@query_prealloc_size
+8192
+SELECT local.query_prealloc_size  ;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.query_prealloc_size  ;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT query_prealloc_size   = @@session.query_prealloc_size  ;
+ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list'
+SET @@global.query_prealloc_size   = @start_global_value;
+SELECT @@global.query_prealloc_size  ;
+@@global.query_prealloc_size
+8192
+SET @@session.query_prealloc_size   = @start_session_value;
+SELECT @@session.query_prealloc_size  ;
+@@session.query_prealloc_size
+8192
diff --git a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
new file mode 100644
index 00000000000..93441448d90
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result
@@ -0,0 +1,182 @@
+SET @start_global_value = @@global.range_alloc_block_size;
+SELECT @start_global_value;
+@start_global_value
+4096
+SET @start_session_value = @@session.range_alloc_block_size;
+SELECT @start_session_value;
+@start_session_value
+4096
+'#--------------------FN_DYNVARS_137_01-------------------------#'
+SET @@global.range_alloc_block_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '100'
+SET @@global.range_alloc_block_size = DEFAULT;
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+SET @@session.range_alloc_block_size = 200;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '200'
+SET @@session.range_alloc_block_size = DEFAULT;
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4096
+'#--------------------FN_DYNVARS_137_02-------------------------#'
+SET @@global.range_alloc_block_size = DEFAULT;
+SELECT @@global.range_alloc_block_size = 2048;
+@@global.range_alloc_block_size = 2048
+0
+SET @@session.range_alloc_block_size = DEFAULT;
+SELECT @@session.range_alloc_block_size = 2048;
+@@session.range_alloc_block_size = 2048
+0
+'#--------------------FN_DYNVARS_137_03-------------------------#'
+SET @@global.range_alloc_block_size = 2048;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '2048'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.range_alloc_block_size = 4294967295;
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4294966272
+SET @@global.range_alloc_block_size = 4294967294;
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4294966272
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_137_04-------------------------#'
+SET @@session.range_alloc_block_size = 2048;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '2048'
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4096
+SET @@session.range_alloc_block_size = 4294967295;
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4294966272
+SET @@session.range_alloc_block_size = 4294967294;
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4294966272
+'#------------------FN_DYNVARS_137_05-----------------------#'
+SET @@global.range_alloc_block_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+SET @@global.range_alloc_block_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+SET @@global.range_alloc_block_size = 42949672951;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '42949672951'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4294966272
+SET @@global.range_alloc_block_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4294966272
+SET @@global.range_alloc_block_size = test;
+ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4294966272
+SET @@session.range_alloc_block_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4096
+SET @@session.range_alloc_block_size = -2;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4096
+SET @@session.range_alloc_block_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.range_alloc_block_size = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '4294967296'
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4294966272
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.range_alloc_block_size = test;
+ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4294966272
+'#------------------FN_DYNVARS_137_06-----------------------#'
+SELECT @@global.range_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='range_alloc_block_size';
+@@global.range_alloc_block_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_137_07-----------------------#'
+SELECT @@session.range_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='range_alloc_block_size';
+@@session.range_alloc_block_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_137_08-----------------------#'
+SET @@global.range_alloc_block_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '1'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+SET @@global.range_alloc_block_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+'#---------------------FN_DYNVARS_137_09----------------------#'
+SET @@global.range_alloc_block_size = 10;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '10'
+SELECT @@range_alloc_block_size = @@global.range_alloc_block_size;
+@@range_alloc_block_size = @@global.range_alloc_block_size
+0
+'#---------------------FN_DYNVARS_137_10----------------------#'
+SET @@range_alloc_block_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '100'
+SELECT @@range_alloc_block_size = @@local.range_alloc_block_size;
+@@range_alloc_block_size = @@local.range_alloc_block_size
+1
+SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size;
+@@local.range_alloc_block_size = @@session.range_alloc_block_size
+1
+'#---------------------FN_DYNVARS_137_11----------------------#'
+SET range_alloc_block_size = 1;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '1'
+SELECT @@range_alloc_block_size;
+@@range_alloc_block_size
+4096
+SELECT local.range_alloc_block_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.range_alloc_block_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT range_alloc_block_size = @@session.range_alloc_block_size;
+ERROR 42S22: Unknown column 'range_alloc_block_size' in 'field list'
+SET @@global.range_alloc_block_size = @start_global_value;
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+SET @@session.range_alloc_block_size = @start_session_value;
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4096
diff --git a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result
new file mode 100644
index 00000000000..26ddfdd2bae
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result
@@ -0,0 +1,178 @@
+SET @start_global_value = @@global.range_alloc_block_size;
+SELECT @start_global_value;
+@start_global_value
+4096
+SET @start_session_value = @@session.range_alloc_block_size;
+SELECT @start_session_value;
+@start_session_value
+4096
+'#--------------------FN_DYNVARS_137_01-------------------------#'
+SET @@global.range_alloc_block_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '100'
+SET @@global.range_alloc_block_size = DEFAULT;
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+SET @@session.range_alloc_block_size = 200;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '200'
+SET @@session.range_alloc_block_size = DEFAULT;
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4096
+'#--------------------FN_DYNVARS_137_02-------------------------#'
+SET @@global.range_alloc_block_size = DEFAULT;
+SELECT @@global.range_alloc_block_size = 2048;
+@@global.range_alloc_block_size = 2048
+0
+SET @@session.range_alloc_block_size = DEFAULT;
+SELECT @@session.range_alloc_block_size = 2048;
+@@session.range_alloc_block_size = 2048
+0
+'#--------------------FN_DYNVARS_137_03-------------------------#'
+SET @@global.range_alloc_block_size = 2048;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '2048'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.range_alloc_block_size = 4294967295;
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4294966272
+SET @@global.range_alloc_block_size = 4294967294;
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4294966272
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_137_04-------------------------#'
+SET @@session.range_alloc_block_size = 2048;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '2048'
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4096
+SET @@session.range_alloc_block_size = 4294967295;
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4294966272
+SET @@session.range_alloc_block_size = 4294967294;
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4294966272
+'#------------------FN_DYNVARS_137_05-----------------------#'
+SET @@global.range_alloc_block_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+SET @@global.range_alloc_block_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+SET @@global.range_alloc_block_size = 42949672951;
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+42949671936
+SET @@global.range_alloc_block_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+42949671936
+SET @@global.range_alloc_block_size = test;
+ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+42949671936
+SET @@session.range_alloc_block_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4096
+SET @@session.range_alloc_block_size = -2;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4096
+SET @@session.range_alloc_block_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.range_alloc_block_size = 4294967296;
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4294967296
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.range_alloc_block_size = test;
+ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size'
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4294967296
+'#------------------FN_DYNVARS_137_06-----------------------#'
+SELECT @@global.range_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='range_alloc_block_size';
+@@global.range_alloc_block_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_137_07-----------------------#'
+SELECT @@session.range_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='range_alloc_block_size';
+@@session.range_alloc_block_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_137_08-----------------------#'
+SET @@global.range_alloc_block_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '1'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+SET @@global.range_alloc_block_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '0'
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+'#---------------------FN_DYNVARS_137_09----------------------#'
+SET @@global.range_alloc_block_size = 10;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '10'
+SELECT @@range_alloc_block_size = @@global.range_alloc_block_size;
+@@range_alloc_block_size = @@global.range_alloc_block_size
+0
+'#---------------------FN_DYNVARS_137_10----------------------#'
+SET @@range_alloc_block_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '100'
+SELECT @@range_alloc_block_size = @@local.range_alloc_block_size;
+@@range_alloc_block_size = @@local.range_alloc_block_size
+1
+SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size;
+@@local.range_alloc_block_size = @@session.range_alloc_block_size
+1
+'#---------------------FN_DYNVARS_137_11----------------------#'
+SET range_alloc_block_size = 1;
+Warnings:
+Warning	1292	Truncated incorrect range_alloc_block_size value: '1'
+SELECT @@range_alloc_block_size;
+@@range_alloc_block_size
+4096
+SELECT local.range_alloc_block_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.range_alloc_block_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT range_alloc_block_size = @@session.range_alloc_block_size;
+ERROR 42S22: Unknown column 'range_alloc_block_size' in 'field list'
+SET @@global.range_alloc_block_size = @start_global_value;
+SELECT @@global.range_alloc_block_size;
+@@global.range_alloc_block_size
+4096
+SET @@session.range_alloc_block_size = @start_session_value;
+SELECT @@session.range_alloc_block_size;
+@@session.range_alloc_block_size
+4096
diff --git a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
new file mode 100644
index 00000000000..d4dd46eba71
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
@@ -0,0 +1,110 @@
+SET @start_global_value = @@global.rpl_recovery_rank;
+SELECT @start_global_value;
+@start_global_value
+0
+'#--------------------FN_DYNVARS_142_01-------------------------#'
+SET @@global.rpl_recovery_rank = 500000;
+SET @@global.rpl_recovery_rank = DEFAULT;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+'#--------------------FN_DYNVARS_142_02-------------------------#'
+SET @@global.rpl_recovery_rank = 0;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+SET @@global.rpl_recovery_rank = 1024;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+1024
+SET @@global.rpl_recovery_rank = 123456789;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+123456789
+SET @@global.rpl_recovery_rank = 2147483648*2;
+Warnings:
+Warning	1292	Truncated incorrect rpl-recovery-rank value: '4294967296'
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+4294967295
+SET @@global.rpl_recovery_rank = 2147483648*1024;
+Warnings:
+Warning	1292	Truncated incorrect rpl-recovery-rank value: '2199023255552'
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+4294967295
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+4294967295
+SET @@global.rpl_recovery_rank = 2147483648*2147483648;
+Warnings:
+Warning	1292	Truncated incorrect rpl-recovery-rank value: '4611686018427387904'
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+4294967295
+'#--------------------FN_DYNVARS_142_03-------------------------#'
+SET @@rpl_recovery_rank = 2;
+ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.rpl_recovery_rank = 3;
+ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@local.rpl_recovery_rank = 4;
+ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
+'#------------------FN_DYNVARS_142_04-----------------------#'
+SET @@global.rpl_recovery_rank = -1;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+SET @@global.rpl_recovery_rank = -2147483648;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+SET @@global.rpl_recovery_rank = -2147483649;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+SET @@global.rpl_recovery_rank = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.rpl_recovery_rank = 2147483649.56;
+ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
+SET @@global.rpl_recovery_rank = 1G;
+ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
+'#------------------FN_DYNVARS_142_05-----------------------#'
+SET @@global.rpl_recovery_rank = 3000;
+SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='rpl_recovery_rank';
+@@global.rpl_recovery_rank = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_142_06-----------------------#'
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='rpl_recovery_rank';
+count(VARIABLE_VALUE)
+1
+'#------------------FN_DYNVARS_142_07-----------------------#'
+SET @@global.rpl_recovery_rank = TRUE;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+1
+SET @@global.rpl_recovery_rank = FALSE;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+'#---------------------FN_DYNVARS_001_08----------------------#'
+SET @@global.rpl_recovery_rank = 512;
+SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
+@@rpl_recovery_rank = @@global.rpl_recovery_rank
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET rpl_recovery_rank = 2048;
+ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT rpl_recovery_rank;
+ERROR 42S22: Unknown column 'rpl_recovery_rank' in 'field list'
+SELECT @@rpl_recovery_rank;
+@@rpl_recovery_rank
+512
+SET global rpl_recovery_rank = 64;
+SET @@global.rpl_recovery_rank = @start_global_value;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
diff --git a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result
new file mode 100644
index 00000000000..74a47fa0f08
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result
@@ -0,0 +1,104 @@
+SET @start_global_value = @@global.rpl_recovery_rank;
+SELECT @start_global_value;
+@start_global_value
+0
+'#--------------------FN_DYNVARS_142_01-------------------------#'
+SET @@global.rpl_recovery_rank = 500000;
+SET @@global.rpl_recovery_rank = DEFAULT;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+'#--------------------FN_DYNVARS_142_02-------------------------#'
+SET @@global.rpl_recovery_rank = 0;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+SET @@global.rpl_recovery_rank = 1024;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+1024
+SET @@global.rpl_recovery_rank = 123456789;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+123456789
+SET @@global.rpl_recovery_rank = 2147483648*2;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+4294967296
+SET @@global.rpl_recovery_rank = 2147483648*1024;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+2199023255552
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+2199023255552
+SET @@global.rpl_recovery_rank = 2147483648*2147483648;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+4611686018427387904
+'#--------------------FN_DYNVARS_142_03-------------------------#'
+SET @@rpl_recovery_rank = 2;
+ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.rpl_recovery_rank = 3;
+ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@local.rpl_recovery_rank = 4;
+ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
+'#------------------FN_DYNVARS_142_04-----------------------#'
+SET @@global.rpl_recovery_rank = -1;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+SET @@global.rpl_recovery_rank = -2147483648;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+SET @@global.rpl_recovery_rank = -2147483649;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+SET @@global.rpl_recovery_rank = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.rpl_recovery_rank = 2147483649.56;
+ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
+SET @@global.rpl_recovery_rank = 1G;
+ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank'
+'#------------------FN_DYNVARS_142_05-----------------------#'
+SET @@global.rpl_recovery_rank = 3000;
+SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='rpl_recovery_rank';
+@@global.rpl_recovery_rank = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_142_06-----------------------#'
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='rpl_recovery_rank';
+count(VARIABLE_VALUE)
+1
+'#------------------FN_DYNVARS_142_07-----------------------#'
+SET @@global.rpl_recovery_rank = TRUE;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+1
+SET @@global.rpl_recovery_rank = FALSE;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
+'#---------------------FN_DYNVARS_001_08----------------------#'
+SET @@global.rpl_recovery_rank = 512;
+SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
+@@rpl_recovery_rank = @@global.rpl_recovery_rank
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET rpl_recovery_rank = 2048;
+ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT rpl_recovery_rank;
+ERROR 42S22: Unknown column 'rpl_recovery_rank' in 'field list'
+SELECT @@rpl_recovery_rank;
+@@rpl_recovery_rank
+512
+SET global rpl_recovery_rank = 64;
+SET @@global.rpl_recovery_rank = @start_global_value;
+SELECT @@global.rpl_recovery_rank;
+@@global.rpl_recovery_rank
+0
diff --git a/mysql-test/suite/sys_vars/r/server_id_basic_32.result b/mysql-test/suite/sys_vars/r/server_id_basic_32.result
new file mode 100644
index 00000000000..6f801fc627b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/server_id_basic_32.result
@@ -0,0 +1,117 @@
+SET @@global.general_log= 0;
+SET @start_global_value = @@global.server_id;
+SELECT @start_global_value;
+@start_global_value
+1
+'#--------------------FN_DYNVARS_144_01-------------------------#'
+SET @@global.server_id = 500000;
+SET @@global.server_id = DEFAULT;
+SELECT @@global.server_id;
+@@global.server_id
+0
+'#--------------------FN_DYNVARS_144_02-------------------------#'
+SET @@global.server_id = DEFAULT;
+SELECT @@global.server_id = 0;
+@@global.server_id = 0
+1
+'#--------------------FN_DYNVARS_144_03-------------------------#'
+SET @@global.server_id = 0;
+SELECT @@global.server_id;
+@@global.server_id
+0
+SET @@global.server_id = 1;
+SELECT @@global.server_id;
+@@global.server_id
+1
+SET @@global.server_id = 15;
+SELECT @@global.server_id;
+@@global.server_id
+15
+SET @@global.server_id = 1024;
+SELECT @@global.server_id;
+@@global.server_id
+1024
+SET @@global.server_id = 123456789;
+SELECT @@global.server_id;
+@@global.server_id
+123456789
+SET @@global.server_id = 2147483648;
+SELECT @@global.server_id;
+@@global.server_id
+2147483648
+SET @@global.server_id = 2147483648*2-1;
+SELECT @@global.server_id;
+@@global.server_id
+4294967295
+'#--------------------FN_DYNVARS_144_04-------------------------#'
+SET @@server_id = 2;
+ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.server_id = 3;
+ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@local.server_id = 4;
+ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
+'#------------------FN_DYNVARS_144_05-----------------------#'
+SET @@global.server_id = -1;
+SELECT @@global.server_id;
+@@global.server_id
+0
+SET @@global.server_id = -2147483648;
+SELECT @@global.server_id;
+@@global.server_id
+0
+SET @@global.server_id = 2147483649*2;
+Warnings:
+Warning	1292	Truncated incorrect server-id value: '4294967298'
+SELECT @@global.server_id;
+@@global.server_id
+4294967295
+SET @@global.server_id = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.server_id = '125';
+ERROR 42000: Incorrect argument type to variable 'server_id'
+SET @@global.server_id = 7483649.56;
+ERROR 42000: Incorrect argument type to variable 'server_id'
+SET @@global.server_id = 1G;
+ERROR 42000: Incorrect argument type to variable 'server_id'
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#------------------FN_DYNVARS_144_06-----------------------#'
+SET @@global.server_id = 3000;
+SELECT @@global.server_id = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='server_id';
+@@global.server_id = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_144_07-----------------------#'
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='server_id';
+count(VARIABLE_VALUE)
+1
+'#------------------FN_DYNVARS_144_08-----------------------#'
+SET @@global.server_id = TRUE;
+SELECT @@global.server_id;
+@@global.server_id
+1
+SET @@global.server_id = FALSE;
+SELECT @@global.server_id;
+@@global.server_id
+0
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.server_id = 512;
+SELECT @@server_id = @@global.server_id;
+@@server_id = @@global.server_id
+1
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET server_id = 2048;
+ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT server_id;
+ERROR 42S22: Unknown column 'server_id' in 'field list'
+SELECT @@server_id;
+@@server_id
+512
+SET global server_id = 99;
+SET @@global.server_id = @start_global_value;
+SELECT @@global.server_id;
+@@global.server_id
+1
+SET @@global.general_log= 1;
diff --git a/mysql-test/suite/sys_vars/r/server_id_basic_64.result b/mysql-test/suite/sys_vars/r/server_id_basic_64.result
new file mode 100644
index 00000000000..b6f3095ccfe
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/server_id_basic_64.result
@@ -0,0 +1,115 @@
+SET @@global.general_log= 0;
+SET @start_global_value = @@global.server_id;
+SELECT @start_global_value;
+@start_global_value
+1
+'#--------------------FN_DYNVARS_144_01-------------------------#'
+SET @@global.server_id = 500000;
+SET @@global.server_id = DEFAULT;
+SELECT @@global.server_id;
+@@global.server_id
+0
+'#--------------------FN_DYNVARS_144_02-------------------------#'
+SET @@global.server_id = DEFAULT;
+SELECT @@global.server_id = 0;
+@@global.server_id = 0
+1
+'#--------------------FN_DYNVARS_144_03-------------------------#'
+SET @@global.server_id = 0;
+SELECT @@global.server_id;
+@@global.server_id
+0
+SET @@global.server_id = 1;
+SELECT @@global.server_id;
+@@global.server_id
+1
+SET @@global.server_id = 15;
+SELECT @@global.server_id;
+@@global.server_id
+15
+SET @@global.server_id = 1024;
+SELECT @@global.server_id;
+@@global.server_id
+1024
+SET @@global.server_id = 123456789;
+SELECT @@global.server_id;
+@@global.server_id
+123456789
+SET @@global.server_id = 2147483648;
+SELECT @@global.server_id;
+@@global.server_id
+2147483648
+SET @@global.server_id = 2147483648*2-1;
+SELECT @@global.server_id;
+@@global.server_id
+4294967295
+'#--------------------FN_DYNVARS_144_04-------------------------#'
+SET @@server_id = 2;
+ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.server_id = 3;
+ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@local.server_id = 4;
+ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
+'#------------------FN_DYNVARS_144_05-----------------------#'
+SET @@global.server_id = -1;
+SELECT @@global.server_id;
+@@global.server_id
+0
+SET @@global.server_id = -2147483648;
+SELECT @@global.server_id;
+@@global.server_id
+0
+SET @@global.server_id = 2147483649*2;
+SELECT @@global.server_id;
+@@global.server_id
+4294967298
+SET @@global.server_id = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.server_id = '125';
+ERROR 42000: Incorrect argument type to variable 'server_id'
+SET @@global.server_id = 7483649.56;
+ERROR 42000: Incorrect argument type to variable 'server_id'
+SET @@global.server_id = 1G;
+ERROR 42000: Incorrect argument type to variable 'server_id'
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#------------------FN_DYNVARS_144_06-----------------------#'
+SET @@global.server_id = 3000;
+SELECT @@global.server_id = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='server_id';
+@@global.server_id = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_144_07-----------------------#'
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='server_id';
+count(VARIABLE_VALUE)
+1
+'#------------------FN_DYNVARS_144_08-----------------------#'
+SET @@global.server_id = TRUE;
+SELECT @@global.server_id;
+@@global.server_id
+1
+SET @@global.server_id = FALSE;
+SELECT @@global.server_id;
+@@global.server_id
+0
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.server_id = 512;
+SELECT @@server_id = @@global.server_id;
+@@server_id = @@global.server_id
+1
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET server_id = 2048;
+ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT server_id;
+ERROR 42S22: Unknown column 'server_id' in 'field list'
+SELECT @@server_id;
+@@server_id
+512
+SET global server_id = 99;
+SET @@global.server_id = @start_global_value;
+SELECT @@global.server_id;
+@@global.server_id
+1
+SET @@global.general_log= 1;
diff --git a/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result
new file mode 100644
index 00000000000..5b77c500aa0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result
@@ -0,0 +1,119 @@
+SET @start_global_value = @@global.slave_transaction_retries;
+SELECT @start_global_value;
+@start_global_value
+10
+'#--------------------FN_DYNVARS_149_01-------------------------#'
+SET @@global.slave_transaction_retries = 50;
+SET @@global.slave_transaction_retries = DEFAULT;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+10
+'#--------------------FN_DYNVARS_149_02-------------------------#'
+SET @@global.slave_transaction_retries = DEFAULT;
+SELECT @@global.slave_transaction_retries = 10;
+@@global.slave_transaction_retries = 10
+1
+'#--------------------FN_DYNVARS_149_03-------------------------#'
+SET @@global.slave_transaction_retries = 0;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+0
+SET @@global.slave_transaction_retries = 1;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+1
+SET @@global.slave_transaction_retries = 15;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+15
+SET @@global.slave_transaction_retries = 1024;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+1024
+SET @@global.slave_transaction_retries = 2147483648;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+2147483648
+SET @@global.slave_transaction_retries = 2147483648*2-1;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+4294967295
+SET @@global.slave_transaction_retries = 2147483649*2;
+Warnings:
+Warning	1292	Truncated incorrect slave_transaction_retries value: '4294967298'
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+4294967295
+SET @@global.slave_transaction_retries = 4294967295;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+4294967295
+'#--------------------FN_DYNVARS_149_04-------------------------#'
+SET @@slave_transaction_retries = 2;
+ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.slave_transaction_retries = 3;
+ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@local.slave_transaction_retries = 4;
+ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
+'#------------------FN_DYNVARS_149_05-----------------------#'
+SET @@global.slave_transaction_retries = -1;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+0
+SET @@global.slave_transaction_retries = 2147483649*2147483649;
+Warnings:
+Warning	1292	Truncated incorrect slave_transaction_retries value: '4611686022722355201'
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+4294967295
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.slave_transaction_retries = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.slave_transaction_retries = '100';
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
+SET @@global.slave_transaction_retries = 7483649.56;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
+SET @@global.slave_transaction_retries = ON;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
+SET @@global.slave_transaction_retries = OFF;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
+'#------------------FN_DYNVARS_149_06-----------------------#'
+SET @@global.slave_transaction_retries = 3000;
+SELECT @@global.slave_transaction_retries = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='slave_transaction_retries';
+@@global.slave_transaction_retries = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_149_07-----------------------#'
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='slave_transaction_retries';
+count(VARIABLE_VALUE)
+1
+'#------------------FN_DYNVARS_149_08-----------------------#'
+SET @@global.slave_transaction_retries = TRUE;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+1
+SET @@global.slave_transaction_retries = FALSE;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+0
+'#---------------------FN_DYNVARS_149_09----------------------#'
+SET @@global.slave_transaction_retries = 60*60;
+SELECT @@slave_transaction_retries = @@global.slave_transaction_retries;
+@@slave_transaction_retries = @@global.slave_transaction_retries
+1
+'#---------------------FN_DYNVARS_149_10----------------------#'
+SET slave_transaction_retries = 2048;
+ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT slave_transaction_retries;
+ERROR 42S22: Unknown column 'slave_transaction_retries' in 'field list'
+SELECT @@slave_transaction_retries;
+@@slave_transaction_retries
+3600
+SET global slave_transaction_retries = 99;
+SET @@global.slave_transaction_retries = @start_global_value;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+10
diff --git a/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result
new file mode 100644
index 00000000000..9434b14b238
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result
@@ -0,0 +1,115 @@
+SET @start_global_value = @@global.slave_transaction_retries;
+SELECT @start_global_value;
+@start_global_value
+10
+'#--------------------FN_DYNVARS_149_01-------------------------#'
+SET @@global.slave_transaction_retries = 50;
+SET @@global.slave_transaction_retries = DEFAULT;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+10
+'#--------------------FN_DYNVARS_149_02-------------------------#'
+SET @@global.slave_transaction_retries = DEFAULT;
+SELECT @@global.slave_transaction_retries = 10;
+@@global.slave_transaction_retries = 10
+1
+'#--------------------FN_DYNVARS_149_03-------------------------#'
+SET @@global.slave_transaction_retries = 0;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+0
+SET @@global.slave_transaction_retries = 1;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+1
+SET @@global.slave_transaction_retries = 15;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+15
+SET @@global.slave_transaction_retries = 1024;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+1024
+SET @@global.slave_transaction_retries = 2147483648;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+2147483648
+SET @@global.slave_transaction_retries = 2147483648*2-1;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+4294967295
+SET @@global.slave_transaction_retries = 2147483649*2;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+4294967298
+SET @@global.slave_transaction_retries = 4294967295;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+4294967295
+'#--------------------FN_DYNVARS_149_04-------------------------#'
+SET @@slave_transaction_retries = 2;
+ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.slave_transaction_retries = 3;
+ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@local.slave_transaction_retries = 4;
+ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
+'#------------------FN_DYNVARS_149_05-----------------------#'
+SET @@global.slave_transaction_retries = -1;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+0
+SET @@global.slave_transaction_retries = 2147483649*2147483649;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+4611686022722355201
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+SET @@global.slave_transaction_retries = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@global.slave_transaction_retries = '100';
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
+SET @@global.slave_transaction_retries = 7483649.56;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
+SET @@global.slave_transaction_retries = ON;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
+SET @@global.slave_transaction_retries = OFF;
+ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries'
+'#------------------FN_DYNVARS_149_06-----------------------#'
+SET @@global.slave_transaction_retries = 3000;
+SELECT @@global.slave_transaction_retries = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='slave_transaction_retries';
+@@global.slave_transaction_retries = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_149_07-----------------------#'
+SELECT count(VARIABLE_VALUE) 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='slave_transaction_retries';
+count(VARIABLE_VALUE)
+1
+'#------------------FN_DYNVARS_149_08-----------------------#'
+SET @@global.slave_transaction_retries = TRUE;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+1
+SET @@global.slave_transaction_retries = FALSE;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+0
+'#---------------------FN_DYNVARS_149_09----------------------#'
+SET @@global.slave_transaction_retries = 60*60;
+SELECT @@slave_transaction_retries = @@global.slave_transaction_retries;
+@@slave_transaction_retries = @@global.slave_transaction_retries
+1
+'#---------------------FN_DYNVARS_149_10----------------------#'
+SET slave_transaction_retries = 2048;
+ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT slave_transaction_retries;
+ERROR 42S22: Unknown column 'slave_transaction_retries' in 'field list'
+SELECT @@slave_transaction_retries;
+@@slave_transaction_retries
+3600
+SET global slave_transaction_retries = 99;
+SET @@global.slave_transaction_retries = @start_global_value;
+SELECT @@global.slave_transaction_retries;
+@@global.slave_transaction_retries
+10
diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
new file mode 100644
index 00000000000..09a1fe59046
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result
@@ -0,0 +1,193 @@
+SET @start_global_value = @@global.sort_buffer_size;
+SELECT @start_global_value;
+@start_global_value
+262144
+SET @start_session_value = @@session.sort_buffer_size;
+SELECT @start_session_value;
+@start_session_value
+262144
+'#--------------------FN_DYNVARS_151_01-------------------------#'
+SET @@global.sort_buffer_size = 1000;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '1000'
+SET @@global.sort_buffer_size = DEFAULT;
+SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
+@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116
+1
+SET @@session.sort_buffer_size = 2000;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '2000'
+SET @@session.sort_buffer_size = DEFAULT;
+SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
+@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116
+1
+'#--------------------FN_DYNVARS_151_02-------------------------#'
+SET @@global.sort_buffer_size = DEFAULT;
+SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
+@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116
+1
+SET @@session.sort_buffer_size = DEFAULT;
+SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
+@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116
+1
+'#--------------------FN_DYNVARS_151_03-------------------------#'
+SET @@global.sort_buffer_size = 32776;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32776'
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+1
+SET @@global.sort_buffer_size = 32777;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32777'
+SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804
+1
+SET @@global.sort_buffer_size = 4294967295;
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+4294967295
+SET @@global.sort_buffer_size = 4294967294;
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+4294967294
+'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
+'#--------------------FN_DYNVARS_151_04-------------------------#'
+SET @@session.sort_buffer_size = 32776;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32776'
+SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+1
+SET @@session.sort_buffer_size = 32777;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32777'
+SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
+@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804
+1
+SET @@session.sort_buffer_size = 4294967295;
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+4294967295
+SET @@session.sort_buffer_size = 4294967294;
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+4294967294
+'#------------------FN_DYNVARS_151_05-----------------------#'
+SET @@global.sort_buffer_size = 32775;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32775'
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+1
+SET @@global.sort_buffer_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '0'
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+1
+SET @@global.sort_buffer_size = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '4294967296'
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+4294967295
+SET @@global.sort_buffer_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+4294967295
+SET @@global.sort_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+4294967295
+SET @@session.sort_buffer_size = 32775;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32775'
+SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+1
+SET @@session.sort_buffer_size = -2;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '0'
+SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+1
+SET @@session.sort_buffer_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.sort_buffer_size = 4294967296;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '4294967296'
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+4294967295
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.sort_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+4294967295
+'#------------------FN_DYNVARS_151_06-----------------------#'
+SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+@@global.sort_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_151_07-----------------------#'
+SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+@@session.sort_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_151_08-----------------------#'
+SET @@global.sort_buffer_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '1'
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+1
+SET @@global.sort_buffer_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '0'
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+1
+'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'
+'#---------------------FN_DYNVARS_151_09----------------------#'
+SET @@global.sort_buffer_size = 9000;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '9000'
+SELECT @@sort_buffer_size = @@global.sort_buffer_size;
+@@sort_buffer_size = @@global.sort_buffer_size
+0
+'#---------------------FN_DYNVARS_151_10----------------------#'
+SET @@sort_buffer_size = 9000;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '9000'
+SELECT @@sort_buffer_size = @@local.sort_buffer_size;
+@@sort_buffer_size = @@local.sort_buffer_size
+1
+SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
+@@local.sort_buffer_size = @@session.sort_buffer_size
+1
+'#---------------------FN_DYNVARS_151_11----------------------#'
+SET sort_buffer_size = 9100;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '9100'
+SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
+@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804
+1
+SELECT @@sort_buffer_size;
+@@sort_buffer_size
+32804
+SELECT local.sort_buffer_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.sort_buffer_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT sort_buffer_size = @@session.sort_buffer_size;
+ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list'
+SET @@global.sort_buffer_size = @start_global_value;
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+262144
+SET @@session.sort_buffer_size = @start_session_value;
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+262144
diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
new file mode 100644
index 00000000000..e9bd14abc67
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result
@@ -0,0 +1,189 @@
+SET @start_global_value = @@global.sort_buffer_size;
+SELECT @start_global_value;
+@start_global_value
+262144
+SET @start_session_value = @@session.sort_buffer_size;
+SELECT @start_session_value;
+@start_session_value
+262144
+'#--------------------FN_DYNVARS_151_01-------------------------#'
+SET @@global.sort_buffer_size = 1000;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '1000'
+SET @@global.sort_buffer_size = DEFAULT;
+SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116;
+@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116
+1
+SET @@session.sort_buffer_size = 2000;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '2000'
+SET @@session.sort_buffer_size = DEFAULT;
+SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116;
+@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116
+1
+'#--------------------FN_DYNVARS_151_02-------------------------#'
+SET @@global.sort_buffer_size = DEFAULT;
+SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116;
+@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116
+1
+SET @@session.sort_buffer_size = DEFAULT;
+SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116;
+@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116
+1
+'#--------------------FN_DYNVARS_151_03-------------------------#'
+SET @@global.sort_buffer_size = 32776;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32776'
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+1
+SET @@global.sort_buffer_size = 32777;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32777'
+SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804
+1
+SET @@global.sort_buffer_size = 4294967295;
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+4294967295
+SET @@global.sort_buffer_size = 4294967294;
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+4294967294
+'Bug# 34877: Invalid Values are showing in variable on assigning valid values.';
+'#--------------------FN_DYNVARS_151_04-------------------------#'
+SET @@session.sort_buffer_size = 32776;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32776'
+SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+1
+SET @@session.sort_buffer_size = 32777;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32777'
+SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804;
+@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804
+1
+SET @@session.sort_buffer_size = 4294967295;
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+4294967295
+SET @@session.sort_buffer_size = 4294967294;
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+4294967294
+'#------------------FN_DYNVARS_151_05-----------------------#'
+SET @@global.sort_buffer_size = 32775;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32775'
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+1
+SET @@global.sort_buffer_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '0'
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+1
+SET @@global.sort_buffer_size = 4294967296;
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+4294967296
+SET @@global.sort_buffer_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+4294967296
+SET @@global.sort_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+4294967296
+SET @@session.sort_buffer_size = 32775;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '32775'
+SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+1
+SET @@session.sort_buffer_size = -2;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '0'
+SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804;
+@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804
+1
+SET @@session.sort_buffer_size = 65530.34.;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1
+SET @@session.sort_buffer_size = 4294967296;
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+4294967296
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.sort_buffer_size = test;
+ERROR 42000: Incorrect argument type to variable 'sort_buffer_size'
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+4294967296
+'#------------------FN_DYNVARS_151_06-----------------------#'
+SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+@@global.sort_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_151_07-----------------------#'
+SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size';
+@@session.sort_buffer_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_151_08-----------------------#'
+SET @@global.sort_buffer_size = TRUE;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '1'
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+1
+SET @@global.sort_buffer_size = FALSE;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '0'
+SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804;
+@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804
+1
+'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'
+'#---------------------FN_DYNVARS_151_09----------------------#'
+SET @@global.sort_buffer_size = 9000;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '9000'
+SELECT @@sort_buffer_size = @@global.sort_buffer_size;
+@@sort_buffer_size = @@global.sort_buffer_size
+0
+'#---------------------FN_DYNVARS_151_10----------------------#'
+SET @@sort_buffer_size = 9000;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '9000'
+SELECT @@sort_buffer_size = @@local.sort_buffer_size;
+@@sort_buffer_size = @@local.sort_buffer_size
+1
+SELECT @@local.sort_buffer_size = @@session.sort_buffer_size;
+@@local.sort_buffer_size = @@session.sort_buffer_size
+1
+'#---------------------FN_DYNVARS_151_11----------------------#'
+SET sort_buffer_size = 9100;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '9100'
+SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804;
+@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804
+1
+SELECT @@sort_buffer_size;
+@@sort_buffer_size
+32804
+SELECT local.sort_buffer_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.sort_buffer_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT sort_buffer_size = @@session.sort_buffer_size;
+ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list'
+SET @@global.sort_buffer_size = @start_global_value;
+SELECT @@global.sort_buffer_size;
+@@global.sort_buffer_size
+262144
+SET @@session.sort_buffer_size = @start_session_value;
+SELECT @@session.sort_buffer_size;
+@@session.sort_buffer_size
+262144
diff --git a/mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result b/mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result
new file mode 100644
index 00000000000..3d9bfb6d218
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result
@@ -0,0 +1,105 @@
+SET @start_value = @@global.sync_binlog;
+SELECT @start_value;
+@start_value
+0
+'#--------------------FN_DYNVARS_168_01------------------------#'
+SET @@global.sync_binlog = 99;
+SET @@global.sync_binlog = DEFAULT;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
+'#---------------------FN_DYNVARS_168_02-------------------------#'
+SET @@global.sync_binlog = @start_value;
+SELECT @@global.sync_binlog = 0;
+@@global.sync_binlog = 0
+1
+'#--------------------FN_DYNVARS_168_03------------------------#'
+SET @@global.sync_binlog = 0;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
+SET @@global.sync_binlog = 1;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+1
+SET @@global.sync_binlog = 4294967295;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+4294967295
+SET @@global.sync_binlog = 4294967294;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+4294967294
+SET @@global.sync_binlog = 65536;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+65536
+'#--------------------FN_DYNVARS_168_04-------------------------#'
+SET @@global.sync_binlog = -1;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
+SET @@global.sync_binlog = 4294967296;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
+SET @@global.sync_binlog = 10240022115;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+1650087523
+SET @@global.sync_binlog = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'sync_binlog'
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+1650087523
+SET @@global.sync_binlog = -1024;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
+SET @@global.sync_binlog = 42949672950;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+4294967286
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.sync_binlog = ON;
+ERROR 42000: Incorrect argument type to variable 'sync_binlog'
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+4294967286
+SET @@global.sync_binlog = 'test';
+ERROR 42000: Incorrect argument type to variable 'sync_binlog'
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+4294967286
+'#-------------------FN_DYNVARS_168_05----------------------------#'
+SET @@session.sync_binlog = 0;
+ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@sync_binlog;
+@@sync_binlog
+4294967286
+'#----------------------FN_DYNVARS_168_06------------------------#'
+SELECT @@global.sync_binlog = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='sync_binlog';
+@@global.sync_binlog = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_168_07----------------------#'
+SET sync_binlog = 1;
+ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@sync_binlog;
+@@sync_binlog
+4294967286
+SET local.sync_binlog = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
+SELECT local.sync_binlog;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.sync_binlog = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
+SELECT global.sync_binlog;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT sync_binlog = @@session.sync_binlog;
+ERROR 42S22: Unknown column 'sync_binlog' in 'field list'
+SET @@global.sync_binlog = @start_value;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
diff --git a/mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result b/mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result
new file mode 100644
index 00000000000..ffd1b3fc4f1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result
@@ -0,0 +1,105 @@
+SET @start_value = @@global.sync_binlog;
+SELECT @start_value;
+@start_value
+0
+'#--------------------FN_DYNVARS_168_01------------------------#'
+SET @@global.sync_binlog = 99;
+SET @@global.sync_binlog = DEFAULT;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
+'#---------------------FN_DYNVARS_168_02-------------------------#'
+SET @@global.sync_binlog = @start_value;
+SELECT @@global.sync_binlog = 0;
+@@global.sync_binlog = 0
+1
+'#--------------------FN_DYNVARS_168_03------------------------#'
+SET @@global.sync_binlog = 0;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
+SET @@global.sync_binlog = 1;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+1
+SET @@global.sync_binlog = 4294967295;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+4294967295
+SET @@global.sync_binlog = 4294967294;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+4294967294
+SET @@global.sync_binlog = 65536;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+65536
+'#--------------------FN_DYNVARS_168_04-------------------------#'
+SET @@global.sync_binlog = -1;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
+SET @@global.sync_binlog = 4294967296;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+4294967296
+SET @@global.sync_binlog = 10240022115;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+10240022115
+SET @@global.sync_binlog = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'sync_binlog'
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+10240022115
+SET @@global.sync_binlog = -1024;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
+SET @@global.sync_binlog = 42949672950;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+42949672950
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.sync_binlog = ON;
+ERROR 42000: Incorrect argument type to variable 'sync_binlog'
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+42949672950
+SET @@global.sync_binlog = 'test';
+ERROR 42000: Incorrect argument type to variable 'sync_binlog'
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+42949672950
+'#-------------------FN_DYNVARS_168_05----------------------------#'
+SET @@session.sync_binlog = 0;
+ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@sync_binlog;
+@@sync_binlog
+42949672950
+'#----------------------FN_DYNVARS_168_06------------------------#'
+SELECT @@global.sync_binlog = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='sync_binlog';
+@@global.sync_binlog = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_168_07----------------------#'
+SET sync_binlog = 1;
+ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@sync_binlog;
+@@sync_binlog
+42949672950
+SET local.sync_binlog = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
+SELECT local.sync_binlog;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.sync_binlog = 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1
+SELECT global.sync_binlog;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT sync_binlog = @@session.sync_binlog;
+ERROR 42S22: Unknown column 'sync_binlog' in 'field list'
+SET @@global.sync_binlog = @start_value;
+SELECT @@global.sync_binlog;
+@@global.sync_binlog
+0
diff --git a/mysql-test/suite/sys_vars/r/timestamp_basic_32.result b/mysql-test/suite/sys_vars/r/timestamp_basic_32.result
new file mode 100644
index 00000000000..cc4f0324c0f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/timestamp_basic_32.result
@@ -0,0 +1,73 @@
+SET @session_start_value = @@session.timestamp;
+'#--------------------FN_DYNVARS_001_01------------------------#'
+SET @@timestamp = DEFAULT;
+'timestamp does not have any DEFAULT value'
+'#---------------------FN_DYNVARS_001_02-------------------------#'
+SET @@global.timestamp = "1000";
+ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL
+'#--------------------FN_DYNVARS_001_03------------------------#'
+SET @@timestamp = 0;
+'Setting 0 resets timestamp to session default timestamp'
+SET @@timestamp = 123456789123456;
+SELECT @@timestamp;
+@@timestamp
+2249167232
+SET @@timestamp = 60*60*60*60*365;
+SELECT @@timestamp;
+@@timestamp
+435432704
+SET @@timestamp = -1000000000;
+SELECT @@timestamp;
+@@timestamp
+3294967296
+SET @temp_ts = @@timestamp - @@timestamp;
+SELECT @temp_ts;
+@temp_ts
+0
+'#--------------------FN_DYNVARS_001_04-------------------------#'
+SET @@timestamp = "100";
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+'Bug# 34836: Documentation says its a string variable but infact its numeric'
+SET @@timestamp = " ";
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+SET @@timestamp = 1.1;
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+SET @@timestamp = 9999999999999999999999;
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+'#----------------------FN_DYNVARS_001_06------------------------#'
+SELECT @@timestamp = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='timestamp';
+@@timestamp = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_08-------------------------#'
+SET @@timestamp = OFF;
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+SET @@timestamp = ON;
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+SET @@timestamp = TRUE;
+SELECT @@timestamp;
+@@timestamp
+1
+SET @@timestamp = FALSE;
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@timestamp = 123456;
+SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
+@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
+1
+SET @@timestamp = 654321;
+SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
+@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET timestamp = 1;
+SELECT @@timestamp;
+@@timestamp
+1
+SELECT local.timestamp;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.timestamp;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT timestamp = @@session.timestamp;
+ERROR 42S22: Unknown column 'timestamp' in 'field list'
+SET @@timestamp = @session_start_value;
diff --git a/mysql-test/suite/sys_vars/r/timestamp_basic_64.result b/mysql-test/suite/sys_vars/r/timestamp_basic_64.result
new file mode 100644
index 00000000000..df877cd455b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/timestamp_basic_64.result
@@ -0,0 +1,73 @@
+SET @session_start_value = @@session.timestamp;
+'#--------------------FN_DYNVARS_001_01------------------------#'
+SET @@timestamp = DEFAULT;
+'timestamp does not have any DEFAULT value'
+'#---------------------FN_DYNVARS_001_02-------------------------#'
+SET @@global.timestamp = "1000";
+ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL
+'#--------------------FN_DYNVARS_001_03------------------------#'
+SET @@timestamp = 0;
+'Setting 0 resets timestamp to session default timestamp'
+SET @@timestamp = 123456789123456;
+SELECT @@timestamp;
+@@timestamp
+123456789123456
+SET @@timestamp = 60*60*60*60*365;
+SELECT @@timestamp;
+@@timestamp
+4730400000
+SET @@timestamp = -1000000000;
+SELECT @@timestamp;
+@@timestamp
+18446744072709551616
+SET @temp_ts = @@timestamp - @@timestamp;
+SELECT @temp_ts;
+@temp_ts
+0
+'#--------------------FN_DYNVARS_001_04-------------------------#'
+SET @@timestamp = "100";
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+'Bug# 34836: Documentation says its a string variable but infact its numeric'
+SET @@timestamp = " ";
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+SET @@timestamp = 1.1;
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+SET @@timestamp = 9999999999999999999999;
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+'#----------------------FN_DYNVARS_001_06------------------------#'
+SELECT @@timestamp = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='timestamp';
+@@timestamp = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_08-------------------------#'
+SET @@timestamp = OFF;
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+SET @@timestamp = ON;
+ERROR 42000: Incorrect argument type to variable 'timestamp'
+SET @@timestamp = TRUE;
+SELECT @@timestamp;
+@@timestamp
+1
+SET @@timestamp = FALSE;
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@timestamp = 123456;
+SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
+@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
+1
+SET @@timestamp = 654321;
+SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp;
+@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET timestamp = 1;
+SELECT @@timestamp;
+@@timestamp
+1
+SELECT local.timestamp;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.timestamp;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT timestamp = @@session.timestamp;
+ERROR 42S22: Unknown column 'timestamp' in 'field list'
+SET @@timestamp = @session_start_value;
diff --git a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result b/mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result
new file mode 100644
index 00000000000..aeafd95ed55
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result
@@ -0,0 +1,172 @@
+SET @start_global_value = @@global.tmp_table_size;
+SELECT @start_global_value;
+@start_global_value
+16777216
+SET @start_session_value = @@session.tmp_table_size;
+SELECT @start_session_value;
+@start_session_value
+16777216
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.tmp_table_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '100'
+SET @@global.tmp_table_size = DEFAULT;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+16777216
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+SET @@session.tmp_table_size = 200;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '200'
+SET @@session.tmp_table_size = DEFAULT;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+16777216
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.tmp_table_size = DEFAULT;
+SELECT @@global.tmp_table_size = 33554432;
+@@global.tmp_table_size = 33554432
+0
+SET @@session.tmp_table_size = DEFAULT;
+SELECT @@session.tmp_table_size = 33554432;
+@@session.tmp_table_size = 33554432
+0
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.tmp_table_size = 1024;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = 60020;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+60020
+SET @@global.tmp_table_size = 4294967295;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+4294967295
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.tmp_table_size = 1024;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+1024
+SET @@session.tmp_table_size =4294967295;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+4294967295
+SET @@session.tmp_table_size = 65535;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+65535
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.tmp_table_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = 1000;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '1000'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.tmp_table_size = ON;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@global.tmp_table_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@global.tmp_table_size = True;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '1'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = False;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
+SET @@global.tmp_table_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@global.tmp_table_size ="Test";
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = ON;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = True;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '1'
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+1024
+SET @@session.tmp_table_size = False;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+1024
+SET @@session.tmp_table_size = "Test";
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = 12345678901;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+4294967295
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.tmp_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='tmp_table_size';
+@@global.tmp_table_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.tmp_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='tmp_table_size';
+@@session.tmp_table_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.tmp_table_size = 1024;
+SET @@tmp_table_size = 4294967295;
+SELECT @@tmp_table_size = @@global.tmp_table_size;
+@@tmp_table_size = @@global.tmp_table_size
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@tmp_table_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '100'
+SELECT @@tmp_table_size = @@local.tmp_table_size;
+@@tmp_table_size = @@local.tmp_table_size
+1
+SELECT @@local.tmp_table_size = @@session.tmp_table_size;
+@@local.tmp_table_size = @@session.tmp_table_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET tmp_table_size = 1027;
+SELECT @@tmp_table_size;
+@@tmp_table_size
+1027
+SELECT local.tmp_table_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT global.tmp_table_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT tmp_table_size = @@session.tmp_table_size;
+ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
+SET @@global.tmp_table_size = @start_global_value;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+16777216
+SET @@session.tmp_table_size = @start_session_value;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+16777216
diff --git a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result b/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result
new file mode 100644
index 00000000000..837b90fc143
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result
@@ -0,0 +1,172 @@
+SET @start_global_value = @@global.tmp_table_size;
+SELECT @start_global_value;
+@start_global_value
+16777216
+SET @start_session_value = @@session.tmp_table_size;
+SELECT @start_session_value;
+@start_session_value
+16777216
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.tmp_table_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '100'
+SET @@global.tmp_table_size = DEFAULT;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+16777216
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+SET @@session.tmp_table_size = 200;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '200'
+SET @@session.tmp_table_size = DEFAULT;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+16777216
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.tmp_table_size = DEFAULT;
+SELECT @@global.tmp_table_size = 33554432;
+@@global.tmp_table_size = 33554432
+0
+SET @@session.tmp_table_size = DEFAULT;
+SELECT @@session.tmp_table_size = 33554432;
+@@session.tmp_table_size = 33554432
+0
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.tmp_table_size = 1024;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = 60020;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+60020
+SET @@global.tmp_table_size = 4294967295;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+4294967295
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.tmp_table_size = 1024;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+1024
+SET @@session.tmp_table_size =4294967295;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+4294967295
+SET @@session.tmp_table_size = 65535;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+65535
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.tmp_table_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = 1000;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '1000'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.tmp_table_size = ON;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@global.tmp_table_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@global.tmp_table_size = True;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '1'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = False;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
+SET @@global.tmp_table_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@global.tmp_table_size ="Test";
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = ON;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = True;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '1'
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+1024
+SET @@session.tmp_table_size = False;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+1024
+SET @@session.tmp_table_size = "Test";
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = 12345678901;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+12345678901
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.tmp_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='tmp_table_size';
+@@global.tmp_table_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.tmp_table_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='tmp_table_size';
+@@session.tmp_table_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.tmp_table_size = 1024;
+SET @@tmp_table_size = 4294967295;
+SELECT @@tmp_table_size = @@global.tmp_table_size;
+@@tmp_table_size = @@global.tmp_table_size
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@tmp_table_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '100'
+SELECT @@tmp_table_size = @@local.tmp_table_size;
+@@tmp_table_size = @@local.tmp_table_size
+1
+SELECT @@local.tmp_table_size = @@session.tmp_table_size;
+@@local.tmp_table_size = @@session.tmp_table_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET tmp_table_size = 1027;
+SELECT @@tmp_table_size;
+@@tmp_table_size
+1027
+SELECT local.tmp_table_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT global.tmp_table_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT tmp_table_size = @@session.tmp_table_size;
+ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
+SET @@global.tmp_table_size = @start_global_value;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+16777216
+SET @@session.tmp_table_size = @start_session_value;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+16777216
diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
new file mode 100644
index 00000000000..706d7802ed3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result
@@ -0,0 +1,180 @@
+SET @start_global_value = @@global.transaction_alloc_block_size;
+SELECT @start_global_value;
+@start_global_value
+8192
+SET @start_session_value = @@session.transaction_alloc_block_size;
+SELECT @start_session_value;
+@start_session_value
+8192
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.transaction_alloc_block_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '100'
+SET @@global.transaction_alloc_block_size = DEFAULT;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+8192
+SET @@session.transaction_alloc_block_size = 200;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '200'
+SET @@session.transaction_alloc_block_size = DEFAULT;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+8192
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.transaction_alloc_block_size = DEFAULT;
+SELECT @@global.transaction_alloc_block_size = 8192;
+@@global.transaction_alloc_block_size = 8192
+1
+SET @@session.transaction_alloc_block_size = DEFAULT;
+SELECT @@session.transaction_alloc_block_size = 8192;
+@@session.transaction_alloc_block_size = 8192
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.transaction_alloc_block_size = 1024;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@global.transaction_alloc_block_size = 60020;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+59392
+SET @@global.transaction_alloc_block_size = 4294967295;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+4294966272
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.transaction_alloc_block_size = 1024;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+1024
+SET @@session.transaction_alloc_block_size =4294967295;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+4294966272
+SET @@session.transaction_alloc_block_size = 65535;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+64512
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.transaction_alloc_block_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@global.transaction_alloc_block_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@global.transaction_alloc_block_size = 123456789201;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '123456789201'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+4294966272
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.transaction_alloc_block_size = ON;
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@global.transaction_alloc_block_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@global.transaction_alloc_block_size = True;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@global.transaction_alloc_block_size = False;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@global.transaction_alloc_block_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@global.transaction_alloc_block_size ="Test";
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@global.transaction_alloc_block_size = 1000;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1000'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@session.transaction_alloc_block_size = 12345678901;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '12345678901'
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+4294966272
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.transaction_alloc_block_size = ON;
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@session.transaction_alloc_block_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@session.transaction_alloc_block_size = True;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1'
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+1024
+SET @@session.transaction_alloc_block_size = False;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+1024
+SET @@session.transaction_alloc_block_size = "Test";
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@session.transaction_alloc_block_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='transaction_alloc_block_size';
+@@global.transaction_alloc_block_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='transaction_alloc_block_size';
+@@session.transaction_alloc_block_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_08----------------------#'
+SET @@transaction_alloc_block_size = 1024;
+SET @@global.transaction_alloc_block_size = 4294967295;
+SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
+@@transaction_alloc_block_size = @@global.transaction_alloc_block_size
+0
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@transaction_alloc_block_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '100'
+SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size;
+@@transaction_alloc_block_size = @@local.transaction_alloc_block_size
+1
+SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size;
+@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size
+1
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET transaction_alloc_block_size = 1027;
+SELECT @@transaction_alloc_block_size;
+@@transaction_alloc_block_size
+1024
+SELECT local.transaction_alloc_block_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.transaction_alloc_block_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size;
+ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list'
+SET @@global.transaction_alloc_block_size = @start_global_value;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+8192
+SET @@session.tmp_table_size = @start_session_value;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+1024
diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result
new file mode 100644
index 00000000000..c968d6f108c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result
@@ -0,0 +1,176 @@
+SET @start_global_value = @@global.transaction_alloc_block_size;
+SELECT @start_global_value;
+@start_global_value
+8192
+SET @start_session_value = @@session.transaction_alloc_block_size;
+SELECT @start_session_value;
+@start_session_value
+8192
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.transaction_alloc_block_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '100'
+SET @@global.transaction_alloc_block_size = DEFAULT;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+8192
+SET @@session.transaction_alloc_block_size = 200;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '200'
+SET @@session.transaction_alloc_block_size = DEFAULT;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+8192
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.transaction_alloc_block_size = DEFAULT;
+SELECT @@global.transaction_alloc_block_size = 8192;
+@@global.transaction_alloc_block_size = 8192
+1
+SET @@session.transaction_alloc_block_size = DEFAULT;
+SELECT @@session.transaction_alloc_block_size = 8192;
+@@session.transaction_alloc_block_size = 8192
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.transaction_alloc_block_size = 1024;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@global.transaction_alloc_block_size = 60020;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+59392
+SET @@global.transaction_alloc_block_size = 4294967295;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+4294966272
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.transaction_alloc_block_size = 1024;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+1024
+SET @@session.transaction_alloc_block_size =4294967295;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+4294966272
+SET @@session.transaction_alloc_block_size = 65535;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+64512
+'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.transaction_alloc_block_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@global.transaction_alloc_block_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@global.transaction_alloc_block_size = 123456789201;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+123456788480
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.transaction_alloc_block_size = ON;
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@global.transaction_alloc_block_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@global.transaction_alloc_block_size = True;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@global.transaction_alloc_block_size = False;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@global.transaction_alloc_block_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@global.transaction_alloc_block_size ="Test";
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@global.transaction_alloc_block_size = 1000;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1000'
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+1024
+SET @@session.transaction_alloc_block_size = 12345678901;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+12345678848
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@session.transaction_alloc_block_size = ON;
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@session.transaction_alloc_block_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@session.transaction_alloc_block_size = True;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '1'
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+1024
+SET @@session.transaction_alloc_block_size = False;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '0'
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+1024
+SET @@session.transaction_alloc_block_size = "Test";
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+SET @@session.transaction_alloc_block_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size'
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='transaction_alloc_block_size';
+@@global.transaction_alloc_block_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='transaction_alloc_block_size';
+@@session.transaction_alloc_block_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_08----------------------#'
+SET @@transaction_alloc_block_size = 1024;
+SET @@global.transaction_alloc_block_size = 4294967295;
+SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size;
+@@transaction_alloc_block_size = @@global.transaction_alloc_block_size
+0
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@transaction_alloc_block_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect transaction_alloc_block_size value: '100'
+SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size;
+@@transaction_alloc_block_size = @@local.transaction_alloc_block_size
+1
+SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size;
+@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size
+1
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET transaction_alloc_block_size = 1027;
+SELECT @@transaction_alloc_block_size;
+@@transaction_alloc_block_size
+1024
+SELECT local.transaction_alloc_block_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.transaction_alloc_block_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size;
+ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list'
+SET @@global.transaction_alloc_block_size = @start_global_value;
+SELECT @@global.transaction_alloc_block_size;
+@@global.transaction_alloc_block_size
+8192
+SET @@session.tmp_table_size = @start_session_value;
+SELECT @@session.transaction_alloc_block_size;
+@@session.transaction_alloc_block_size
+1024
diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result
new file mode 100644
index 00000000000..3df7a55595e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result
@@ -0,0 +1,172 @@
+SET @start_global_value = @@global.transaction_prealloc_size;
+SELECT @start_global_value;
+@start_global_value
+4096
+SET @start_session_value = @@session.transaction_prealloc_size;
+SELECT @start_session_value;
+@start_session_value
+4096
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.transaction_prealloc_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '100'
+SET @@global.transaction_prealloc_size = DEFAULT;
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+4096
+SET @@session.transaction_prealloc_size = 200;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '200'
+SET @@session.transaction_prealloc_size = DEFAULT;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+4096
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.transaction_prealloc_size = DEFAULT;
+SELECT @@global.transaction_prealloc_size = 4096;
+@@global.transaction_prealloc_size = 4096
+1
+SET @@session.transaction_prealloc_size = DEFAULT;
+SELECT @@session.transaction_prealloc_size = 4096;
+@@session.transaction_prealloc_size = 4096
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.transaction_prealloc_size = 1024;
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+SET @@global.transaction_prealloc_size = 60020;
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+59392
+SET @@global.transaction_prealloc_size = 4294966272;
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+4294966272
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.transaction_prealloc_size = 1024;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+1024
+SET @@session.transaction_prealloc_size =4294966272;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+4294966272
+SET @@session.transaction_prealloc_size = 65535;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+64512
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.transaction_prealloc_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+SET @@global.transaction_prealloc_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.transaction_prealloc_size = ON;
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@global.transaction_prealloc_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@global.transaction_prealloc_size = True;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '1'
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+SET @@global.transaction_prealloc_size = False;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+SET @@global.transaction_prealloc_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@global.transaction_prealloc_size ="Test";
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@global.transaction_prealloc_size = 1000;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '1000'
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+SET @@session.transaction_prealloc_size = ON;
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@session.transaction_prealloc_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@session.transaction_prealloc_size = True;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '1'
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+1024
+SET @@session.transaction_prealloc_size = False;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+1024
+SET @@session.transaction_prealloc_size = "Test";
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@session.transaction_prealloc_size = 123456789031;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '123456789031'
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+4294966272
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='transaction_prealloc_size';
+@@global.transaction_prealloc_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='transaction_prealloc_size';
+@@session.transaction_prealloc_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.transaction_prealloc_size = 1024;
+SET @@global.transaction_prealloc_size = 10;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '10'
+SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
+@@transaction_prealloc_size = @@global.transaction_prealloc_size
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@transaction_prealloc_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '100'
+SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size;
+@@transaction_prealloc_size = @@local.transaction_prealloc_size
+1
+SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size;
+@@local.transaction_prealloc_size = @@session.transaction_prealloc_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET transaction_prealloc_size = 1027;
+SELECT @@transaction_prealloc_size;
+@@transaction_prealloc_size
+1024
+SELECT local.transaction_prealloc_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.transaction_prealloc_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT transaction_prealloc_size = @@session.transaction_prealloc_size;
+ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list'
+SET @@global.transaction_prealloc_size = @start_global_value;
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+4096
+SET @@session.transaction_prealloc_size = @start_session_value;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+4096
diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result
new file mode 100644
index 00000000000..2fb6451372f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result
@@ -0,0 +1,170 @@
+SET @start_global_value = @@global.transaction_prealloc_size;
+SELECT @start_global_value;
+@start_global_value
+4096
+SET @start_session_value = @@session.transaction_prealloc_size;
+SELECT @start_session_value;
+@start_session_value
+4096
+'Bug# 34876: This variable has invalid default value as compared to documentation';
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.transaction_prealloc_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '100'
+SET @@global.transaction_prealloc_size = DEFAULT;
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+4096
+SET @@session.transaction_prealloc_size = 200;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '200'
+SET @@session.transaction_prealloc_size = DEFAULT;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+4096
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.transaction_prealloc_size = DEFAULT;
+SELECT @@global.transaction_prealloc_size = 4096;
+@@global.transaction_prealloc_size = 4096
+1
+SET @@session.transaction_prealloc_size = DEFAULT;
+SELECT @@session.transaction_prealloc_size = 4096;
+@@session.transaction_prealloc_size = 4096
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.transaction_prealloc_size = 1024;
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+SET @@global.transaction_prealloc_size = 60020;
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+59392
+SET @@global.transaction_prealloc_size = 4294966272;
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+4294966272
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.transaction_prealloc_size = 1024;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+1024
+SET @@session.transaction_prealloc_size =4294966272;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+4294966272
+SET @@session.transaction_prealloc_size = 65535;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+64512
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.transaction_prealloc_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+SET @@global.transaction_prealloc_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.transaction_prealloc_size = ON;
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@global.transaction_prealloc_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@global.transaction_prealloc_size = True;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '1'
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+SET @@global.transaction_prealloc_size = False;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+SET @@global.transaction_prealloc_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@global.transaction_prealloc_size ="Test";
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@global.transaction_prealloc_size = 1000;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '1000'
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+1024
+SET @@session.transaction_prealloc_size = ON;
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@session.transaction_prealloc_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@session.transaction_prealloc_size = True;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '1'
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+1024
+SET @@session.transaction_prealloc_size = False;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '0'
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+1024
+SET @@session.transaction_prealloc_size = "Test";
+ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size'
+SET @@session.transaction_prealloc_size = 123456789031;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+123456788480
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='transaction_prealloc_size';
+@@global.transaction_prealloc_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
+WHERE VARIABLE_NAME='transaction_prealloc_size';
+@@session.transaction_prealloc_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.transaction_prealloc_size = 1024;
+SET @@global.transaction_prealloc_size = 10;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '10'
+SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
+@@transaction_prealloc_size = @@global.transaction_prealloc_size
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@transaction_prealloc_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect transaction_prealloc_size value: '100'
+SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size;
+@@transaction_prealloc_size = @@local.transaction_prealloc_size
+1
+SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size;
+@@local.transaction_prealloc_size = @@session.transaction_prealloc_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET transaction_prealloc_size = 1027;
+SELECT @@transaction_prealloc_size;
+@@transaction_prealloc_size
+1024
+SELECT local.transaction_prealloc_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.transaction_prealloc_size;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT transaction_prealloc_size = @@session.transaction_prealloc_size;
+ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list'
+SET @@global.transaction_prealloc_size = @start_global_value;
+SELECT @@global.transaction_prealloc_size;
+@@global.transaction_prealloc_size
+4096
+SET @@session.transaction_prealloc_size = @start_session_value;
+SELECT @@session.transaction_prealloc_size;
+@@session.transaction_prealloc_size
+4096
diff --git a/mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result b/mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result
new file mode 100644
index 00000000000..ae03e677e56
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result
@@ -0,0 +1,129 @@
+SET @start_global_value = @@global.wait_timeout;
+SET @start_session_value = @@session.wait_timeout;
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.wait_timeout = 100;
+SET @@global.wait_timeout = DEFAULT;
+SELECT @@global.wait_timeout;
+@@global.wait_timeout
+28800
+SET @@session.wait_timeout = 200;
+SET @@session.wait_timeout = DEFAULT;
+SELECT @@session.wait_timeout;
+@@session.wait_timeout
+28800
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.wait_timeout = DEFAULT;
+SELECT @@global.wait_timeout = @default_wait_timeout;
+@@global.wait_timeout = @default_wait_timeout
+1
+SET @@session.wait_timeout = DEFAULT;
+SELECT @@session.wait_timeout = @default_wait_timeout;
+@@session.wait_timeout = @default_wait_timeout
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.wait_timeout= 1;
+SELECT @@global.wait_timeout;
+@@global.wait_timeout
+1
+SET @@global.wait_timeout = 60020;
+SELECT @@global.wait_timeout;
+@@global.wait_timeout
+60020
+SET @@global.wait_timeout = 31536000;
+SELECT @@global.wait_timeout = @max_wait_timeout;
+@@global.wait_timeout = @max_wait_timeout
+1
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.wait_timeout =6000;
+SELECT @@session.wait_timeout;
+@@session.wait_timeout
+6000
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.wait_timeout = 0;
+Warnings:
+Warning	1292	Truncated incorrect wait_timeout value: '0'
+SET @@global.wait_timeout = -1024;
+Warnings:
+Warning	1292	Truncated incorrect wait_timeout value: '0'
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.wait_timeout = ON;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@global.wait_timeout = OFF;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@global.wait_timeout = True;
+SELECT @@global.wait_timeout;
+@@global.wait_timeout
+1
+SET @@global.wait_timeout = False;
+Warnings:
+Warning	1292	Truncated incorrect wait_timeout value: '0'
+SELECT @@global.wait_timeout;
+@@global.wait_timeout
+1
+SET @@global.wait_timeout = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@global.wait_timeout ="Test";
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@session.wait_timeout = ON;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@session.wait_timeout = OFF;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@session.wait_timeout = True;
+SELECT @@session.wait_timeout;
+@@session.wait_timeout
+1
+SET @@session.wait_timeout = False;
+Warnings:
+Warning	1292	Truncated incorrect wait_timeout value: '0'
+SELECT @@session.wait_timeout;
+@@session.wait_timeout
+1
+SET @@session.wait_timeout = "Test";
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@session.wait_timeout = 'test';
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@session.wait_timeout = 123456789031;
+Warnings:
+Warning	1292	Truncated incorrect wait_timeout value: '123456789031'
+SELECT @@session.wait_timeout = @max_wait_timeout;
+@@session.wait_timeout = @max_wait_timeout
+1
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.wait_timeout = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='wait_timeout';
+@@global.wait_timeout = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.wait_timeout = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='wait_timeout';
+@@session.wait_timeout = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.wait_timeout = 30000;
+SET @@global.wait_timeout = 40000;
+SELECT @@wait_timeout = @@global.wait_timeout;
+@@wait_timeout = @@global.wait_timeout
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@wait_timeout = 100;
+SELECT @@wait_timeout = @@local.wait_timeout;
+@@wait_timeout = @@local.wait_timeout
+1
+SELECT @@local.wait_timeout = @@session.wait_timeout;
+@@local.wait_timeout = @@session.wait_timeout
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET wait_timeout = 1027;
+SELECT @@wait_timeout;
+@@wait_timeout
+1027
+SELECT local.wait_timeout;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.wait_timeout;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT wait_timeout = @@session.wait_timeout;
+ERROR 42S22: Unknown column 'wait_timeout' in 'field list'
+SET @@global.wait_timeout = @start_global_value;
+SET @@session.wait_timeout = @start_session_value;
diff --git a/mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result b/mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result
new file mode 100644
index 00000000000..ae03e677e56
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result
@@ -0,0 +1,129 @@
+SET @start_global_value = @@global.wait_timeout;
+SET @start_session_value = @@session.wait_timeout;
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.wait_timeout = 100;
+SET @@global.wait_timeout = DEFAULT;
+SELECT @@global.wait_timeout;
+@@global.wait_timeout
+28800
+SET @@session.wait_timeout = 200;
+SET @@session.wait_timeout = DEFAULT;
+SELECT @@session.wait_timeout;
+@@session.wait_timeout
+28800
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SET @@global.wait_timeout = DEFAULT;
+SELECT @@global.wait_timeout = @default_wait_timeout;
+@@global.wait_timeout = @default_wait_timeout
+1
+SET @@session.wait_timeout = DEFAULT;
+SELECT @@session.wait_timeout = @default_wait_timeout;
+@@session.wait_timeout = @default_wait_timeout
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.wait_timeout= 1;
+SELECT @@global.wait_timeout;
+@@global.wait_timeout
+1
+SET @@global.wait_timeout = 60020;
+SELECT @@global.wait_timeout;
+@@global.wait_timeout
+60020
+SET @@global.wait_timeout = 31536000;
+SELECT @@global.wait_timeout = @max_wait_timeout;
+@@global.wait_timeout = @max_wait_timeout
+1
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.wait_timeout =6000;
+SELECT @@session.wait_timeout;
+@@session.wait_timeout
+6000
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.wait_timeout = 0;
+Warnings:
+Warning	1292	Truncated incorrect wait_timeout value: '0'
+SET @@global.wait_timeout = -1024;
+Warnings:
+Warning	1292	Truncated incorrect wait_timeout value: '0'
+'Bug # 34837: Errors are not coming on assigning invalid values to variable';
+SET @@global.wait_timeout = ON;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@global.wait_timeout = OFF;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@global.wait_timeout = True;
+SELECT @@global.wait_timeout;
+@@global.wait_timeout
+1
+SET @@global.wait_timeout = False;
+Warnings:
+Warning	1292	Truncated incorrect wait_timeout value: '0'
+SELECT @@global.wait_timeout;
+@@global.wait_timeout
+1
+SET @@global.wait_timeout = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@global.wait_timeout ="Test";
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@session.wait_timeout = ON;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@session.wait_timeout = OFF;
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@session.wait_timeout = True;
+SELECT @@session.wait_timeout;
+@@session.wait_timeout
+1
+SET @@session.wait_timeout = False;
+Warnings:
+Warning	1292	Truncated incorrect wait_timeout value: '0'
+SELECT @@session.wait_timeout;
+@@session.wait_timeout
+1
+SET @@session.wait_timeout = "Test";
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@session.wait_timeout = 'test';
+ERROR 42000: Incorrect argument type to variable 'wait_timeout'
+SET @@session.wait_timeout = 123456789031;
+Warnings:
+Warning	1292	Truncated incorrect wait_timeout value: '123456789031'
+SELECT @@session.wait_timeout = @max_wait_timeout;
+@@session.wait_timeout = @max_wait_timeout
+1
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.wait_timeout = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME='wait_timeout';
+@@global.wait_timeout = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.wait_timeout = VARIABLE_VALUE 
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='wait_timeout';
+@@session.wait_timeout = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.wait_timeout = 30000;
+SET @@global.wait_timeout = 40000;
+SELECT @@wait_timeout = @@global.wait_timeout;
+@@wait_timeout = @@global.wait_timeout
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@wait_timeout = 100;
+SELECT @@wait_timeout = @@local.wait_timeout;
+@@wait_timeout = @@local.wait_timeout
+1
+SELECT @@local.wait_timeout = @@session.wait_timeout;
+@@local.wait_timeout = @@session.wait_timeout
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET wait_timeout = 1027;
+SELECT @@wait_timeout;
+@@wait_timeout
+1027
+SELECT local.wait_timeout;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT session.wait_timeout;
+ERROR 42S02: Unknown table 'session' in field list
+SELECT wait_timeout = @@session.wait_timeout;
+ERROR 42S22: Unknown column 'wait_timeout' in 'field list'
+SET @@global.wait_timeout = @start_global_value;
+SET @@session.wait_timeout = @start_session_value;
diff --git a/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_32.test
new file mode 100644
index 00000000000..1c6d805683f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# created by Horst Hunger        2008-05-07                                    #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/binlog_cache_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_64.test
new file mode 100644
index 00000000000..1074bb46069
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# created by Horst Hunger        2008-05-07                                    #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/binlog_cache_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_32.test
new file mode 100644
index 00000000000..84a90d42bec
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_64.test
new file mode 100644
index 00000000000..4727daf0b4b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_32.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_32.test
new file mode 100644
index 00000000000..7cbce057bec
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/delayed_insert_limit_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_64.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_64.test
new file mode 100644
index 00000000000..fbc31e937fe
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/delayed_insert_limit_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_32.test b/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_32.test
new file mode 100644
index 00000000000..1e67d426f10
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/delayed_queue_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_64.test b/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_64.test
new file mode 100644
index 00000000000..44d5839759c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/delayed_queue_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test
new file mode 100644
index 00000000000..13e1b205a4d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test
new file mode 100644
index 00000000000..fc26c903de5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test
new file mode 100644
index 00000000000..8396755844e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/innodb_max_purge_lag_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test
new file mode 100644
index 00000000000..4744cee20d9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/innodb_max_purge_lag_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test
new file mode 100644
index 00000000000..981b6c4e992
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test
new file mode 100644
index 00000000000..ab7c01c5b6d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/join_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/join_buffer_size_basic_32.test
new file mode 100644
index 00000000000..f6b35b89644
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/join_buffer_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/join_buffer_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/join_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/join_buffer_size_basic_64.test
new file mode 100644
index 00000000000..5632471235f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/join_buffer_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/join_buffer_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test
new file mode 100644
index 00000000000..086e51e185c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/key_buffer_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test
new file mode 100644
index 00000000000..5604c56480b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/key_buffer_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_32.test b/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_32.test
new file mode 100644
index 00000000000..8a234d9d300
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/key_cache_age_threshold_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_64.test b/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_64.test
new file mode 100644
index 00000000000..32f98cba941
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/key_cache_age_threshold_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test
new file mode 100644
index 00000000000..db0c0bd67a2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/key_cache_block_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test
new file mode 100644
index 00000000000..7403d762dc4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/key_cache_block_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test
new file mode 100644
index 00000000000..fcc28438866
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/key_cache_division_limit_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test
new file mode 100644
index 00000000000..ac4dd1c96d3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/key_cache_division_limit_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/log_warnings_basic_32.test b/mysql-test/suite/sys_vars/t/log_warnings_basic_32.test
new file mode 100644
index 00000000000..a63cbed2aa3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_warnings_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/log_warnings_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/log_warnings_basic_64.test b/mysql-test/suite/sys_vars/t/log_warnings_basic_64.test
new file mode 100644
index 00000000000..5a8ad5482a5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_warnings_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/log_warnings_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test
new file mode 100644
index 00000000000..51386b1f994
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/max_binlog_cache_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test
new file mode 100644
index 00000000000..c7c757341fa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/max_binlog_cache_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_connect_errors_basic_32.test b/mysql-test/suite/sys_vars/t/max_connect_errors_basic_32.test
new file mode 100644
index 00000000000..62c7ec71568
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_connect_errors_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/max_connect_errors_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_connect_errors_basic_64.test b/mysql-test/suite/sys_vars/t/max_connect_errors_basic_64.test
new file mode 100644
index 00000000000..f27135d53c7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_connect_errors_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/max_connect_errors_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test
new file mode 100644
index 00000000000..180c41a5ecf
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/max_heap_table_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test
new file mode 100644
index 00000000000..89d234f5399
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/max_heap_table_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_32.test b/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_32.test
new file mode 100644
index 00000000000..84d76c7cb43
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/max_seeks_for_key_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_64.test b/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_64.test
new file mode 100644
index 00000000000..63c0c1d6a6b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/max_seeks_for_key_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_32.test b/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_32.test
new file mode 100644
index 00000000000..95ce399e68e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/max_tmp_tables_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_64.test b/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_64.test
new file mode 100644
index 00000000000..573e5a75230
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/max_tmp_tables_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_32.test b/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_32.test
new file mode 100644
index 00000000000..b4953208976
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/max_write_lock_count_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_64.test b/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_64.test
new file mode 100644
index 00000000000..b0c5dabac07
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/max_write_lock_count_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_32.test b/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_32.test
new file mode 100644
index 00000000000..de53be3cb7c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/min_examined_row_limit_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_64.test b/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_64.test
new file mode 100644
index 00000000000..449b5d5525e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/min_examined_row_limit_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/multi_range_count_basic_32.test b/mysql-test/suite/sys_vars/t/multi_range_count_basic_32.test
new file mode 100644
index 00000000000..f9db6632d33
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/multi_range_count_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/multi_range_count_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/multi_range_count_basic_64.test b/mysql-test/suite/sys_vars/t/multi_range_count_basic_64.test
new file mode 100644
index 00000000000..12ad7588bbd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/multi_range_count_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/multi_range_count_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_32.test b/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_32.test
new file mode 100644
index 00000000000..6c0ff16bc6f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_64.test b/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_64.test
new file mode 100644
index 00000000000..108cc2e2350
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_32.test b/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_32.test
new file mode 100644
index 00000000000..f395ffe8ee0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/myisam_repair_threads_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_64.test b/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_64.test
new file mode 100644
index 00000000000..21ed5fd9c5f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/myisam_repair_threads_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_32.test
new file mode 100644
index 00000000000..9c4116758f7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_64.test
new file mode 100644
index 00000000000..70f8a33ed4d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/net_retry_count_basic_32.test b/mysql-test/suite/sys_vars/t/net_retry_count_basic_32.test
new file mode 100644
index 00000000000..56f0e56f100
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/net_retry_count_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/net_retry_count_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/net_retry_count_basic_64.test b/mysql-test/suite/sys_vars/t/net_retry_count_basic_64.test
new file mode 100644
index 00000000000..cb1fe8beebb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/net_retry_count_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/net_retry_count_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_32.test
new file mode 100644
index 00000000000..471b48c3059
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/query_alloc_block_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_64.test
new file mode 100644
index 00000000000..64517899171
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/query_alloc_block_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/query_cache_limit_basic_32.test b/mysql-test/suite/sys_vars/t/query_cache_limit_basic_32.test
new file mode 100644
index 00000000000..0416fc46349
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/query_cache_limit_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/query_cache_limit_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/query_cache_limit_basic_64.test b/mysql-test/suite/sys_vars/t/query_cache_limit_basic_64.test
new file mode 100644
index 00000000000..0d134449bf9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/query_cache_limit_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/query_cache_limit_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_32.test b/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_32.test
new file mode 100644
index 00000000000..1288157d102
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/query_cache_min_res_unit_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_64.test b/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_64.test
new file mode 100644
index 00000000000..e941b55ab52
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/query_cache_min_res_unit_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/query_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/query_cache_size_basic_32.test
new file mode 100644
index 00000000000..17fd1bb41ab
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/query_cache_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/query_cache_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/query_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/query_cache_size_basic_64.test
new file mode 100644
index 00000000000..ba0cddc5a3a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/query_cache_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/query_cache_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test
new file mode 100644
index 00000000000..34dafc71c9c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/query_prealloc_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test
new file mode 100644
index 00000000000..c1f04c0788c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/query_prealloc_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_32.test
new file mode 100644
index 00000000000..14cdc82f7c4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/range_alloc_block_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_64.test
new file mode 100644
index 00000000000..a4125b14fd0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/range_alloc_block_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test
new file mode 100644
index 00000000000..c28282dd38b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/rpl_recovery_rank_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test
new file mode 100644
index 00000000000..51895efa65e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/rpl_recovery_rank_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/server_id_basic_32.test b/mysql-test/suite/sys_vars/t/server_id_basic_32.test
new file mode 100644
index 00000000000..e01b271e002
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/server_id_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/server_id_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/server_id_basic_64.test b/mysql-test/suite/sys_vars/t/server_id_basic_64.test
new file mode 100644
index 00000000000..4ef870aa977
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/server_id_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/server_id_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_32.test b/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_32.test
new file mode 100644
index 00000000000..8f3147ddab4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/slave_transaction_retries_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_64.test b/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_64.test
new file mode 100644
index 00000000000..dfd52507f61
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/slave_transaction_retries_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_32.test
new file mode 100644
index 00000000000..d63cc997f5b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/sort_buffer_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_64.test
new file mode 100644
index 00000000000..4c7a16bd014
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/sort_buffer_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test b/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test
new file mode 100644
index 00000000000..275b95cf775
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/sync_binlog_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test b/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test
new file mode 100644
index 00000000000..e6f9bf668a0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/sync_binlog_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic_32.test b/mysql-test/suite/sys_vars/t/timestamp_basic_32.test
new file mode 100644
index 00000000000..a2b6139aef9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/timestamp_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/timestamp_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic_64.test b/mysql-test/suite/sys_vars/t/timestamp_basic_64.test
new file mode 100644
index 00000000000..fbc86316ed9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/timestamp_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/timestamp_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test
new file mode 100644
index 00000000000..c772b5c896c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/tmp_table_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test
new file mode 100644
index 00000000000..46b3f65be9a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/tmp_table_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test
new file mode 100644
index 00000000000..b9fbf429220
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test
new file mode 100644
index 00000000000..fb68245ee62
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/transaction_alloc_block_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test
new file mode 100644
index 00000000000..23ea53334ff
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/transaction_prealloc_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test
new file mode 100644
index 00000000000..79a18585e80
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/transaction_prealloc_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test b/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test
new file mode 100644
index 00000000000..613a5543b14
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 32 bit machines                                                  #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/wait_timeout_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test b/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test
new file mode 100644
index 00000000000..d1138cbc105
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test
@@ -0,0 +1,9 @@
+################################################################################
+# Created by Horst Hunger      2008-05-07                                      #
+#                                                                              #
+# Wrapper for 64 bit machines                                                  #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/wait_timeout_basic.inc
+

From 7750753312d8d94cefeb65c50846822302dca1d1 Mon Sep 17 00:00:00 2001
From: Sven Sandberg <sven@mysql.com>
Date: Wed, 23 Jul 2008 16:34:02 +0200
Subject: [PATCH 11/33] BUG#37733: rpl.rpl_flushlog_loop 'row' fails
 sporadically on pushbuild BUG#37884: rpl_row_basic_2myisam and
 rpl_row_basic_3innodb fail sporadically in pushbuild These have been fixed in
 5.1-rpl. Re-applying fix for BUG#37884 in 5.1-bugteam, and disabling
 rpl_flushlog_loop for BUG#37733 in 5.1-bugteam.

---
 mysql-test/extra/rpl_tests/rpl_row_basic.test | 4 ++++
 mysql-test/suite/rpl/t/disabled.def           | 1 +
 2 files changed, 5 insertions(+)

diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test
index 4be7ad54cb3..f609b644726 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test
@@ -354,6 +354,7 @@ CREATE TABLE t7 (i INT NOT NULL,
 connection master;
 INSERT INTO t1 VALUES (1, "", 1);
 INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
+sync_slave_with_master;
 
 let $diff_table_1=master:test.t1;
 let $diff_table_2=slave:test.t1;
@@ -363,6 +364,7 @@ source include/diff_tables.inc;
 connection master;
 INSERT INTO t2 VALUES (1, "", 1);
 INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
+sync_slave_with_master;
 
 let $diff_table_1=master:test.t2;
 let $diff_table_2=slave:test.t2;
@@ -387,6 +389,7 @@ source include/wait_for_slave_to_start.inc;
 connection master;
 INSERT INTO t4 VALUES (1, "", 1);
 INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
+sync_slave_with_master;
 
 let $diff_table_1=master:test.t4;
 let $diff_table_2=slave:test.t4;
@@ -426,6 +429,7 @@ source include/wait_for_slave_to_start.inc;
 connection master;
 INSERT INTO t7 VALUES (1, "", 1);
 INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
+sync_slave_with_master;
 
 let $diff_table_1=master:test.t7;
 let $diff_table_2=slave:test.t7;
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index 43a379dbe03..a8c83d58884 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -13,3 +13,4 @@
 rpl_redirect               : Failure is sporadic and and the test is superfluous (mats)
 rpl_innodb_bug28430        : Failure on Solaris Bug #36793
 rpl_temporary              : BUG#38269 2008-07-21 Sven valgrind error in pushbuild
+rpl_flushlog_loop          : BUG#37733 2008-07-23 Sven disabled in 5.1-bugteam. the bug has been fixed in 5.1-rpl: please re-enable when that gets pushed to main

From 8ce74569f723f27269a3ea44785c2b7d7b76f485 Mon Sep 17 00:00:00 2001
From: Davi Arnaut <Davi.Arnaut@Sun.COM>
Date: Thu, 24 Jul 2008 11:14:34 -0300
Subject: [PATCH 12/33] Cherry-pick Bug#33362 from mysql-5.1

---
 mysql-test/r/query_cache_merge.result | 1672 +++++++++++++++++++++++++
 mysql-test/t/query_cache_merge.test   |   56 +
 sql/sql_cache.cc                      |    2 +-
 3 files changed, 1729 insertions(+), 1 deletion(-)

diff --git a/mysql-test/r/query_cache_merge.result b/mysql-test/r/query_cache_merge.result
index c6df4266de2..f47d3b35119 100644
--- a/mysql-test/r/query_cache_merge.result
+++ b/mysql-test/r/query_cache_merge.result
@@ -18,3 +18,1675 @@ Variable_name	Value
 Qcache_queries_in_cache	0
 drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257,t00;
 SET @@global.query_cache_size=0;
+CREATE TABLE t255 (a INT);
+INSERT INTO t255 VALUES (255);
+CREATE TABLE t254 (a INT);
+INSERT INTO t254 VALUES (254);
+CREATE TABLE t253 (a INT);
+INSERT INTO t253 VALUES (253);
+CREATE TABLE t252 (a INT);
+INSERT INTO t252 VALUES (252);
+CREATE TABLE t251 (a INT);
+INSERT INTO t251 VALUES (251);
+CREATE TABLE t250 (a INT);
+INSERT INTO t250 VALUES (250);
+CREATE TABLE t249 (a INT);
+INSERT INTO t249 VALUES (249);
+CREATE TABLE t248 (a INT);
+INSERT INTO t248 VALUES (248);
+CREATE TABLE t247 (a INT);
+INSERT INTO t247 VALUES (247);
+CREATE TABLE t246 (a INT);
+INSERT INTO t246 VALUES (246);
+CREATE TABLE t245 (a INT);
+INSERT INTO t245 VALUES (245);
+CREATE TABLE t244 (a INT);
+INSERT INTO t244 VALUES (244);
+CREATE TABLE t243 (a INT);
+INSERT INTO t243 VALUES (243);
+CREATE TABLE t242 (a INT);
+INSERT INTO t242 VALUES (242);
+CREATE TABLE t241 (a INT);
+INSERT INTO t241 VALUES (241);
+CREATE TABLE t240 (a INT);
+INSERT INTO t240 VALUES (240);
+CREATE TABLE t239 (a INT);
+INSERT INTO t239 VALUES (239);
+CREATE TABLE t238 (a INT);
+INSERT INTO t238 VALUES (238);
+CREATE TABLE t237 (a INT);
+INSERT INTO t237 VALUES (237);
+CREATE TABLE t236 (a INT);
+INSERT INTO t236 VALUES (236);
+CREATE TABLE t235 (a INT);
+INSERT INTO t235 VALUES (235);
+CREATE TABLE t234 (a INT);
+INSERT INTO t234 VALUES (234);
+CREATE TABLE t233 (a INT);
+INSERT INTO t233 VALUES (233);
+CREATE TABLE t232 (a INT);
+INSERT INTO t232 VALUES (232);
+CREATE TABLE t231 (a INT);
+INSERT INTO t231 VALUES (231);
+CREATE TABLE t230 (a INT);
+INSERT INTO t230 VALUES (230);
+CREATE TABLE t229 (a INT);
+INSERT INTO t229 VALUES (229);
+CREATE TABLE t228 (a INT);
+INSERT INTO t228 VALUES (228);
+CREATE TABLE t227 (a INT);
+INSERT INTO t227 VALUES (227);
+CREATE TABLE t226 (a INT);
+INSERT INTO t226 VALUES (226);
+CREATE TABLE t225 (a INT);
+INSERT INTO t225 VALUES (225);
+CREATE TABLE t224 (a INT);
+INSERT INTO t224 VALUES (224);
+CREATE TABLE t223 (a INT);
+INSERT INTO t223 VALUES (223);
+CREATE TABLE t222 (a INT);
+INSERT INTO t222 VALUES (222);
+CREATE TABLE t221 (a INT);
+INSERT INTO t221 VALUES (221);
+CREATE TABLE t220 (a INT);
+INSERT INTO t220 VALUES (220);
+CREATE TABLE t219 (a INT);
+INSERT INTO t219 VALUES (219);
+CREATE TABLE t218 (a INT);
+INSERT INTO t218 VALUES (218);
+CREATE TABLE t217 (a INT);
+INSERT INTO t217 VALUES (217);
+CREATE TABLE t216 (a INT);
+INSERT INTO t216 VALUES (216);
+CREATE TABLE t215 (a INT);
+INSERT INTO t215 VALUES (215);
+CREATE TABLE t214 (a INT);
+INSERT INTO t214 VALUES (214);
+CREATE TABLE t213 (a INT);
+INSERT INTO t213 VALUES (213);
+CREATE TABLE t212 (a INT);
+INSERT INTO t212 VALUES (212);
+CREATE TABLE t211 (a INT);
+INSERT INTO t211 VALUES (211);
+CREATE TABLE t210 (a INT);
+INSERT INTO t210 VALUES (210);
+CREATE TABLE t209 (a INT);
+INSERT INTO t209 VALUES (209);
+CREATE TABLE t208 (a INT);
+INSERT INTO t208 VALUES (208);
+CREATE TABLE t207 (a INT);
+INSERT INTO t207 VALUES (207);
+CREATE TABLE t206 (a INT);
+INSERT INTO t206 VALUES (206);
+CREATE TABLE t205 (a INT);
+INSERT INTO t205 VALUES (205);
+CREATE TABLE t204 (a INT);
+INSERT INTO t204 VALUES (204);
+CREATE TABLE t203 (a INT);
+INSERT INTO t203 VALUES (203);
+CREATE TABLE t202 (a INT);
+INSERT INTO t202 VALUES (202);
+CREATE TABLE t201 (a INT);
+INSERT INTO t201 VALUES (201);
+CREATE TABLE t200 (a INT);
+INSERT INTO t200 VALUES (200);
+CREATE TABLE t199 (a INT);
+INSERT INTO t199 VALUES (199);
+CREATE TABLE t198 (a INT);
+INSERT INTO t198 VALUES (198);
+CREATE TABLE t197 (a INT);
+INSERT INTO t197 VALUES (197);
+CREATE TABLE t196 (a INT);
+INSERT INTO t196 VALUES (196);
+CREATE TABLE t195 (a INT);
+INSERT INTO t195 VALUES (195);
+CREATE TABLE t194 (a INT);
+INSERT INTO t194 VALUES (194);
+CREATE TABLE t193 (a INT);
+INSERT INTO t193 VALUES (193);
+CREATE TABLE t192 (a INT);
+INSERT INTO t192 VALUES (192);
+CREATE TABLE t191 (a INT);
+INSERT INTO t191 VALUES (191);
+CREATE TABLE t190 (a INT);
+INSERT INTO t190 VALUES (190);
+CREATE TABLE t189 (a INT);
+INSERT INTO t189 VALUES (189);
+CREATE TABLE t188 (a INT);
+INSERT INTO t188 VALUES (188);
+CREATE TABLE t187 (a INT);
+INSERT INTO t187 VALUES (187);
+CREATE TABLE t186 (a INT);
+INSERT INTO t186 VALUES (186);
+CREATE TABLE t185 (a INT);
+INSERT INTO t185 VALUES (185);
+CREATE TABLE t184 (a INT);
+INSERT INTO t184 VALUES (184);
+CREATE TABLE t183 (a INT);
+INSERT INTO t183 VALUES (183);
+CREATE TABLE t182 (a INT);
+INSERT INTO t182 VALUES (182);
+CREATE TABLE t181 (a INT);
+INSERT INTO t181 VALUES (181);
+CREATE TABLE t180 (a INT);
+INSERT INTO t180 VALUES (180);
+CREATE TABLE t179 (a INT);
+INSERT INTO t179 VALUES (179);
+CREATE TABLE t178 (a INT);
+INSERT INTO t178 VALUES (178);
+CREATE TABLE t177 (a INT);
+INSERT INTO t177 VALUES (177);
+CREATE TABLE t176 (a INT);
+INSERT INTO t176 VALUES (176);
+CREATE TABLE t175 (a INT);
+INSERT INTO t175 VALUES (175);
+CREATE TABLE t174 (a INT);
+INSERT INTO t174 VALUES (174);
+CREATE TABLE t173 (a INT);
+INSERT INTO t173 VALUES (173);
+CREATE TABLE t172 (a INT);
+INSERT INTO t172 VALUES (172);
+CREATE TABLE t171 (a INT);
+INSERT INTO t171 VALUES (171);
+CREATE TABLE t170 (a INT);
+INSERT INTO t170 VALUES (170);
+CREATE TABLE t169 (a INT);
+INSERT INTO t169 VALUES (169);
+CREATE TABLE t168 (a INT);
+INSERT INTO t168 VALUES (168);
+CREATE TABLE t167 (a INT);
+INSERT INTO t167 VALUES (167);
+CREATE TABLE t166 (a INT);
+INSERT INTO t166 VALUES (166);
+CREATE TABLE t165 (a INT);
+INSERT INTO t165 VALUES (165);
+CREATE TABLE t164 (a INT);
+INSERT INTO t164 VALUES (164);
+CREATE TABLE t163 (a INT);
+INSERT INTO t163 VALUES (163);
+CREATE TABLE t162 (a INT);
+INSERT INTO t162 VALUES (162);
+CREATE TABLE t161 (a INT);
+INSERT INTO t161 VALUES (161);
+CREATE TABLE t160 (a INT);
+INSERT INTO t160 VALUES (160);
+CREATE TABLE t159 (a INT);
+INSERT INTO t159 VALUES (159);
+CREATE TABLE t158 (a INT);
+INSERT INTO t158 VALUES (158);
+CREATE TABLE t157 (a INT);
+INSERT INTO t157 VALUES (157);
+CREATE TABLE t156 (a INT);
+INSERT INTO t156 VALUES (156);
+CREATE TABLE t155 (a INT);
+INSERT INTO t155 VALUES (155);
+CREATE TABLE t154 (a INT);
+INSERT INTO t154 VALUES (154);
+CREATE TABLE t153 (a INT);
+INSERT INTO t153 VALUES (153);
+CREATE TABLE t152 (a INT);
+INSERT INTO t152 VALUES (152);
+CREATE TABLE t151 (a INT);
+INSERT INTO t151 VALUES (151);
+CREATE TABLE t150 (a INT);
+INSERT INTO t150 VALUES (150);
+CREATE TABLE t149 (a INT);
+INSERT INTO t149 VALUES (149);
+CREATE TABLE t148 (a INT);
+INSERT INTO t148 VALUES (148);
+CREATE TABLE t147 (a INT);
+INSERT INTO t147 VALUES (147);
+CREATE TABLE t146 (a INT);
+INSERT INTO t146 VALUES (146);
+CREATE TABLE t145 (a INT);
+INSERT INTO t145 VALUES (145);
+CREATE TABLE t144 (a INT);
+INSERT INTO t144 VALUES (144);
+CREATE TABLE t143 (a INT);
+INSERT INTO t143 VALUES (143);
+CREATE TABLE t142 (a INT);
+INSERT INTO t142 VALUES (142);
+CREATE TABLE t141 (a INT);
+INSERT INTO t141 VALUES (141);
+CREATE TABLE t140 (a INT);
+INSERT INTO t140 VALUES (140);
+CREATE TABLE t139 (a INT);
+INSERT INTO t139 VALUES (139);
+CREATE TABLE t138 (a INT);
+INSERT INTO t138 VALUES (138);
+CREATE TABLE t137 (a INT);
+INSERT INTO t137 VALUES (137);
+CREATE TABLE t136 (a INT);
+INSERT INTO t136 VALUES (136);
+CREATE TABLE t135 (a INT);
+INSERT INTO t135 VALUES (135);
+CREATE TABLE t134 (a INT);
+INSERT INTO t134 VALUES (134);
+CREATE TABLE t133 (a INT);
+INSERT INTO t133 VALUES (133);
+CREATE TABLE t132 (a INT);
+INSERT INTO t132 VALUES (132);
+CREATE TABLE t131 (a INT);
+INSERT INTO t131 VALUES (131);
+CREATE TABLE t130 (a INT);
+INSERT INTO t130 VALUES (130);
+CREATE TABLE t129 (a INT);
+INSERT INTO t129 VALUES (129);
+CREATE TABLE t128 (a INT);
+INSERT INTO t128 VALUES (128);
+CREATE TABLE t127 (a INT);
+INSERT INTO t127 VALUES (127);
+CREATE TABLE t126 (a INT);
+INSERT INTO t126 VALUES (126);
+CREATE TABLE t125 (a INT);
+INSERT INTO t125 VALUES (125);
+CREATE TABLE t124 (a INT);
+INSERT INTO t124 VALUES (124);
+CREATE TABLE t123 (a INT);
+INSERT INTO t123 VALUES (123);
+CREATE TABLE t122 (a INT);
+INSERT INTO t122 VALUES (122);
+CREATE TABLE t121 (a INT);
+INSERT INTO t121 VALUES (121);
+CREATE TABLE t120 (a INT);
+INSERT INTO t120 VALUES (120);
+CREATE TABLE t119 (a INT);
+INSERT INTO t119 VALUES (119);
+CREATE TABLE t118 (a INT);
+INSERT INTO t118 VALUES (118);
+CREATE TABLE t117 (a INT);
+INSERT INTO t117 VALUES (117);
+CREATE TABLE t116 (a INT);
+INSERT INTO t116 VALUES (116);
+CREATE TABLE t115 (a INT);
+INSERT INTO t115 VALUES (115);
+CREATE TABLE t114 (a INT);
+INSERT INTO t114 VALUES (114);
+CREATE TABLE t113 (a INT);
+INSERT INTO t113 VALUES (113);
+CREATE TABLE t112 (a INT);
+INSERT INTO t112 VALUES (112);
+CREATE TABLE t111 (a INT);
+INSERT INTO t111 VALUES (111);
+CREATE TABLE t110 (a INT);
+INSERT INTO t110 VALUES (110);
+CREATE TABLE t109 (a INT);
+INSERT INTO t109 VALUES (109);
+CREATE TABLE t108 (a INT);
+INSERT INTO t108 VALUES (108);
+CREATE TABLE t107 (a INT);
+INSERT INTO t107 VALUES (107);
+CREATE TABLE t106 (a INT);
+INSERT INTO t106 VALUES (106);
+CREATE TABLE t105 (a INT);
+INSERT INTO t105 VALUES (105);
+CREATE TABLE t104 (a INT);
+INSERT INTO t104 VALUES (104);
+CREATE TABLE t103 (a INT);
+INSERT INTO t103 VALUES (103);
+CREATE TABLE t102 (a INT);
+INSERT INTO t102 VALUES (102);
+CREATE TABLE t101 (a INT);
+INSERT INTO t101 VALUES (101);
+CREATE TABLE t100 (a INT);
+INSERT INTO t100 VALUES (100);
+CREATE TABLE t99 (a INT);
+INSERT INTO t99 VALUES (99);
+CREATE TABLE t98 (a INT);
+INSERT INTO t98 VALUES (98);
+CREATE TABLE t97 (a INT);
+INSERT INTO t97 VALUES (97);
+CREATE TABLE t96 (a INT);
+INSERT INTO t96 VALUES (96);
+CREATE TABLE t95 (a INT);
+INSERT INTO t95 VALUES (95);
+CREATE TABLE t94 (a INT);
+INSERT INTO t94 VALUES (94);
+CREATE TABLE t93 (a INT);
+INSERT INTO t93 VALUES (93);
+CREATE TABLE t92 (a INT);
+INSERT INTO t92 VALUES (92);
+CREATE TABLE t91 (a INT);
+INSERT INTO t91 VALUES (91);
+CREATE TABLE t90 (a INT);
+INSERT INTO t90 VALUES (90);
+CREATE TABLE t89 (a INT);
+INSERT INTO t89 VALUES (89);
+CREATE TABLE t88 (a INT);
+INSERT INTO t88 VALUES (88);
+CREATE TABLE t87 (a INT);
+INSERT INTO t87 VALUES (87);
+CREATE TABLE t86 (a INT);
+INSERT INTO t86 VALUES (86);
+CREATE TABLE t85 (a INT);
+INSERT INTO t85 VALUES (85);
+CREATE TABLE t84 (a INT);
+INSERT INTO t84 VALUES (84);
+CREATE TABLE t83 (a INT);
+INSERT INTO t83 VALUES (83);
+CREATE TABLE t82 (a INT);
+INSERT INTO t82 VALUES (82);
+CREATE TABLE t81 (a INT);
+INSERT INTO t81 VALUES (81);
+CREATE TABLE t80 (a INT);
+INSERT INTO t80 VALUES (80);
+CREATE TABLE t79 (a INT);
+INSERT INTO t79 VALUES (79);
+CREATE TABLE t78 (a INT);
+INSERT INTO t78 VALUES (78);
+CREATE TABLE t77 (a INT);
+INSERT INTO t77 VALUES (77);
+CREATE TABLE t76 (a INT);
+INSERT INTO t76 VALUES (76);
+CREATE TABLE t75 (a INT);
+INSERT INTO t75 VALUES (75);
+CREATE TABLE t74 (a INT);
+INSERT INTO t74 VALUES (74);
+CREATE TABLE t73 (a INT);
+INSERT INTO t73 VALUES (73);
+CREATE TABLE t72 (a INT);
+INSERT INTO t72 VALUES (72);
+CREATE TABLE t71 (a INT);
+INSERT INTO t71 VALUES (71);
+CREATE TABLE t70 (a INT);
+INSERT INTO t70 VALUES (70);
+CREATE TABLE t69 (a INT);
+INSERT INTO t69 VALUES (69);
+CREATE TABLE t68 (a INT);
+INSERT INTO t68 VALUES (68);
+CREATE TABLE t67 (a INT);
+INSERT INTO t67 VALUES (67);
+CREATE TABLE t66 (a INT);
+INSERT INTO t66 VALUES (66);
+CREATE TABLE t65 (a INT);
+INSERT INTO t65 VALUES (65);
+CREATE TABLE t64 (a INT);
+INSERT INTO t64 VALUES (64);
+CREATE TABLE t63 (a INT);
+INSERT INTO t63 VALUES (63);
+CREATE TABLE t62 (a INT);
+INSERT INTO t62 VALUES (62);
+CREATE TABLE t61 (a INT);
+INSERT INTO t61 VALUES (61);
+CREATE TABLE t60 (a INT);
+INSERT INTO t60 VALUES (60);
+CREATE TABLE t59 (a INT);
+INSERT INTO t59 VALUES (59);
+CREATE TABLE t58 (a INT);
+INSERT INTO t58 VALUES (58);
+CREATE TABLE t57 (a INT);
+INSERT INTO t57 VALUES (57);
+CREATE TABLE t56 (a INT);
+INSERT INTO t56 VALUES (56);
+CREATE TABLE t55 (a INT);
+INSERT INTO t55 VALUES (55);
+CREATE TABLE t54 (a INT);
+INSERT INTO t54 VALUES (54);
+CREATE TABLE t53 (a INT);
+INSERT INTO t53 VALUES (53);
+CREATE TABLE t52 (a INT);
+INSERT INTO t52 VALUES (52);
+CREATE TABLE t51 (a INT);
+INSERT INTO t51 VALUES (51);
+CREATE TABLE t50 (a INT);
+INSERT INTO t50 VALUES (50);
+CREATE TABLE t49 (a INT);
+INSERT INTO t49 VALUES (49);
+CREATE TABLE t48 (a INT);
+INSERT INTO t48 VALUES (48);
+CREATE TABLE t47 (a INT);
+INSERT INTO t47 VALUES (47);
+CREATE TABLE t46 (a INT);
+INSERT INTO t46 VALUES (46);
+CREATE TABLE t45 (a INT);
+INSERT INTO t45 VALUES (45);
+CREATE TABLE t44 (a INT);
+INSERT INTO t44 VALUES (44);
+CREATE TABLE t43 (a INT);
+INSERT INTO t43 VALUES (43);
+CREATE TABLE t42 (a INT);
+INSERT INTO t42 VALUES (42);
+CREATE TABLE t41 (a INT);
+INSERT INTO t41 VALUES (41);
+CREATE TABLE t40 (a INT);
+INSERT INTO t40 VALUES (40);
+CREATE TABLE t39 (a INT);
+INSERT INTO t39 VALUES (39);
+CREATE TABLE t38 (a INT);
+INSERT INTO t38 VALUES (38);
+CREATE TABLE t37 (a INT);
+INSERT INTO t37 VALUES (37);
+CREATE TABLE t36 (a INT);
+INSERT INTO t36 VALUES (36);
+CREATE TABLE t35 (a INT);
+INSERT INTO t35 VALUES (35);
+CREATE TABLE t34 (a INT);
+INSERT INTO t34 VALUES (34);
+CREATE TABLE t33 (a INT);
+INSERT INTO t33 VALUES (33);
+CREATE TABLE t32 (a INT);
+INSERT INTO t32 VALUES (32);
+CREATE TABLE t31 (a INT);
+INSERT INTO t31 VALUES (31);
+CREATE TABLE t30 (a INT);
+INSERT INTO t30 VALUES (30);
+CREATE TABLE t29 (a INT);
+INSERT INTO t29 VALUES (29);
+CREATE TABLE t28 (a INT);
+INSERT INTO t28 VALUES (28);
+CREATE TABLE t27 (a INT);
+INSERT INTO t27 VALUES (27);
+CREATE TABLE t26 (a INT);
+INSERT INTO t26 VALUES (26);
+CREATE TABLE t25 (a INT);
+INSERT INTO t25 VALUES (25);
+CREATE TABLE t24 (a INT);
+INSERT INTO t24 VALUES (24);
+CREATE TABLE t23 (a INT);
+INSERT INTO t23 VALUES (23);
+CREATE TABLE t22 (a INT);
+INSERT INTO t22 VALUES (22);
+CREATE TABLE t21 (a INT);
+INSERT INTO t21 VALUES (21);
+CREATE TABLE t20 (a INT);
+INSERT INTO t20 VALUES (20);
+CREATE TABLE t19 (a INT);
+INSERT INTO t19 VALUES (19);
+CREATE TABLE t18 (a INT);
+INSERT INTO t18 VALUES (18);
+CREATE TABLE t17 (a INT);
+INSERT INTO t17 VALUES (17);
+CREATE TABLE t16 (a INT);
+INSERT INTO t16 VALUES (16);
+CREATE TABLE t15 (a INT);
+INSERT INTO t15 VALUES (15);
+CREATE TABLE t14 (a INT);
+INSERT INTO t14 VALUES (14);
+CREATE TABLE t13 (a INT);
+INSERT INTO t13 VALUES (13);
+CREATE TABLE t12 (a INT);
+INSERT INTO t12 VALUES (12);
+CREATE TABLE t11 (a INT);
+INSERT INTO t11 VALUES (11);
+CREATE TABLE t10 (a INT);
+INSERT INTO t10 VALUES (10);
+CREATE TABLE t9 (a INT);
+INSERT INTO t9 VALUES (9);
+CREATE TABLE t8 (a INT);
+INSERT INTO t8 VALUES (8);
+CREATE TABLE t7 (a INT);
+INSERT INTO t7 VALUES (7);
+CREATE TABLE t6 (a INT);
+INSERT INTO t6 VALUES (6);
+CREATE TABLE t5 (a INT);
+INSERT INTO t5 VALUES (5);
+CREATE TABLE t4 (a INT);
+INSERT INTO t4 VALUES (4);
+CREATE TABLE t3 (a INT);
+INSERT INTO t3 VALUES (3);
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (2);
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t0 (a INT) ENGINE=MERGE UNION(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255);
+SET GLOBAL query_cache_size = 1048576;
+FLUSH STATUS;
+SELECT a FROM t0 WHERE a = 1;
+a
+1
+SHOW STATUS LIKE "Qcache_queries_in_cache";
+Variable_name	Value
+Qcache_queries_in_cache	1
+FLUSH TABLES;
+TRUNCATE TABLE t255;
+SELECT a FROM t1;
+a
+1
+TRUNCATE TABLE t254;
+SELECT a FROM t2;
+a
+2
+TRUNCATE TABLE t253;
+SELECT a FROM t3;
+a
+3
+TRUNCATE TABLE t252;
+SELECT a FROM t4;
+a
+4
+TRUNCATE TABLE t251;
+SELECT a FROM t5;
+a
+5
+TRUNCATE TABLE t250;
+SELECT a FROM t6;
+a
+6
+TRUNCATE TABLE t249;
+SELECT a FROM t7;
+a
+7
+TRUNCATE TABLE t248;
+SELECT a FROM t8;
+a
+8
+TRUNCATE TABLE t247;
+SELECT a FROM t9;
+a
+9
+TRUNCATE TABLE t246;
+SELECT a FROM t10;
+a
+10
+TRUNCATE TABLE t245;
+SELECT a FROM t11;
+a
+11
+TRUNCATE TABLE t244;
+SELECT a FROM t12;
+a
+12
+TRUNCATE TABLE t243;
+SELECT a FROM t13;
+a
+13
+TRUNCATE TABLE t242;
+SELECT a FROM t14;
+a
+14
+TRUNCATE TABLE t241;
+SELECT a FROM t15;
+a
+15
+TRUNCATE TABLE t240;
+SELECT a FROM t16;
+a
+16
+TRUNCATE TABLE t239;
+SELECT a FROM t17;
+a
+17
+TRUNCATE TABLE t238;
+SELECT a FROM t18;
+a
+18
+TRUNCATE TABLE t237;
+SELECT a FROM t19;
+a
+19
+TRUNCATE TABLE t236;
+SELECT a FROM t20;
+a
+20
+TRUNCATE TABLE t235;
+SELECT a FROM t21;
+a
+21
+TRUNCATE TABLE t234;
+SELECT a FROM t22;
+a
+22
+TRUNCATE TABLE t233;
+SELECT a FROM t23;
+a
+23
+TRUNCATE TABLE t232;
+SELECT a FROM t24;
+a
+24
+TRUNCATE TABLE t231;
+SELECT a FROM t25;
+a
+25
+TRUNCATE TABLE t230;
+SELECT a FROM t26;
+a
+26
+TRUNCATE TABLE t229;
+SELECT a FROM t27;
+a
+27
+TRUNCATE TABLE t228;
+SELECT a FROM t28;
+a
+28
+TRUNCATE TABLE t227;
+SELECT a FROM t29;
+a
+29
+TRUNCATE TABLE t226;
+SELECT a FROM t30;
+a
+30
+TRUNCATE TABLE t225;
+SELECT a FROM t31;
+a
+31
+TRUNCATE TABLE t224;
+SELECT a FROM t32;
+a
+32
+TRUNCATE TABLE t223;
+SELECT a FROM t33;
+a
+33
+TRUNCATE TABLE t222;
+SELECT a FROM t34;
+a
+34
+TRUNCATE TABLE t221;
+SELECT a FROM t35;
+a
+35
+TRUNCATE TABLE t220;
+SELECT a FROM t36;
+a
+36
+TRUNCATE TABLE t219;
+SELECT a FROM t37;
+a
+37
+TRUNCATE TABLE t218;
+SELECT a FROM t38;
+a
+38
+TRUNCATE TABLE t217;
+SELECT a FROM t39;
+a
+39
+TRUNCATE TABLE t216;
+SELECT a FROM t40;
+a
+40
+TRUNCATE TABLE t215;
+SELECT a FROM t41;
+a
+41
+TRUNCATE TABLE t214;
+SELECT a FROM t42;
+a
+42
+TRUNCATE TABLE t213;
+SELECT a FROM t43;
+a
+43
+TRUNCATE TABLE t212;
+SELECT a FROM t44;
+a
+44
+TRUNCATE TABLE t211;
+SELECT a FROM t45;
+a
+45
+TRUNCATE TABLE t210;
+SELECT a FROM t46;
+a
+46
+TRUNCATE TABLE t209;
+SELECT a FROM t47;
+a
+47
+TRUNCATE TABLE t208;
+SELECT a FROM t48;
+a
+48
+TRUNCATE TABLE t207;
+SELECT a FROM t49;
+a
+49
+TRUNCATE TABLE t206;
+SELECT a FROM t50;
+a
+50
+TRUNCATE TABLE t205;
+SELECT a FROM t51;
+a
+51
+TRUNCATE TABLE t204;
+SELECT a FROM t52;
+a
+52
+TRUNCATE TABLE t203;
+SELECT a FROM t53;
+a
+53
+TRUNCATE TABLE t202;
+SELECT a FROM t54;
+a
+54
+TRUNCATE TABLE t201;
+SELECT a FROM t55;
+a
+55
+TRUNCATE TABLE t200;
+SELECT a FROM t56;
+a
+56
+TRUNCATE TABLE t199;
+SELECT a FROM t57;
+a
+57
+TRUNCATE TABLE t198;
+SELECT a FROM t58;
+a
+58
+TRUNCATE TABLE t197;
+SELECT a FROM t59;
+a
+59
+TRUNCATE TABLE t196;
+SELECT a FROM t60;
+a
+60
+TRUNCATE TABLE t195;
+SELECT a FROM t61;
+a
+61
+TRUNCATE TABLE t194;
+SELECT a FROM t62;
+a
+62
+TRUNCATE TABLE t193;
+SELECT a FROM t63;
+a
+63
+TRUNCATE TABLE t192;
+SELECT a FROM t64;
+a
+64
+TRUNCATE TABLE t191;
+SELECT a FROM t65;
+a
+65
+TRUNCATE TABLE t190;
+SELECT a FROM t66;
+a
+66
+TRUNCATE TABLE t189;
+SELECT a FROM t67;
+a
+67
+TRUNCATE TABLE t188;
+SELECT a FROM t68;
+a
+68
+TRUNCATE TABLE t187;
+SELECT a FROM t69;
+a
+69
+TRUNCATE TABLE t186;
+SELECT a FROM t70;
+a
+70
+TRUNCATE TABLE t185;
+SELECT a FROM t71;
+a
+71
+TRUNCATE TABLE t184;
+SELECT a FROM t72;
+a
+72
+TRUNCATE TABLE t183;
+SELECT a FROM t73;
+a
+73
+TRUNCATE TABLE t182;
+SELECT a FROM t74;
+a
+74
+TRUNCATE TABLE t181;
+SELECT a FROM t75;
+a
+75
+TRUNCATE TABLE t180;
+SELECT a FROM t76;
+a
+76
+TRUNCATE TABLE t179;
+SELECT a FROM t77;
+a
+77
+TRUNCATE TABLE t178;
+SELECT a FROM t78;
+a
+78
+TRUNCATE TABLE t177;
+SELECT a FROM t79;
+a
+79
+TRUNCATE TABLE t176;
+SELECT a FROM t80;
+a
+80
+TRUNCATE TABLE t175;
+SELECT a FROM t81;
+a
+81
+TRUNCATE TABLE t174;
+SELECT a FROM t82;
+a
+82
+TRUNCATE TABLE t173;
+SELECT a FROM t83;
+a
+83
+TRUNCATE TABLE t172;
+SELECT a FROM t84;
+a
+84
+TRUNCATE TABLE t171;
+SELECT a FROM t85;
+a
+85
+TRUNCATE TABLE t170;
+SELECT a FROM t86;
+a
+86
+TRUNCATE TABLE t169;
+SELECT a FROM t87;
+a
+87
+TRUNCATE TABLE t168;
+SELECT a FROM t88;
+a
+88
+TRUNCATE TABLE t167;
+SELECT a FROM t89;
+a
+89
+TRUNCATE TABLE t166;
+SELECT a FROM t90;
+a
+90
+TRUNCATE TABLE t165;
+SELECT a FROM t91;
+a
+91
+TRUNCATE TABLE t164;
+SELECT a FROM t92;
+a
+92
+TRUNCATE TABLE t163;
+SELECT a FROM t93;
+a
+93
+TRUNCATE TABLE t162;
+SELECT a FROM t94;
+a
+94
+TRUNCATE TABLE t161;
+SELECT a FROM t95;
+a
+95
+TRUNCATE TABLE t160;
+SELECT a FROM t96;
+a
+96
+TRUNCATE TABLE t159;
+SELECT a FROM t97;
+a
+97
+TRUNCATE TABLE t158;
+SELECT a FROM t98;
+a
+98
+TRUNCATE TABLE t157;
+SELECT a FROM t99;
+a
+99
+TRUNCATE TABLE t156;
+SELECT a FROM t100;
+a
+100
+TRUNCATE TABLE t155;
+SELECT a FROM t101;
+a
+101
+TRUNCATE TABLE t154;
+SELECT a FROM t102;
+a
+102
+TRUNCATE TABLE t153;
+SELECT a FROM t103;
+a
+103
+TRUNCATE TABLE t152;
+SELECT a FROM t104;
+a
+104
+TRUNCATE TABLE t151;
+SELECT a FROM t105;
+a
+105
+TRUNCATE TABLE t150;
+SELECT a FROM t106;
+a
+106
+TRUNCATE TABLE t149;
+SELECT a FROM t107;
+a
+107
+TRUNCATE TABLE t148;
+SELECT a FROM t108;
+a
+108
+TRUNCATE TABLE t147;
+SELECT a FROM t109;
+a
+109
+TRUNCATE TABLE t146;
+SELECT a FROM t110;
+a
+110
+TRUNCATE TABLE t145;
+SELECT a FROM t111;
+a
+111
+TRUNCATE TABLE t144;
+SELECT a FROM t112;
+a
+112
+TRUNCATE TABLE t143;
+SELECT a FROM t113;
+a
+113
+TRUNCATE TABLE t142;
+SELECT a FROM t114;
+a
+114
+TRUNCATE TABLE t141;
+SELECT a FROM t115;
+a
+115
+TRUNCATE TABLE t140;
+SELECT a FROM t116;
+a
+116
+TRUNCATE TABLE t139;
+SELECT a FROM t117;
+a
+117
+TRUNCATE TABLE t138;
+SELECT a FROM t118;
+a
+118
+TRUNCATE TABLE t137;
+SELECT a FROM t119;
+a
+119
+TRUNCATE TABLE t136;
+SELECT a FROM t120;
+a
+120
+TRUNCATE TABLE t135;
+SELECT a FROM t121;
+a
+121
+TRUNCATE TABLE t134;
+SELECT a FROM t122;
+a
+122
+TRUNCATE TABLE t133;
+SELECT a FROM t123;
+a
+123
+TRUNCATE TABLE t132;
+SELECT a FROM t124;
+a
+124
+TRUNCATE TABLE t131;
+SELECT a FROM t125;
+a
+125
+TRUNCATE TABLE t130;
+SELECT a FROM t126;
+a
+126
+TRUNCATE TABLE t129;
+SELECT a FROM t127;
+a
+127
+TRUNCATE TABLE t128;
+SELECT a FROM t128;
+a
+TRUNCATE TABLE t127;
+SELECT a FROM t129;
+a
+TRUNCATE TABLE t126;
+SELECT a FROM t130;
+a
+TRUNCATE TABLE t125;
+SELECT a FROM t131;
+a
+TRUNCATE TABLE t124;
+SELECT a FROM t132;
+a
+TRUNCATE TABLE t123;
+SELECT a FROM t133;
+a
+TRUNCATE TABLE t122;
+SELECT a FROM t134;
+a
+TRUNCATE TABLE t121;
+SELECT a FROM t135;
+a
+TRUNCATE TABLE t120;
+SELECT a FROM t136;
+a
+TRUNCATE TABLE t119;
+SELECT a FROM t137;
+a
+TRUNCATE TABLE t118;
+SELECT a FROM t138;
+a
+TRUNCATE TABLE t117;
+SELECT a FROM t139;
+a
+TRUNCATE TABLE t116;
+SELECT a FROM t140;
+a
+TRUNCATE TABLE t115;
+SELECT a FROM t141;
+a
+TRUNCATE TABLE t114;
+SELECT a FROM t142;
+a
+TRUNCATE TABLE t113;
+SELECT a FROM t143;
+a
+TRUNCATE TABLE t112;
+SELECT a FROM t144;
+a
+TRUNCATE TABLE t111;
+SELECT a FROM t145;
+a
+TRUNCATE TABLE t110;
+SELECT a FROM t146;
+a
+TRUNCATE TABLE t109;
+SELECT a FROM t147;
+a
+TRUNCATE TABLE t108;
+SELECT a FROM t148;
+a
+TRUNCATE TABLE t107;
+SELECT a FROM t149;
+a
+TRUNCATE TABLE t106;
+SELECT a FROM t150;
+a
+TRUNCATE TABLE t105;
+SELECT a FROM t151;
+a
+TRUNCATE TABLE t104;
+SELECT a FROM t152;
+a
+TRUNCATE TABLE t103;
+SELECT a FROM t153;
+a
+TRUNCATE TABLE t102;
+SELECT a FROM t154;
+a
+TRUNCATE TABLE t101;
+SELECT a FROM t155;
+a
+TRUNCATE TABLE t100;
+SELECT a FROM t156;
+a
+TRUNCATE TABLE t99;
+SELECT a FROM t157;
+a
+TRUNCATE TABLE t98;
+SELECT a FROM t158;
+a
+TRUNCATE TABLE t97;
+SELECT a FROM t159;
+a
+TRUNCATE TABLE t96;
+SELECT a FROM t160;
+a
+TRUNCATE TABLE t95;
+SELECT a FROM t161;
+a
+TRUNCATE TABLE t94;
+SELECT a FROM t162;
+a
+TRUNCATE TABLE t93;
+SELECT a FROM t163;
+a
+TRUNCATE TABLE t92;
+SELECT a FROM t164;
+a
+TRUNCATE TABLE t91;
+SELECT a FROM t165;
+a
+TRUNCATE TABLE t90;
+SELECT a FROM t166;
+a
+TRUNCATE TABLE t89;
+SELECT a FROM t167;
+a
+TRUNCATE TABLE t88;
+SELECT a FROM t168;
+a
+TRUNCATE TABLE t87;
+SELECT a FROM t169;
+a
+TRUNCATE TABLE t86;
+SELECT a FROM t170;
+a
+TRUNCATE TABLE t85;
+SELECT a FROM t171;
+a
+TRUNCATE TABLE t84;
+SELECT a FROM t172;
+a
+TRUNCATE TABLE t83;
+SELECT a FROM t173;
+a
+TRUNCATE TABLE t82;
+SELECT a FROM t174;
+a
+TRUNCATE TABLE t81;
+SELECT a FROM t175;
+a
+TRUNCATE TABLE t80;
+SELECT a FROM t176;
+a
+TRUNCATE TABLE t79;
+SELECT a FROM t177;
+a
+TRUNCATE TABLE t78;
+SELECT a FROM t178;
+a
+TRUNCATE TABLE t77;
+SELECT a FROM t179;
+a
+TRUNCATE TABLE t76;
+SELECT a FROM t180;
+a
+TRUNCATE TABLE t75;
+SELECT a FROM t181;
+a
+TRUNCATE TABLE t74;
+SELECT a FROM t182;
+a
+TRUNCATE TABLE t73;
+SELECT a FROM t183;
+a
+TRUNCATE TABLE t72;
+SELECT a FROM t184;
+a
+TRUNCATE TABLE t71;
+SELECT a FROM t185;
+a
+TRUNCATE TABLE t70;
+SELECT a FROM t186;
+a
+TRUNCATE TABLE t69;
+SELECT a FROM t187;
+a
+TRUNCATE TABLE t68;
+SELECT a FROM t188;
+a
+TRUNCATE TABLE t67;
+SELECT a FROM t189;
+a
+TRUNCATE TABLE t66;
+SELECT a FROM t190;
+a
+TRUNCATE TABLE t65;
+SELECT a FROM t191;
+a
+TRUNCATE TABLE t64;
+SELECT a FROM t192;
+a
+TRUNCATE TABLE t63;
+SELECT a FROM t193;
+a
+TRUNCATE TABLE t62;
+SELECT a FROM t194;
+a
+TRUNCATE TABLE t61;
+SELECT a FROM t195;
+a
+TRUNCATE TABLE t60;
+SELECT a FROM t196;
+a
+TRUNCATE TABLE t59;
+SELECT a FROM t197;
+a
+TRUNCATE TABLE t58;
+SELECT a FROM t198;
+a
+TRUNCATE TABLE t57;
+SELECT a FROM t199;
+a
+TRUNCATE TABLE t56;
+SELECT a FROM t200;
+a
+TRUNCATE TABLE t55;
+SELECT a FROM t201;
+a
+TRUNCATE TABLE t54;
+SELECT a FROM t202;
+a
+TRUNCATE TABLE t53;
+SELECT a FROM t203;
+a
+TRUNCATE TABLE t52;
+SELECT a FROM t204;
+a
+TRUNCATE TABLE t51;
+SELECT a FROM t205;
+a
+TRUNCATE TABLE t50;
+SELECT a FROM t206;
+a
+TRUNCATE TABLE t49;
+SELECT a FROM t207;
+a
+TRUNCATE TABLE t48;
+SELECT a FROM t208;
+a
+TRUNCATE TABLE t47;
+SELECT a FROM t209;
+a
+TRUNCATE TABLE t46;
+SELECT a FROM t210;
+a
+TRUNCATE TABLE t45;
+SELECT a FROM t211;
+a
+TRUNCATE TABLE t44;
+SELECT a FROM t212;
+a
+TRUNCATE TABLE t43;
+SELECT a FROM t213;
+a
+TRUNCATE TABLE t42;
+SELECT a FROM t214;
+a
+TRUNCATE TABLE t41;
+SELECT a FROM t215;
+a
+TRUNCATE TABLE t40;
+SELECT a FROM t216;
+a
+TRUNCATE TABLE t39;
+SELECT a FROM t217;
+a
+TRUNCATE TABLE t38;
+SELECT a FROM t218;
+a
+TRUNCATE TABLE t37;
+SELECT a FROM t219;
+a
+TRUNCATE TABLE t36;
+SELECT a FROM t220;
+a
+TRUNCATE TABLE t35;
+SELECT a FROM t221;
+a
+TRUNCATE TABLE t34;
+SELECT a FROM t222;
+a
+TRUNCATE TABLE t33;
+SELECT a FROM t223;
+a
+TRUNCATE TABLE t32;
+SELECT a FROM t224;
+a
+TRUNCATE TABLE t31;
+SELECT a FROM t225;
+a
+TRUNCATE TABLE t30;
+SELECT a FROM t226;
+a
+TRUNCATE TABLE t29;
+SELECT a FROM t227;
+a
+TRUNCATE TABLE t28;
+SELECT a FROM t228;
+a
+TRUNCATE TABLE t27;
+SELECT a FROM t229;
+a
+TRUNCATE TABLE t26;
+SELECT a FROM t230;
+a
+TRUNCATE TABLE t25;
+SELECT a FROM t231;
+a
+TRUNCATE TABLE t24;
+SELECT a FROM t232;
+a
+TRUNCATE TABLE t23;
+SELECT a FROM t233;
+a
+TRUNCATE TABLE t22;
+SELECT a FROM t234;
+a
+TRUNCATE TABLE t21;
+SELECT a FROM t235;
+a
+TRUNCATE TABLE t20;
+SELECT a FROM t236;
+a
+TRUNCATE TABLE t19;
+SELECT a FROM t237;
+a
+TRUNCATE TABLE t18;
+SELECT a FROM t238;
+a
+TRUNCATE TABLE t17;
+SELECT a FROM t239;
+a
+TRUNCATE TABLE t16;
+SELECT a FROM t240;
+a
+TRUNCATE TABLE t15;
+SELECT a FROM t241;
+a
+TRUNCATE TABLE t14;
+SELECT a FROM t242;
+a
+TRUNCATE TABLE t13;
+SELECT a FROM t243;
+a
+TRUNCATE TABLE t12;
+SELECT a FROM t244;
+a
+TRUNCATE TABLE t11;
+SELECT a FROM t245;
+a
+TRUNCATE TABLE t10;
+SELECT a FROM t246;
+a
+TRUNCATE TABLE t9;
+SELECT a FROM t247;
+a
+TRUNCATE TABLE t8;
+SELECT a FROM t248;
+a
+TRUNCATE TABLE t7;
+SELECT a FROM t249;
+a
+TRUNCATE TABLE t6;
+SELECT a FROM t250;
+a
+TRUNCATE TABLE t5;
+SELECT a FROM t251;
+a
+TRUNCATE TABLE t4;
+SELECT a FROM t252;
+a
+TRUNCATE TABLE t3;
+SELECT a FROM t253;
+a
+TRUNCATE TABLE t2;
+SELECT a FROM t254;
+a
+TRUNCATE TABLE t1;
+SELECT a FROM t255;
+a
+SELECT a FROM t0;
+a
+DROP TABLE t0;
+DROP TABLE t255;
+DROP TABLE t254;
+DROP TABLE t253;
+DROP TABLE t252;
+DROP TABLE t251;
+DROP TABLE t250;
+DROP TABLE t249;
+DROP TABLE t248;
+DROP TABLE t247;
+DROP TABLE t246;
+DROP TABLE t245;
+DROP TABLE t244;
+DROP TABLE t243;
+DROP TABLE t242;
+DROP TABLE t241;
+DROP TABLE t240;
+DROP TABLE t239;
+DROP TABLE t238;
+DROP TABLE t237;
+DROP TABLE t236;
+DROP TABLE t235;
+DROP TABLE t234;
+DROP TABLE t233;
+DROP TABLE t232;
+DROP TABLE t231;
+DROP TABLE t230;
+DROP TABLE t229;
+DROP TABLE t228;
+DROP TABLE t227;
+DROP TABLE t226;
+DROP TABLE t225;
+DROP TABLE t224;
+DROP TABLE t223;
+DROP TABLE t222;
+DROP TABLE t221;
+DROP TABLE t220;
+DROP TABLE t219;
+DROP TABLE t218;
+DROP TABLE t217;
+DROP TABLE t216;
+DROP TABLE t215;
+DROP TABLE t214;
+DROP TABLE t213;
+DROP TABLE t212;
+DROP TABLE t211;
+DROP TABLE t210;
+DROP TABLE t209;
+DROP TABLE t208;
+DROP TABLE t207;
+DROP TABLE t206;
+DROP TABLE t205;
+DROP TABLE t204;
+DROP TABLE t203;
+DROP TABLE t202;
+DROP TABLE t201;
+DROP TABLE t200;
+DROP TABLE t199;
+DROP TABLE t198;
+DROP TABLE t197;
+DROP TABLE t196;
+DROP TABLE t195;
+DROP TABLE t194;
+DROP TABLE t193;
+DROP TABLE t192;
+DROP TABLE t191;
+DROP TABLE t190;
+DROP TABLE t189;
+DROP TABLE t188;
+DROP TABLE t187;
+DROP TABLE t186;
+DROP TABLE t185;
+DROP TABLE t184;
+DROP TABLE t183;
+DROP TABLE t182;
+DROP TABLE t181;
+DROP TABLE t180;
+DROP TABLE t179;
+DROP TABLE t178;
+DROP TABLE t177;
+DROP TABLE t176;
+DROP TABLE t175;
+DROP TABLE t174;
+DROP TABLE t173;
+DROP TABLE t172;
+DROP TABLE t171;
+DROP TABLE t170;
+DROP TABLE t169;
+DROP TABLE t168;
+DROP TABLE t167;
+DROP TABLE t166;
+DROP TABLE t165;
+DROP TABLE t164;
+DROP TABLE t163;
+DROP TABLE t162;
+DROP TABLE t161;
+DROP TABLE t160;
+DROP TABLE t159;
+DROP TABLE t158;
+DROP TABLE t157;
+DROP TABLE t156;
+DROP TABLE t155;
+DROP TABLE t154;
+DROP TABLE t153;
+DROP TABLE t152;
+DROP TABLE t151;
+DROP TABLE t150;
+DROP TABLE t149;
+DROP TABLE t148;
+DROP TABLE t147;
+DROP TABLE t146;
+DROP TABLE t145;
+DROP TABLE t144;
+DROP TABLE t143;
+DROP TABLE t142;
+DROP TABLE t141;
+DROP TABLE t140;
+DROP TABLE t139;
+DROP TABLE t138;
+DROP TABLE t137;
+DROP TABLE t136;
+DROP TABLE t135;
+DROP TABLE t134;
+DROP TABLE t133;
+DROP TABLE t132;
+DROP TABLE t131;
+DROP TABLE t130;
+DROP TABLE t129;
+DROP TABLE t128;
+DROP TABLE t127;
+DROP TABLE t126;
+DROP TABLE t125;
+DROP TABLE t124;
+DROP TABLE t123;
+DROP TABLE t122;
+DROP TABLE t121;
+DROP TABLE t120;
+DROP TABLE t119;
+DROP TABLE t118;
+DROP TABLE t117;
+DROP TABLE t116;
+DROP TABLE t115;
+DROP TABLE t114;
+DROP TABLE t113;
+DROP TABLE t112;
+DROP TABLE t111;
+DROP TABLE t110;
+DROP TABLE t109;
+DROP TABLE t108;
+DROP TABLE t107;
+DROP TABLE t106;
+DROP TABLE t105;
+DROP TABLE t104;
+DROP TABLE t103;
+DROP TABLE t102;
+DROP TABLE t101;
+DROP TABLE t100;
+DROP TABLE t99;
+DROP TABLE t98;
+DROP TABLE t97;
+DROP TABLE t96;
+DROP TABLE t95;
+DROP TABLE t94;
+DROP TABLE t93;
+DROP TABLE t92;
+DROP TABLE t91;
+DROP TABLE t90;
+DROP TABLE t89;
+DROP TABLE t88;
+DROP TABLE t87;
+DROP TABLE t86;
+DROP TABLE t85;
+DROP TABLE t84;
+DROP TABLE t83;
+DROP TABLE t82;
+DROP TABLE t81;
+DROP TABLE t80;
+DROP TABLE t79;
+DROP TABLE t78;
+DROP TABLE t77;
+DROP TABLE t76;
+DROP TABLE t75;
+DROP TABLE t74;
+DROP TABLE t73;
+DROP TABLE t72;
+DROP TABLE t71;
+DROP TABLE t70;
+DROP TABLE t69;
+DROP TABLE t68;
+DROP TABLE t67;
+DROP TABLE t66;
+DROP TABLE t65;
+DROP TABLE t64;
+DROP TABLE t63;
+DROP TABLE t62;
+DROP TABLE t61;
+DROP TABLE t60;
+DROP TABLE t59;
+DROP TABLE t58;
+DROP TABLE t57;
+DROP TABLE t56;
+DROP TABLE t55;
+DROP TABLE t54;
+DROP TABLE t53;
+DROP TABLE t52;
+DROP TABLE t51;
+DROP TABLE t50;
+DROP TABLE t49;
+DROP TABLE t48;
+DROP TABLE t47;
+DROP TABLE t46;
+DROP TABLE t45;
+DROP TABLE t44;
+DROP TABLE t43;
+DROP TABLE t42;
+DROP TABLE t41;
+DROP TABLE t40;
+DROP TABLE t39;
+DROP TABLE t38;
+DROP TABLE t37;
+DROP TABLE t36;
+DROP TABLE t35;
+DROP TABLE t34;
+DROP TABLE t33;
+DROP TABLE t32;
+DROP TABLE t31;
+DROP TABLE t30;
+DROP TABLE t29;
+DROP TABLE t28;
+DROP TABLE t27;
+DROP TABLE t26;
+DROP TABLE t25;
+DROP TABLE t24;
+DROP TABLE t23;
+DROP TABLE t22;
+DROP TABLE t21;
+DROP TABLE t20;
+DROP TABLE t19;
+DROP TABLE t18;
+DROP TABLE t17;
+DROP TABLE t16;
+DROP TABLE t15;
+DROP TABLE t14;
+DROP TABLE t13;
+DROP TABLE t12;
+DROP TABLE t11;
+DROP TABLE t10;
+DROP TABLE t9;
+DROP TABLE t8;
+DROP TABLE t7;
+DROP TABLE t6;
+DROP TABLE t5;
+DROP TABLE t4;
+DROP TABLE t3;
+DROP TABLE t2;
+DROP TABLE t1;
+SET @@global.query_cache_size = 0;
+End of 5.1 tests
diff --git a/mysql-test/t/query_cache_merge.test b/mysql-test/t/query_cache_merge.test
index 36b8662f088..b854bfb5d67 100644
--- a/mysql-test/t/query_cache_merge.test
+++ b/mysql-test/t/query_cache_merge.test
@@ -38,3 +38,59 @@ drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t2
 SET @@global.query_cache_size=0;
 
 # End of 4.1 tests
+
+#
+# Bug#33362: Query cache invalidation (truncate) may hang if cached query uses many tables
+#
+
+let $c= 255;
+
+while ($c)
+{
+  eval CREATE TABLE t$c (a INT);
+  eval INSERT INTO t$c VALUES ($c);
+  dec $c;
+}
+
+let $c= 254;
+let $str= t255;
+
+while ($c)
+{
+  let $str= t$c,$str;
+  dec $c;
+}
+
+eval CREATE TABLE t0 (a INT) ENGINE=MERGE UNION($str);
+SET GLOBAL query_cache_size = 1048576;
+FLUSH STATUS;
+SELECT a FROM t0 WHERE a = 1;
+SHOW STATUS LIKE "Qcache_queries_in_cache";
+
+let $c= 255;
+let $i= 1;
+
+FLUSH TABLES;
+
+while ($c)
+{
+  eval TRUNCATE TABLE t$c;
+  eval SELECT a FROM t$i;
+  dec $c;
+  inc $i;
+}
+
+SELECT a FROM t0;
+DROP TABLE t0;
+
+let $c= 255;
+
+while ($c)
+{
+  eval DROP TABLE t$c;
+  dec $c;
+}
+
+SET @@global.query_cache_size = 0;
+
+--echo End of 5.1 tests
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index f8906a17c12..b487f092f75 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -2516,7 +2516,7 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block,
 	 tmp++)
       unlink_table(tmp);
   }
-  return (n);
+  return test(n);
 }
 
 /*

From 5c1f8d1836554f6978b8fe84acb3e3e1f207bca1 Mon Sep 17 00:00:00 2001
From: Kristofer Pettersson <kpettersson@mysql.com>
Date: Thu, 24 Jul 2008 22:38:44 +0200
Subject: [PATCH 13/33] Bug#38002 table_cache consumes too much memory with
 blobs

Tables in the table definition cache are keeping a cache buffer for blob
fields which can consume a lot of memory.

This patch introduces a maximum size threshold for these buffers.
---
 sql/field.h      |  2 +-
 sql/mysql_priv.h |  1 +
 sql/sql_base.cc  |  2 ++
 sql/table.cc     | 22 ++++++++++++++++++++++
 sql/table.h      |  3 +++
 5 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/sql/field.h b/sql/field.h
index 7d312dbd2b8..8e00cf013dc 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -13,7 +13,6 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-
 /*
   Because of the function new_field() all field classes that have static
   variables must declare the size_of() member function.
@@ -1669,6 +1668,7 @@ public:
   }
   int reset(void) { bzero(ptr, packlength+sizeof(uchar*)); return 0; }
   void reset_fields() { bzero((uchar*) &value,sizeof(value)); }
+  uint32 get_field_buffer_size(void) { return value.alloced_length(); }
 #ifndef WORDS_BIGENDIAN
   static
 #endif
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index e150ffd18f8..f6ba5fc9739 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -2130,6 +2130,7 @@ int writefrm(const char* name, const uchar* data, size_t len);
 int closefrm(TABLE *table, bool free_share);
 int read_string(File file, uchar* *to, size_t length);
 void free_blobs(TABLE *table);
+void free_field_buffers_larger_than(TABLE *table, uint32 size);
 int set_zone(int nr,int min_zone,int max_zone);
 ulong convert_period_to_month(ulong period);
 ulong convert_month_to_period(ulong month);
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index d25057789ac..39dd815e738 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1369,6 +1369,8 @@ bool close_thread_table(THD *thd, TABLE **table_ptr)
     DBUG_ASSERT(!table->is_children_attached());
 
     /* Free memory and reset for next loop */
+    free_field_buffers_larger_than(table,MAX_TDC_BLOB_SIZE);
+    
     table->file->ha_reset();
     table->in_use=0;
     if (unused_tables)
diff --git a/sql/table.cc b/sql/table.cc
index ebf3dfd748e..58cbde74822 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1999,6 +1999,28 @@ void free_blobs(register TABLE *table)
 }
 
 
+/**
+  Reclaim temporary blob storage which is bigger than 
+  a threshold.
+ 
+  @param table A handle to the TABLE object containing blob fields
+  @param size The threshold value.
+ 
+*/
+
+void free_field_buffers_larger_than(TABLE *table, uint32 size)
+{
+  uint *ptr, *end;
+  for (ptr= table->s->blob_field, end=ptr + table->s->blob_fields ;
+       ptr != end ;
+       ptr++)
+  {
+    Field_blob *blob= (Field_blob*) table->field[*ptr];
+    if (blob->get_field_buffer_size() > size)
+        blob->free();
+  }
+}
+
 	/* Find where a form starts */
 	/* if formname is NullS then only formnames is read */
 
diff --git a/sql/table.h b/sql/table.h
index 75ddaf69c10..da0e089794f 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -935,6 +935,9 @@ typedef struct st_schema_table
 #define VIEW_CHECK_ERROR      1
 #define VIEW_CHECK_SKIP       2
 
+/** The threshold size a blob field buffer before it is freed */
+#define MAX_TDC_BLOB_SIZE 65536
+
 struct st_lex;
 class select_union;
 class TMP_TABLE_PARAM;

From 44be24542a08c33664f1392e5420c37d044463c0 Mon Sep 17 00:00:00 2001
From: Patrick Crews <pcrews@mysql.com>
Date: Fri, 25 Jul 2008 13:14:52 -0400
Subject: [PATCH 14/33] Bug#38383 - Certain funcs_1 trig tests are failing on
 Pushbuild.

Removing duplicate 'setup' portions of these include files.  Likely an editor error created dupe lines.
This is causing many Pushbuild errors
---
 mysql-test/suite/funcs_1/triggers/triggers_03.inc      | 5 -----
 mysql-test/suite/funcs_1/triggers/triggers_08.inc      | 3 +--
 mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc | 7 -------
 3 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03.inc b/mysql-test/suite/funcs_1/triggers/triggers_03.inc
index f8a83315f0c..9ef6a9ac9af 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_03.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03.inc
@@ -13,12 +13,7 @@
 USE test;
 --source suite/funcs_1/include/tb3.inc
 
-# This test cannot be used for the embedded server because we check here
-# privilgeges.
---source include/not_embedded.inc
 
-USE test;
---source suite/funcs_1/include/tb3.inc
 
 --disable_abort_on_error
 
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_08.inc b/mysql-test/suite/funcs_1/triggers/triggers_08.inc
index 399b27508db..087f18e8e6b 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_08.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_08.inc
@@ -8,8 +8,7 @@
 USE test;
 --source suite/funcs_1/include/tb3.inc
 
-USE test;
---source suite/funcs_1/include/tb3.inc
+
 
 # General setup for Trigger tests
 let $message= Testcase: 3.5:;
diff --git a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
index 529eb6c77fd..7230f240e2d 100644
--- a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
+++ b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
@@ -13,13 +13,6 @@ eval
 load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
 into table tb3;
 
-USE test;
---source suite/funcs_1/include/tb3.inc
-
---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
-eval
-load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
-into table tb3;
 
 --disable_abort_on_error
 

From da156dde0885aacc494ee7e697f961a85bccfd5e Mon Sep 17 00:00:00 2001
From: Igor Babaev <igor@mysql.com>
Date: Sat, 26 Jul 2008 13:44:07 -0700
Subject: [PATCH 15/33] Fixed bug #38191. Calling
 List<Cached_item>::delete_elements for the same list twice caused a crash of
 the server in the function JOIN::cleaunup. Ensured that delete_elements() in
 JOIN::cleanup would be called only once.

---
 mysql-test/r/subselect.result | 11 +++++++++++
 mysql-test/t/subselect.test   | 12 ++++++++++++
 sql/sql_select.cc             |  6 ++++++
 3 files changed, 29 insertions(+)

diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 12e3aac486e..c5bae840214 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -4396,4 +4396,15 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 Warnings:
 Note	1003	select 1 AS `1` from `test`.`t1` where <in_optimizer>(1,<exists>(select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a` having (<cache>(1) = <ref_null_helper>(1))))
 DROP TABLE t1;
+CREATE TABLE t1(pk int PRIMARY KEY, a int, INDEX idx(a));
+INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20);
+CREATE TABLE t2(pk int PRIMARY KEY, a int, b int, INDEX idxa(a));
+INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100);
+SELECT * FROM t1
+WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);
+pk	a
+1	10
+3	30
+2	20
+DROP TABLE t1,t2;
 End of 5.0 tests.
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 4d9507f1231..2dfad2c58dd 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -3295,5 +3295,17 @@ EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT 1 FROM t1 GROUP BY a);
 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT 1 FROM t1 WHERE a > 3 GROUP BY a);
 DROP TABLE t1;
 
+#
+# Bug #38191: Server crash with subquery containing DISTINCT and ORDER BY
+#
+
+CREATE TABLE t1(pk int PRIMARY KEY, a int, INDEX idx(a));
+INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20);
+CREATE TABLE t2(pk int PRIMARY KEY, a int, b int, INDEX idxa(a));
+INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100);
+SELECT * FROM t1
+   WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);
+DROP TABLE t1,t2;
+
 --echo End of 5.0 tests.
 
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 60ba7591726..c222b8a55ca 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -6469,6 +6469,12 @@ void JOIN::cleanup(bool full)
     if (tmp_join)
       tmp_table_param.copy_field= 0;
     group_fields.delete_elements();
+    /* 
+      Ensure that the above delete_elements() would not be called
+      twice for the same list.
+    */
+    if (tmp_join && tmp_join != this)
+      tmp_join->group_fields= group_fields;
     /*
       We can't call delete_elements() on copy_funcs as this will cause
       problems in free_elements() as some of the elements are then deleted.

From 08162d8c3b79be33b7c8ddad828a1eebd0f958db Mon Sep 17 00:00:00 2001
From: Alexander Barkov <bar@mysql.com>
Date: Tue, 29 Jul 2008 08:25:46 +0500
Subject: [PATCH 16/33] Bug#35808 utf8 hungarian collation not part of the utf8
 charset? config/ac-macros/character_sets.m4 didn't mention hungarian
 collations in the UTF8 and UCS2 lists.

---
 config/ac-macros/character_sets.m4 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4
index ea2763a1cd4..a9f7bd73858 100644
--- a/config/ac-macros/character_sets.m4
+++ b/config/ac-macros/character_sets.m4
@@ -343,8 +343,8 @@ case $default_charset in
       default_charset_default_collation="ucs2_general_ci"
       define(UCSC1, ucs2_general_ci ucs2_bin)
       define(UCSC2, ucs2_czech_ci ucs2_danish_ci)
-      define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_icelandic_ci)
-      define(UCSC4, ucs2_latvian_ci ucs2_lithuanian_ci)
+      define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_hungarian_ci)
+      define(UCSC4, ucs2_icelandic_ci ucs2_latvian_ci ucs2_lithuanian_ci)
       define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci)
       define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci)
       define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci)
@@ -367,8 +367,8 @@ case $default_charset in
       else
         define(UTFC1, utf8_general_ci utf8_bin)
         define(UTFC2, utf8_czech_ci utf8_danish_ci)
-        define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_icelandic_ci)
-        define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci)
+        define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_hungarian_ci)
+        define(UTFC4, utf8_icelandic_ci utf8_latvian_ci utf8_lithuanian_ci)
         define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
         define(UTFC6, utf8_slovak_ci utf8_slovenian_ci)
         define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)

From d298e107f7eebd8bb4d91d7167a968067d80f87d Mon Sep 17 00:00:00 2001
From: Kristofer Pettersson <kpettersson@mysql.com>
Date: Tue, 29 Jul 2008 15:37:09 +0200
Subject: [PATCH 17/33] Bug#37781 mysql_drop_user calls get_current_user()
 twice for no reason

Fixed typo and removed duplicate call to get_current_user.
---
 sql/sql_acl.cc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index e12fbb9843a..df5e844749f 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -5430,7 +5430,6 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
 
   while ((tmp_user_name= user_list++))
   {
-    user_name= get_current_user(thd, tmp_user_name);
     if (!(user_name= get_current_user(thd, tmp_user_name)))
     {
       result= TRUE;

From 7b244002a386610ebac794c0705e19a5bfada946 Mon Sep 17 00:00:00 2001
From: Kristofer Pettersson <kpettersson@mysql.com>
Date: Tue, 29 Jul 2008 15:58:15 +0200
Subject: [PATCH 18/33] Bug#29738 Error message not properly translated to
 Serbian

Community contribution fix for Serbian translation in error message list.
---
 sql/share/errmsg.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 7d345d633c6..0916ad56cef 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -4737,7 +4737,7 @@ ER_SLAVE_IGNORED_TABLE
 	swe "Slav SQL tr�den ignorerade fr�gan pga en replicate-*-table regel"
 ER_INCORRECT_GLOBAL_LOCAL_VAR  
 	eng "Variable '%-.64s' is a %s variable"
-	serbian "Incorrect foreign key definition for '%-.64s': %s"
+	serbian "Promenljiva '%-.64s' je %s promenljiva"
 	ger "Variable '%-.64s' ist eine %s-Variable"
 	spa "Variable '%-.64s' es una %s variable"
 	swe "Variabel '%-.64s' �r av typ %s"

From 425abb4904caa8fa24429eaf9eada3b9ea5d87b1 Mon Sep 17 00:00:00 2001
From: Georgi Kodinov <kgeorge@mysql.com>
Date: Wed, 30 Jul 2008 14:07:37 +0300
Subject: [PATCH 19/33] Bug#37662 nested if() inside sum() is parsed in
 exponential time

min() and max() functions are implemented in MySQL as macros.
This means that max(a,b) is expanded to: ((a) > (b) ? (a) : (b))
Note how 'a' is quoted two times.
Now imagine 'a' is a recursive function call that's several 10s of levels deep.
And the recursive function does max() with a function arg as well to dive into
recursion.
This means that simple function call can take most of the clock time.
Identified and fixed several such calls to max()/min() : including the IF()
sql function implementation.
---
 mysql-test/r/func_if.result | 46 +++++++++++++++++++++++++++++++++++++
 mysql-test/t/func_if.test   | 43 ++++++++++++++++++++++++++++++++++
 sql/item.cc                 | 12 ++++++----
 sql/item_cmpfunc.cc         | 12 ++++++----
 sql/item_func.cc            | 15 ++++++------
 5 files changed, 113 insertions(+), 15 deletions(-)

diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result
index c75e37fa0a4..7ffc957e285 100644
--- a/mysql-test/r/func_if.result
+++ b/mysql-test/r/func_if.result
@@ -131,3 +131,49 @@ drop table t1;
 select if(0, 18446744073709551610, 18446744073709551610);
 if(0, 18446744073709551610, 18446744073709551610)
 18446744073709551610
+CREATE TABLE t1(a DECIMAL(10,3));
+SELECT t1.a,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,0)))))))))))))))))))))))))))))) + 1
+FROM t1;
+a	IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((ROUND(t1.a,2)=1), 2,
+IF((R
+DROP TABLE t1;
+End of 5.0 tests
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index 5373ca3fec6..8da10f36cbe 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -108,3 +108,46 @@ drop table t1;
 select if(0, 18446744073709551610, 18446744073709551610);
 
 
+#
+# Bug #37662: nested if() inside sum() is parsed in exponential time
+#
+
+CREATE TABLE t1(a DECIMAL(10,3));
+
+# check : should be fast. more than few secs means failure.
+SELECT t1.a,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,
+ IF((ROUND(t1.a,2)=1), 2,0)))))))))))))))))))))))))))))) + 1
+FROM t1;
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/sql/item.cc b/sql/item.cc
index bf447581afa..a5c88f55487 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -429,8 +429,11 @@ uint Item::decimal_precision() const
   Item_result restype= result_type();
 
   if ((restype == DECIMAL_RESULT) || (restype == INT_RESULT))
-    return min(my_decimal_length_to_precision(max_length, decimals, unsigned_flag),
-               DECIMAL_MAX_PRECISION);
+  {
+    uint prec= 
+      my_decimal_length_to_precision(max_length, decimals, unsigned_flag);
+    return min(prec, DECIMAL_MAX_PRECISION);
+  }
   return min(max_length, DECIMAL_MAX_PRECISION);
 }
 
@@ -6838,8 +6841,9 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
   if (Field::result_merge_type(fld_type) == DECIMAL_RESULT)
   {
     decimals= min(max(decimals, item->decimals), DECIMAL_MAX_SCALE);
-    int precision= min(max(prev_decimal_int_part, item->decimal_int_part())
-                       + decimals, DECIMAL_MAX_PRECISION);
+    int item_int_part= item->decimal_int_part();
+    int item_prec = max(prev_decimal_int_part, item_int_part) + decimals;
+    int precision= min(item_prec, DECIMAL_MAX_PRECISION);
     unsigned_flag&= item->unsigned_flag;
     max_length= my_decimal_precision_to_length(precision, decimals,
                                                unsigned_flag);
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 16f3e51d615..1994f6bf1a5 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2098,8 +2098,11 @@ Item_func_ifnull::fix_length_and_dec()
 
 uint Item_func_ifnull::decimal_precision() const
 {
-  int max_int_part=max(args[0]->decimal_int_part(),args[1]->decimal_int_part());
-  return min(max_int_part + decimals, DECIMAL_MAX_PRECISION);
+  int arg0_int_part= args[0]->decimal_int_part();
+  int arg1_int_part= args[1]->decimal_int_part();
+  int max_int_part= max(arg0_int_part, arg1_int_part);
+  int precision= max_int_part + decimals;
+  return min(precision, DECIMAL_MAX_PRECISION);
 }
 
 
@@ -2281,8 +2284,9 @@ Item_func_if::fix_length_and_dec()
 
 uint Item_func_if::decimal_precision() const
 {
-  int precision=(max(args[1]->decimal_int_part(),args[2]->decimal_int_part())+
-                 decimals);
+  int arg1_prec= args[1]->decimal_int_part();
+  int arg2_prec= args[2]->decimal_int_part();
+  int precision=max(arg1_prec,arg2_prec) + decimals;
   return min(precision, DECIMAL_MAX_PRECISION);
 }
 
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 7416471d630..e663e1fcf83 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1156,9 +1156,10 @@ my_decimal *Item_func_plus::decimal_op(my_decimal *decimal_value)
 void Item_func_additive_op::result_precision()
 {
   decimals= max(args[0]->decimals, args[1]->decimals);
-  int max_int_part= max(args[0]->decimal_precision() - args[0]->decimals,
-                        args[1]->decimal_precision() - args[1]->decimals);
-  int precision= min(max_int_part + 1 + decimals, DECIMAL_MAX_PRECISION);
+  int arg1_int= args[0]->decimal_precision() - args[0]->decimals;
+  int arg2_int= args[1]->decimal_precision() - args[1]->decimals;
+  int est_prec= max(arg1_int, arg2_int) + 1 + decimals;
+  int precision= min(est_prec, DECIMAL_MAX_PRECISION);
 
   /* Integer operations keep unsigned_flag if one of arguments is unsigned */
   if (result_type() == INT_RESULT)
@@ -1267,8 +1268,8 @@ void Item_func_mul::result_precision()
   else
     unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag;
   decimals= min(args[0]->decimals + args[1]->decimals, DECIMAL_MAX_SCALE);
-  int precision= min(args[0]->decimal_precision() + args[1]->decimal_precision(),
-                     DECIMAL_MAX_PRECISION);
+  uint est_prec = args[0]->decimal_precision() + args[1]->decimal_precision();
+  uint precision= min(est_prec, DECIMAL_MAX_PRECISION);
   max_length= my_decimal_precision_to_length(precision, decimals,unsigned_flag);
 }
 
@@ -1315,8 +1316,8 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value)
 
 void Item_func_div::result_precision()
 {
-  uint precision=min(args[0]->decimal_precision() + prec_increment,
-                     DECIMAL_MAX_PRECISION);
+  uint arg_prec= args[0]->decimal_precision() + prec_increment;
+  uint precision=min(arg_prec, DECIMAL_MAX_PRECISION);
   /* Integer operations keep unsigned_flag if one of arguments is unsigned */
   if (result_type() == INT_RESULT)
     unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag;

From a0768d32c24b2548a47dbd99aa00d53c5019220d Mon Sep 17 00:00:00 2001
From: Georgi Kodinov <kgeorge@mysql.com>
Date: Thu, 31 Jul 2008 12:28:04 +0300
Subject: [PATCH 20/33] Bug#34159: mysql_install_db fails with
 sql_mode=TRADITIONAL

Reset session sql_mode before creating system tables as it
is done in the mysql_fix_privilege_tables.sql script.
---
 scripts/mysql_system_tables.sql | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index d9c870f1d73..31eb205eed0 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -2,6 +2,7 @@
 -- The system tables of MySQL Server
 --
 
+set sql_mode='';
 set storage_engine=myisam;
 
 CREATE TABLE IF NOT EXISTS db (   Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';

From 021d7d72f899c0734a086dde71a599af92c63cfe Mon Sep 17 00:00:00 2001
From: Timothy Smith <timothy.smith@sun.com>
Date: Thu, 31 Jul 2008 15:47:57 -0600
Subject: [PATCH 21/33] Cherry-pick InnoDB fixes for Bug#34286, Bug#35352, and
 Bug#36600 from snapshot innodb-5.0-ss2475.

Bug #34286  Assertion failure in thread 2816 in file .\row\row0sel.c line 3500
Since autoinc init performs a MySQL SELECT query to determine the auto-inc
value, set prebuilt->sql_stat_start = TRUE so that it is performed like any
normal SELECT, regardless of the context in which it was invoked.


Bug #35352  If InnoDB crashes with UNDO slots full error the error persists on restart
We've added a heuristic that checks the size of the UNDO slots cache lists
(insert and upate). If either of cached lists has more than 500 entries then we
add any UNDO slots that are freed, to the common free list instead of the cache
list, this is to avoid the case where all the free slots end up in only one of
the lists on startup after a crash.

Tested with test case for 26590 and passes all mysql-test(s).

Bug #36600  SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number
Fixed by removing the Innodb_buffer_pool_pages_latched variable from SHOW
STATUS output in non-UNIV_DEBUG compilation.
---
 innobase/buf/buf0buf.c                      |  2 ++
 innobase/include/buf0buf.h                  | 13 +++++----
 innobase/include/srv0srv.h                  |  2 ++
 innobase/include/trx0undo.h                 |  1 +
 innobase/srv/srv0srv.c                      |  2 ++
 innobase/trx/trx0trx.c                      |  8 +++---
 innobase/trx/trx0undo.c                     | 29 ++++++++++++++++-----
 mysql-test/r/innodb-autoinc-optimize.result |  6 +++++
 mysql-test/t/innodb-autoinc-optimize.test   | 16 ++++++++++++
 sql/ha_innodb.cc                            | 10 ++++++-
 10 files changed, 73 insertions(+), 16 deletions(-)
 create mode 100644 mysql-test/r/innodb-autoinc-optimize.result
 create mode 100644 mysql-test/t/innodb-autoinc-optimize.test

diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
index 9df48495355..6cfcb0fc724 100644
--- a/innobase/buf/buf0buf.c
+++ b/innobase/buf/buf0buf.c
@@ -2260,6 +2260,7 @@ buf_print(void)
 	ut_a(buf_validate());
 }	
 
+#ifdef UNIV_DEBUG
 /*************************************************************************
 Returns the number of latched pages in the buffer pool. */
 
@@ -2290,6 +2291,7 @@ buf_get_latched_pages_number(void)
         mutex_exit(&(buf_pool->mutex));
         return fixed_pages_number;
 }
+#endif /* UNIV_DEBUG */
 
 /*************************************************************************
 Returns the number of pending buf pool ios. */
diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h
index 11e5bb39e63..f802ffa6510 100644
--- a/innobase/include/buf0buf.h
+++ b/innobase/include/buf0buf.h
@@ -495,7 +495,15 @@ Prints info of the buffer pool data structure. */
 void
 buf_print(void);
 /*============*/
+
+/*************************************************************************
+Returns the number of latched pages in the buffer pool. */
+
+ulint
+buf_get_latched_pages_number(void);
+/*==============================*/
 #endif /* UNIV_DEBUG */
+
 /************************************************************************
 Prints a page to stderr. */
 
@@ -503,12 +511,7 @@ void
 buf_page_print(
 /*===========*/
 	byte*	read_buf);	/* in: a database page */
-/*************************************************************************
-Returns the number of latched pages in the buffer pool. */
 
-ulint
-buf_get_latched_pages_number(void);
-/*==============================*/
 /*************************************************************************
 Returns the number of pending buf pool ios. */
 
diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
index f379efa98eb..97e9136040d 100644
--- a/innobase/include/srv0srv.h
+++ b/innobase/include/srv0srv.h
@@ -531,7 +531,9 @@ struct export_var_struct{
         ulint innodb_buffer_pool_pages_dirty;
         ulint innodb_buffer_pool_pages_misc;
         ulint innodb_buffer_pool_pages_free;
+#ifdef UNIV_DEBUG
         ulint innodb_buffer_pool_pages_latched;
+#endif /* UNIV_DEBUG */
         ulint innodb_buffer_pool_read_requests;
         ulint innodb_buffer_pool_reads;
         ulint innodb_buffer_pool_wait_free;
diff --git a/innobase/include/trx0undo.h b/innobase/include/trx0undo.h
index bd7337e4f90..4f1847aa88c 100644
--- a/innobase/include/trx0undo.h
+++ b/innobase/include/trx0undo.h
@@ -237,6 +237,7 @@ trx_undo_set_state_at_finish(
 /*=========================*/
 				/* out: undo log segment header page,
 				x-latched */
+	trx_rseg_t*	rseg,	/* in: rollback segment memory object */
 	trx_t*		trx,	/* in: transaction */
 	trx_undo_t*	undo,	/* in: undo log memory copy */
 	mtr_t*		mtr);	/* in: mtr */
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 1227824ef80..431138400b6 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -1803,7 +1803,9 @@ srv_export_innodb_status(void)
         export_vars.innodb_buffer_pool_pages_data= UT_LIST_GET_LEN(buf_pool->LRU);
         export_vars.innodb_buffer_pool_pages_dirty= UT_LIST_GET_LEN(buf_pool->flush_list);
         export_vars.innodb_buffer_pool_pages_free= UT_LIST_GET_LEN(buf_pool->free);
+#ifdef UNIV_DEBUG
         export_vars.innodb_buffer_pool_pages_latched= buf_get_latched_pages_number();
+#endif /* UNIV_DEBUG */
         export_vars.innodb_buffer_pool_pages_total= buf_pool->curr_size;
         export_vars.innodb_buffer_pool_pages_misc= buf_pool->max_size -
           UT_LIST_GET_LEN(buf_pool->LRU) - UT_LIST_GET_LEN(buf_pool->free);
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index d865c709bf6..70fd73f2488 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -761,8 +761,8 @@ trx_commit_off_kernel(
 		mutex_enter(&(rseg->mutex));
 			
 		if (trx->insert_undo != NULL) {
-			trx_undo_set_state_at_finish(trx, trx->insert_undo,
-									&mtr);
+			trx_undo_set_state_at_finish(
+				rseg, trx, trx->insert_undo, &mtr);
 		}
 
 		undo = trx->update_undo;
@@ -777,8 +777,8 @@ trx_commit_off_kernel(
 			because only a single OS thread is allowed to do the
 			transaction commit for this transaction. */
 					
-			update_hdr_page = trx_undo_set_state_at_finish(trx,
-								undo, &mtr);
+			update_hdr_page = trx_undo_set_state_at_finish(
+				rseg, trx, undo, &mtr);
 
 			/* We have to do the cleanup for the update log while
 			holding the rseg mutex because update log headers
diff --git a/innobase/trx/trx0undo.c b/innobase/trx/trx0undo.c
index 7441dd3f152..251cd355897 100644
--- a/innobase/trx/trx0undo.c
+++ b/innobase/trx/trx0undo.c
@@ -1724,6 +1724,7 @@ trx_undo_set_state_at_finish(
 /*=========================*/
 				/* out: undo log segment header page,
 				x-latched */
+	trx_rseg_t*	rseg,	/* in: rollback segment memory object */
 	trx_t*		trx __attribute__((unused)), /* in: transaction */
 	trx_undo_t*	undo,	/* in: undo log memory copy */
 	mtr_t*		mtr)	/* in: mtr */
@@ -1732,8 +1733,10 @@ trx_undo_set_state_at_finish(
 	trx_upagef_t*	page_hdr;
 	page_t*		undo_page;
 	ulint		state;
-	
-	ut_ad(trx && undo && mtr);
+
+	ut_ad(trx);
+	ut_ad(undo);
+	ut_ad(mtr);
 
 	if (undo->id >= TRX_RSEG_N_SLOTS) {
 		fprintf(stderr, "InnoDB: Error: undo->id is %lu\n",
@@ -1747,9 +1750,23 @@ trx_undo_set_state_at_finish(
 	seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
 	page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
 
-	if (undo->size == 1 && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
-						< TRX_UNDO_PAGE_REUSE_LIMIT) {
-		state = TRX_UNDO_CACHED;
+	if (undo->size == 1
+	    && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
+	       < TRX_UNDO_PAGE_REUSE_LIMIT) {
+
+		/* This is a heuristic to avoid the problem of all UNDO
+		slots ending up in one of the UNDO lists. Previously if
+		the server crashed with all the slots in one of the lists,
+		transactions that required the slots of a different type
+		would fail for lack of slots. */
+
+		if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500
+		    && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
+
+			state = TRX_UNDO_CACHED;
+		} else {
+			state = TRX_UNDO_TO_FREE;
+		}
 
 	} else if (undo->type == TRX_UNDO_INSERT) {
 
@@ -1759,7 +1776,7 @@ trx_undo_set_state_at_finish(
 	}
 
 	undo->state = state;
-		   
+
 	mlog_write_ulint(seg_hdr + TRX_UNDO_STATE, state, MLOG_2BYTES, mtr);
 
 	return(undo_page);
diff --git a/mysql-test/r/innodb-autoinc-optimize.result b/mysql-test/r/innodb-autoinc-optimize.result
new file mode 100644
index 00000000000..61739f0713a
--- /dev/null
+++ b/mysql-test/r/innodb-autoinc-optimize.result
@@ -0,0 +1,6 @@
+drop table if exists t1;
+create table t1(a int not null auto_increment primary key) engine=innodb;
+insert into t1 set a = -1;
+optimize table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	status	OK
diff --git a/mysql-test/t/innodb-autoinc-optimize.test b/mysql-test/t/innodb-autoinc-optimize.test
new file mode 100644
index 00000000000..c7e22a8ff40
--- /dev/null
+++ b/mysql-test/t/innodb-autoinc-optimize.test
@@ -0,0 +1,16 @@
+-- source include/have_innodb.inc
+# embedded server ignores 'delayed', so skip this
+-- source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# Bug 34286
+#
+create table t1(a int not null auto_increment primary key) engine=innodb;
+insert into t1 set a = -1;
+# NOTE: The database needs to be shutdown and restarted (here) for
+# the test to work. It's included for reference only.
+optimize table t1;
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 1be6137460b..1c0f8a6e9b3 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -244,8 +244,10 @@ struct show_var_st innodb_status_variables[]= {
   (char*) &export_vars.innodb_buffer_pool_pages_flushed,  SHOW_LONG},
   {"buffer_pool_pages_free",
   (char*) &export_vars.innodb_buffer_pool_pages_free,     SHOW_LONG},
+#ifdef UNIV_DEBUG
   {"buffer_pool_pages_latched",
   (char*) &export_vars.innodb_buffer_pool_pages_latched,  SHOW_LONG},
+#endif /* UNIV_DEBUG */
   {"buffer_pool_pages_misc",
   (char*) &export_vars.innodb_buffer_pool_pages_misc,     SHOW_LONG},
   {"buffer_pool_pages_total",
@@ -4250,7 +4252,7 @@ ha_innobase::rnd_pos(
 	int		error;
 	uint		keynr	= active_index;
 	DBUG_ENTER("rnd_pos");
-	DBUG_DUMP("key", (uchar *)pos, ref_length);
+	DBUG_DUMP("key", (uchar*) pos, ref_length);
 
 	statistic_increment(current_thd->status_var.ha_read_rnd_count,
 			    &LOCK_status);
@@ -6882,6 +6884,12 @@ ha_innobase::innobase_read_and_init_auto_inc(
 	from a table when no table has been locked in ::external_lock(). */
 	prebuilt->trx->n_mysql_tables_in_use++;
 
+	/* Since we will perform a MySQL SELECT query to determine the
+	auto-inc value, set prebuilt->sql_stat_start = TRUE so that it
+	is performed like any normal SELECT, regardless of the context
+	we come here. */
+        prebuilt->sql_stat_start = TRUE;
+
 	error = index_last(table->record[1]);
 
 	prebuilt->trx->n_mysql_tables_in_use--;

From 9f550e6fbdd994edc4ef0d447b29ab83df9aa0aa Mon Sep 17 00:00:00 2001
From: Davi Arnaut <Davi.Arnaut@Sun.COM>
Date: Fri, 1 Aug 2008 12:10:06 -0300
Subject: [PATCH 22/33] Bug#37003: Tests sporadically crashes with embedded
 server

Post-merge fix: Alter linking order so that the thread linking
flags appear last in the list. This needs to be done this way
because some linkers will not search the thread archive again
if a undefined symbol (pthread_kill in this case) appears later.
---
 client/Makefile.am | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/client/Makefile.am b/client/Makefile.am
index 940766ac66c..25b0c0cee00 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -88,11 +88,12 @@ mysqlslap_LDADD =		$(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
 
 mysqltest_SOURCES=		mysqltest.c
 mysqltest_CFLAGS=		-DTHREAD -UUNDEF_THREADS_HACK
-mysqltest_LDADD =		$(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
+mysqltest_LDADD =		$(CXXLDFLAGS) \
 				@CLIENT_EXTRA_LDFLAGS@ \
 				$(LIBMYSQLCLIENT_LA) \
 				$(top_builddir)/mysys/libmysys.a \
-				$(top_builddir)/regex/libregex.a
+				$(top_builddir)/regex/libregex.a \
+				$(CLIENT_THREAD_LIBS)
 
 mysql_upgrade_SOURCES=          mysql_upgrade.c \
                                 $(top_srcdir)/mysys/my_getpagesize.c

From 15beb38f9f47fe3807268c5d354d1a2bfefbfa3d Mon Sep 17 00:00:00 2001
From: Chad MILLER <chad@mysql.com>
Date: Wed, 6 Aug 2008 15:27:28 -0400
Subject: [PATCH 23/33] Bug#37201: make tags doesn't work in bazaar server
 trees

bk sfiles -> bzr ls
---
 support-files/build-tags | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/support-files/build-tags b/support-files/build-tags
index d5f9fbf5100..1879f9f8891 100755
--- a/support-files/build-tags
+++ b/support-files/build-tags
@@ -2,7 +2,7 @@
 
 rm -f TAGS
 filter='\.cc$\|\.c$\|\.h$\|\.yy$'
-files=`bk -r sfiles -gU | grep $filter `
+files=`bzr ls --kind=file | grep $filter `
 for f in $files ;
 do
 	 etags -o TAGS --append $f

From b94519a154f9511b11f475a3b62ebb377b0e3c83 Mon Sep 17 00:00:00 2001
From: Chad MILLER <chad@mysql.com>
Date: Wed, 6 Aug 2008 16:25:25 -0400
Subject: [PATCH 24/33] Bug#37201: make tags doesn't work in bazaar server
 trees

Fall back to "find" if bzr is unavailable.

Don't fail for paths that have spaces in them.
---
 support-files/build-tags | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/support-files/build-tags b/support-files/build-tags
index 1879f9f8891..6c80d2638e9 100755
--- a/support-files/build-tags
+++ b/support-files/build-tags
@@ -2,8 +2,11 @@
 
 rm -f TAGS
 filter='\.cc$\|\.c$\|\.h$\|\.yy$'
-files=`bzr ls --kind=file | grep $filter `
-for f in $files ;
+
+list="find . -type f"
+bzr root >/dev/null 2>/dev/null && list="bzr ls --kind=file --versioned"
+
+$list |grep $filter |while read f; 
 do
 	 etags -o TAGS --append $f
 done

From e01cac7d89492e3d7cd64e32a79e359b5b13cd89 Mon Sep 17 00:00:00 2001
From: Davi Arnaut <Davi.Arnaut@Sun.COM>
Date: Wed, 6 Aug 2008 23:23:58 -0300
Subject: [PATCH 25/33] Bug#21226 FLUSH PRIVILEGES does not provided feedback
 when it fails.

Post-merge fix: remove spurious semicolon that caused the function
to return failure regardless of the outcome.
---
 sql/sql_parse.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 8857b09b24b..d9ec8f6c610 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6591,7 +6591,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
       if (lock_global_read_lock(thd))
 	return 1;                               // Killed
       if (close_cached_tables(thd, tables, FALSE, (options & REFRESH_FAST) ?
-                              FALSE : TRUE, TRUE));
+                              FALSE : TRUE, TRUE))
           result= 1;
       
       if (make_global_read_lock_block_commit(thd)) // Killed
@@ -6604,7 +6604,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
     else
     {
       if (close_cached_tables(thd, tables, FALSE, (options & REFRESH_FAST) ?
-                              FALSE : TRUE, FALSE));
+                              FALSE : TRUE, FALSE))
         result= 1;
     }
     my_dbopt_cleanup();

From 6c93f05a66e1f522b8f9ec96a4660423f1f20e13 Mon Sep 17 00:00:00 2001
From: Chad MILLER <chad@mysql.com>
Date: Thu, 7 Aug 2008 12:24:39 -0400
Subject: [PATCH 26/33] Bug#31605: mysql_upgrade relies on Linux /proc
 filesystem when not \ 	running on Windows

We used two OS-specific methods of looking up the executable
name, which don't work outside of those two kinds of OSes
(Linux+Solaris and Windows).

We assume that if the user ran this program with a certain
name, we can run the other sibling programs with a similar name.

(re-patch in bzr)
---
 client/mysql_upgrade.c | 139 +++++++++++++++++------------------------
 1 file changed, 56 insertions(+), 83 deletions(-)

diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index ded9d465d3a..15fa6622f74 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -259,6 +259,10 @@ get_one_option(int optid, const struct my_option *opt,
 }
 
 
+/**
+  Run a command using the shell, storing its output in the supplied dynamic
+  string.
+*/
 static int run_command(char* cmd,
                        DYNAMIC_STRING *ds_res)
 {
@@ -331,36 +335,16 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...)
 }
 
 
-/*
-  Try to get the full path to this exceutable
-
-  Return 0 if path found
-
+/**
+  Look for the filename of given tool, with the presumption that it is in the
+  same directory as mysql_upgrade and that the same executable-searching 
+  mechanism will be used when we run our sub-shells with popen() later.
 */
-
-static my_bool get_full_path_to_executable(char* path)
+static void find_tool(char *tool_executable_name, const char *tool_name, 
+                      const char *self_name)
 {
-  my_bool ret;
-  DBUG_ENTER("get_full_path_to_executable");
-#ifdef __WIN__
-  ret= (GetModuleFileName(NULL, path, FN_REFLEN) == 0);
-#else
-  /* my_readlink returns 0 if a symlink was read */
-  ret= (my_readlink(path, "/proc/self/exe", MYF(0)) != 0);
-  /* Might also want to try with /proc/$$/exe if the above fails */
-#endif
-  DBUG_PRINT("exit", ("path: %s", path));
-  DBUG_RETURN(ret);
-}
+  char *last_fn_libchar;
 
-
-/*
-  Look for the tool in the same directory as mysql_upgrade.
-*/
-
-static void find_tool(char *tool_path, const char *tool_name)
-{
-  char path[FN_REFLEN];
   DYNAMIC_STRING ds_tmp;
   DBUG_ENTER("find_tool");
   DBUG_PRINT("enter", ("progname: %s", my_progname));
@@ -368,77 +352,57 @@ static void find_tool(char *tool_path, const char *tool_name)
   if (init_dynamic_string(&ds_tmp, "", 32, 32))
     die("Out of memory");
 
-  /* Initialize path with the full path to this program */
-  if (get_full_path_to_executable(path))
+  last_fn_libchar= strrchr(self_name, FN_LIBCHAR);
+
+  if (last_fn_libchar == NULL)
   {
     /*
-      Easy way to get full executable path failed, try
-      other methods
+      mysql_upgrade was found by the shell searching the path.  A sibling
+      next to us should be found the same way.
     */
-    if (my_progname[0] == FN_LIBCHAR)
-    {
-      /* 1. my_progname contains full path */
-      strmake(path, my_progname, FN_REFLEN);
-    }
-    else if (my_progname[0] == '.')
-    {
-      /* 2. my_progname contains relative path, prepend wd */
-      char buf[FN_REFLEN];
-      my_getwd(buf, FN_REFLEN, MYF(0));
-      my_snprintf(path, FN_REFLEN, "%s%s", buf, my_progname);
-    }
-    else
-    {
-      /* 3. Just go for it and hope tool is in path */
-      path[0]= 0;
-    }
+    strncpy(tool_executable_name, tool_name, FN_REFLEN);
   }
-
-  DBUG_PRINT("info", ("path: '%s'", path));
-
-  /* Chop off binary name (i.e mysql-upgrade) from path */
-  dirname_part(path, path);
-
-  /*
-    When running in a not yet installed build and using libtool,
-    the program(mysql_upgrade) will be in .libs/ and executed
-    through a libtool wrapper in order to use the dynamic libraries
-    from this build. The same must be done for the tools(mysql and
-    mysqlcheck). Thus if path ends in .libs/, step up one directory
-    and execute the tools from there
-  */
-  path[max((strlen(path)-1), 0)]= 0;   /* Chop off last / */
-  if (strncmp(path + dirname_length(path), ".libs", 5) == 0)
+  else
   {
-    DBUG_PRINT("info", ("Chopping off .libs from '%s'", path));
+    /* 
+      mysql_upgrade was run absolutely or relatively.  We can find a sibling
+      by replacing our name after the LIBCHAR with the new tool name.
+    */
 
-    /* Chop off .libs */
-    dirname_part(path, path);
+    /*
+      When running in a not yet installed build and using libtool,
+      the program(mysql_upgrade) will be in .libs/ and executed
+      through a libtool wrapper in order to use the dynamic libraries
+      from this build. The same must be done for the tools(mysql and
+      mysqlcheck). Thus if path ends in .libs/, step up one directory
+      and execute the tools from there
+    */
+    if (((last_fn_libchar - 6) >= self_name) &&
+        (strncmp(last_fn_libchar - 5, ".libs", 5) == 0) &&
+        (*(last_fn_libchar - 6) == FN_LIBCHAR))
+    {
+      DBUG_PRINT("info", ("Chopping off \".libs\" from end of path"));
+      last_fn_libchar -= 6;
+    }
+
+    my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s",
+             (last_fn_libchar - self_name), self_name, 
+             FN_LIBCHAR,
+             tool_name);
   }
 
-
-  DBUG_PRINT("info", ("path: '%s'", path));
-
-  /* Format name of the tool to search for */
-  fn_format(tool_path, tool_name,
-            path, "", MYF(MY_REPLACE_DIR));
-
-  verbose("Looking for '%s' in: %s", tool_name, tool_path);
-
-  /* Make sure the tool exists */
-  if (my_access(tool_path, F_OK) != 0)
-    die("Can't find '%s'", tool_path);
+  verbose("Looking for '%s' as: %s", tool_name, tool_executable_name);
 
   /*
     Make sure it can be executed
   */
-  if (run_tool(tool_path,
+  if (run_tool(tool_executable_name,
                &ds_tmp, /* Get output from command, discard*/
                "--help",
                "2>&1",
                IF_WIN("> NUL", "> /dev/null"),
                NULL))
-    die("Can't execute '%s'", tool_path);
+    die("Can't execute '%s'", tool_executable_name);
 
   dynstr_free(&ds_tmp);
 
@@ -748,11 +712,20 @@ static const char *load_default_groups[]=
 
 int main(int argc, char **argv)
 {
+  char self_name[FN_REFLEN];
+
   MY_INIT(argv[0]);
 #ifdef __NETWARE__
   setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
 #endif
 
+#if __WIN__
+  if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
+#endif
+  {
+    strncpy(self_name, argv[0], FN_REFLEN);
+  }
+
   if (init_dynamic_string(&ds_args, "", 512, 256))
     die("Out of memory");
 
@@ -774,10 +747,10 @@ int main(int argc, char **argv)
   dynstr_append(&ds_args, " ");
 
   /* Find mysql */
-  find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"));
+  find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name);
 
   /* Find mysqlcheck */
-  find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"));
+  find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
 
   /*
     Read the mysql_upgrade_info file to check if mysql_upgrade

From 4ea036f4cb7ed19d1944259fcba0a337443dbc85 Mon Sep 17 00:00:00 2001
From: Timothy Smith <timothy.smith@sun.com>
Date: Thu, 7 Aug 2008 18:25:24 -0600
Subject: [PATCH 27/33] Cherry-pick fix for Bug#35220 from innodb-5.0-ss2475
 snapshot.

Bug#35220: ALTER TABLE too picky on reserved word "foreign"

In ALTER TABLE, change the internal parser to search for
``FOREIGN[[:space:]]'' instead of only ``FOREIGN'' when parsing
ALTER TABLE ... DROP FOREIGN KEY ...; otherwise it could be mistaken
with ALTER TABLE ... DROP foreign_col;

(This fix is already present in MySQL 5.1 and higher.)
---
 innobase/dict/dict0dict.c           |  2 +-
 mysql-test/r/innodb_bug35220.result |  1 +
 mysql-test/t/innodb_bug35220.test   | 16 ++++++++++++++++
 3 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 mysql-test/r/innodb_bug35220.result
 create mode 100644 mysql-test/t/innodb_bug35220.test

diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index 96c822857df..b8d9f362b06 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -3554,7 +3554,7 @@ loop:
 
 	ptr = dict_accept(ptr, "FOREIGN", &success);
 	
-	if (!success) {
+	if (!success || !ib_isspace(*ptr)) {
 
 	        goto loop;
 	}
diff --git a/mysql-test/r/innodb_bug35220.result b/mysql-test/r/innodb_bug35220.result
new file mode 100644
index 00000000000..195775f74c8
--- /dev/null
+++ b/mysql-test/r/innodb_bug35220.result
@@ -0,0 +1 @@
+SET storage_engine=InnoDB;
diff --git a/mysql-test/t/innodb_bug35220.test b/mysql-test/t/innodb_bug35220.test
new file mode 100644
index 00000000000..26f7d6b1ddd
--- /dev/null
+++ b/mysql-test/t/innodb_bug35220.test
@@ -0,0 +1,16 @@
+#
+# Bug#35220 ALTER TABLE too picky on reserved word "foreign"
+# http://bugs.mysql.com/35220
+#
+
+-- source include/have_innodb.inc
+
+SET storage_engine=InnoDB;
+
+# we care only that the following SQL commands do not produce errors
+-- disable_query_log
+-- disable_result_log
+
+CREATE TABLE bug35220 (foreign_col INT, dummy_cant_delete_all_columns INT);
+ALTER TABLE bug35220 DROP foreign_col;
+DROP TABLE bug35220;

From 9fc39adfda1391892a5604c0b754d07edb3690cd Mon Sep 17 00:00:00 2001
From: Kristofer Pettersson <kpettersson@mysql.com>
Date: Mon, 11 Aug 2008 11:40:54 +0200
Subject: [PATCH 28/33] Bug#38486 Crash when using cursor protocol

Server side cursors were not initialized properly and this caused a reference to
uninitialized memory.
---
 sql/sql_cursor.cc         |  5 ++++-
 tests/mysql_client_test.c | 30 ++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index c2345f1f2cd..16567765ba6 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -111,7 +111,8 @@ class Select_materialize: public select_union
   select_result *result; /* the result object of the caller (PS or SP) */
 public:
   Materialized_cursor *materialized_cursor;
-  Select_materialize(select_result *result_arg) :result(result_arg) {}
+  Select_materialize(select_result *result_arg) :result(result_arg),
+    materialized_cursor(0) {}
   virtual bool send_fields(List<Item> &list, uint flags);
 };
 
@@ -155,6 +156,7 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result,
   if (! (sensitive_cursor= new (thd->mem_root) Sensitive_cursor(thd, result)))
   {
     delete result_materialize;
+    result_materialize= NULL;
     return 1;
   }
 
@@ -212,6 +214,7 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result,
     if ((rc= materialized_cursor->open(0)))
     {
       delete materialized_cursor;
+      materialized_cursor= NULL;
       goto err_open;
     }
 
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 5e1c2afe84a..4336bfa0c59 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -16189,6 +16189,35 @@ static void test_bug32265()
   DBUG_VOID_RETURN;
 }
 
+
+/**
+  Bug#38486 Crash when using cursor protocol
+*/
+
+static void test_bug38486(void)
+{
+    myheader("test_bug38486");
+    
+    MYSQL_STMT *stmt;
+    stmt= mysql_stmt_init(mysql);
+    unsigned long type= CURSOR_TYPE_READ_ONLY;
+    mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
+    const char *sql= "CREATE TABLE t1 (a INT)";
+    mysql_stmt_prepare(stmt,sql,strlen(sql));
+    
+    mysql_stmt_execute(stmt);
+    mysql_stmt_close(stmt);
+    
+    stmt= mysql_stmt_init(mysql);
+    mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
+    const char *sql2= "INSERT INTO t1 VALUES (1)";
+    mysql_stmt_prepare(stmt,sql2,strlen(sql2));
+    mysql_stmt_execute(stmt);
+    
+    mysql_stmt_close(stmt);
+}
+
+
 /*
   Read and parse arguments and MySQL options from my.cnf
 */
@@ -16483,6 +16512,7 @@ static struct my_tests_st my_tests[]= {
   { "test_bug29306", test_bug29306 },
   { "test_bug31669", test_bug31669 },
   { "test_bug32265", test_bug32265 },
+  { "test_bug38486", test_bug38486 },
   { 0, 0 }
 };
 

From bafa07b2c49c1d64e1b58d1df78889ca1a5cda0d Mon Sep 17 00:00:00 2001
From: Davi Arnaut <Davi.Arnaut@Sun.COM>
Date: Mon, 11 Aug 2008 10:08:21 -0300
Subject: [PATCH 29/33] Post-merge fix: Silence warning due to type mismatch.

---
 client/mysql_upgrade.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 15fa6622f74..74e8c9dd577 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -364,7 +364,9 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
   }
   else
   {
-    /* 
+    int len;
+
+    /*
       mysql_upgrade was run absolutely or relatively.  We can find a sibling
       by replacing our name after the LIBCHAR with the new tool name.
     */
@@ -385,10 +387,10 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
       last_fn_libchar -= 6;
     }
 
+    len= last_fn_libchar - self_name;
+
     my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s",
-             (last_fn_libchar - self_name), self_name, 
-             FN_LIBCHAR,
-             tool_name);
+                len, self_name, FN_LIBCHAR, tool_name);
   }
 
   verbose("Looking for '%s' as: %s", tool_name, tool_executable_name);

From fe39a901bb1dd00e389be62979ff3a360ac920b5 Mon Sep 17 00:00:00 2001
From: Chad MILLER <chad@mysql.com>
Date: Mon, 11 Aug 2008 11:28:35 -0400
Subject: [PATCH 30/33] Backport compiler warning fix from 5.1-bugteam.

---
 client/mysql_upgrade.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 15fa6622f74..74e8c9dd577 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -364,7 +364,9 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
   }
   else
   {
-    /* 
+    int len;
+
+    /*
       mysql_upgrade was run absolutely or relatively.  We can find a sibling
       by replacing our name after the LIBCHAR with the new tool name.
     */
@@ -385,10 +387,10 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
       last_fn_libchar -= 6;
     }
 
+    len= last_fn_libchar - self_name;
+
     my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s",
-             (last_fn_libchar - self_name), self_name, 
-             FN_LIBCHAR,
-             tool_name);
+                len, self_name, FN_LIBCHAR, tool_name);
   }
 
   verbose("Looking for '%s' as: %s", tool_name, tool_executable_name);

From 394691cd905de866ef52806d78ac6f9c38016f72 Mon Sep 17 00:00:00 2001
From: Marc Alff <marc.alff@sun.com>
Date: Mon, 11 Aug 2008 10:10:00 -0600
Subject: [PATCH 31/33] Bug#38296 (low memory crash with many conditions in a
 query)

This fix is for 5.0 only : back porting the 6.0 patch manually

The parser code in sql/sql_yacc.yy needs to be more robust to out of
memory conditions, so that when parsing a query fails due to OOM,
the thread gracefully returns an error.

Before this fix, a new/alloc returning NULL could:
- cause a crash, if dereferencing the NULL pointer,
- produce a corrupted parsed tree, containing NULL nodes,
- alter the semantic of a query, by silently dropping token values or nodes

With this fix:
- C++ constructors are *not* executed with a NULL "this" pointer
when operator new fails.
This is achieved by declaring "operator new" with a "throw ()" clause,
so that a failed new gracefully returns NULL on OOM conditions.

- calls to new/alloc are tested for a NULL result,

- The thread diagnostic area is set to an error status when OOM occurs.
This ensures that a request failing in the server properly returns an
ER_OUT_OF_RESOURCES error to the client.

- OOM conditions cause the parser to stop immediately (MYSQL_YYABORT).
This prevents causing further crashes when using a partially built parsed
tree in further rules in the parser.

No test scripts are provided, since automating OOM failures is not
instrumented in the server.
Tested under the debugger, to verify that an error in alloc_root cause the
thread to returns gracefully all the way to the client application, with
an ER_OUT_OF_RESOURCES error.
---
 mysys/my_alloc.c  |    2 +-
 sql/field.h       |    3 +-
 sql/item.h        |    4 +-
 sql/sp_head.cc    |    2 +-
 sql/sql_lex.h     |    4 +-
 sql/sql_list.h    |    4 +-
 sql/sql_string.h  |    2 +-
 sql/sql_yacc.yy   | 1775 ++++++++++++++++++++++++++++++++++++---------
 sql/thr_malloc.cc |   31 +-
 9 files changed, 1483 insertions(+), 344 deletions(-)

diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index 5983a29a3e1..99b5aec7eea 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -202,7 +202,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
     {
       if (mem_root->error_handler)
 	(*mem_root->error_handler)();
-      return((gptr) 0);				/* purecov: inspected */
+      DBUG_RETURN((gptr) 0);			/* purecov: inspected */
     }
     mem_root->block_num++;
     next->next= *prev;
diff --git a/sql/field.h b/sql/field.h
index 8d771a151a7..241ad61f339 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -48,7 +48,8 @@ class Field
   Field(const Item &);				/* Prevent use of these */
   void operator=(Field &);
 public:
-  static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); }
+  static void *operator new(size_t size) throw ()
+  { return (void*) sql_alloc((uint) size); }
   static void operator delete(void *ptr_arg, size_t size) { TRASH(ptr_arg, size); }
 
   char		*ptr;			// Position to field in record
diff --git a/sql/item.h b/sql/item.h
index a948c5a45f7..126730bb892 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -439,9 +439,9 @@ class Item {
   Item(const Item &);			/* Prevent use of these */
   void operator=(Item &);
 public:
-  static void *operator new(size_t size)
+  static void *operator new(size_t size) throw ()
   { return (void*) sql_alloc((uint) size); }
-  static void *operator new(size_t size, MEM_ROOT *mem_root)
+  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
   { return (void*) alloc_root(mem_root, (uint) size); }
   static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); }
   static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 2d920598c46..b1bfab40acd 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -446,7 +446,7 @@ sp_head::operator new(size_t size) throw()
   init_sql_alloc(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC);
   sp= (sp_head *) alloc_root(&own_root, size);
   if (sp == NULL)
-    return NULL;
+    DBUG_RETURN(NULL);
   sp->main_mem_root= own_root;
   DBUG_PRINT("info", ("mem_root 0x%lx", (ulong) &sp->mem_root));
   DBUG_RETURN(sp);
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index df0db2e209d..563172594d2 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -331,11 +331,11 @@ public:
   bool no_table_names_allowed; /* used for global order by */
   bool no_error; /* suppress error message (convert it to warnings) */
 
-  static void *operator new(size_t size)
+  static void *operator new(size_t size) throw ()
   {
     return (void*) sql_alloc((uint) size);
   }
-  static void *operator new(size_t size, MEM_ROOT *mem_root)
+  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
   { return (void*) alloc_root(mem_root, (uint) size); }
   static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); }
   static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
diff --git a/sql/sql_list.h b/sql/sql_list.h
index 7913acfd086..1ad2051f065 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -27,7 +27,7 @@ public:
   {
     return (void*) sql_alloc((uint) size);
   }
-  static void *operator new[](size_t size)
+  static void *operator new[](size_t size) throw ()
   {
     return (void*) sql_alloc((uint) size);
   }
@@ -466,7 +466,7 @@ public:
 struct ilink
 {
   struct ilink **prev,*next;
-  static void *operator new(size_t size)
+  static void *operator new(size_t size) throw ()
   {
     return (void*)my_malloc((uint)size, MYF(MY_WME | MY_FAE));
   }
diff --git a/sql/sql_string.h b/sql/sql_string.h
index c1d27cb1791..4432451464e 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -78,7 +78,7 @@ public:
     Alloced_length=str.Alloced_length; alloced=0; 
     str_charset=str.str_charset;
   }
-  static void *operator new(size_t size, MEM_ROOT *mem_root)
+  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
   { return (void*) alloc_root(mem_root, (uint) size); }
   static void operator delete(void *ptr_arg,size_t size)
   { TRASH(ptr_arg, size); }
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 39851ac66f8..c04eca6bd3f 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1540,6 +1540,8 @@ create:
 	  {
 	    LEX *lex=Lex;
             Key *key= new Key($2, $4.str, $5, 0, lex->col_list);
+            if (key == NULL)
+              MYSQL_YYABORT;
 
             lex->alter_info.key_list.push_back(key);
 	    lex->col_list.empty();
@@ -1599,6 +1601,8 @@ sp_name:
 	      MYSQL_YYABORT;
 	    }
 	    $$= new sp_name($1, $3, true);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    $$->init_qname(YYTHD);
 	  }
 	| ident
@@ -1614,8 +1618,9 @@ sp_name:
             if (lex->copy_db_to(&db.str, &db.length))
               MYSQL_YYABORT;
 	    $$= new sp_name(db, $1, false);
-            if ($$)
-	      $$->init_qname(YYTHD);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+	    $$->init_qname(YYTHD);
 	  }
 	;              
                
@@ -1866,6 +1871,8 @@ sp_decl:
             if (!dflt_value_item)
             {
               dflt_value_item= new Item_null();
+              if (dflt_value_item == NULL)
+                MYSQL_YYABORT;
               /* QQ Set to the var_type with null_value? */
             }
             
@@ -1891,10 +1898,17 @@ sp_decl:
             
               /* The last instruction is responsible for freeing LEX. */
 
-              lex->sphead->add_instr(
-                new sp_instr_set(lex->sphead->instructions(), pctx, var_idx,
-                                 dflt_value_item, var_type, lex,
-                                 (i == num_vars - 1)));
+              sp_instr_set *is= new sp_instr_set(lex->sphead->instructions(),
+                                                 pctx,
+                                                 var_idx,
+                                                 dflt_value_item,
+                                                 var_type,
+                                                 lex,
+                                                 (i == num_vars - 1));
+              if (is == NULL)
+                MYSQL_YYABORT;
+
+              lex->sphead->add_instr(is);
             }
 
             pctx->declare_var_boundary(0);
@@ -1928,6 +1942,8 @@ sp_decl:
 	    sp_instr_hpush_jump *i=
               new sp_instr_hpush_jump(sp->instructions(), ctx, $2,
 	                              ctx->current_var_count());
+            if (i == NULL)
+              MYSQL_YYABORT;
 
 	    sp->add_instr(i);
 	    sp->push_backpatch(i, ctx->push_label((char *)"", 0));
@@ -1980,7 +1996,7 @@ sp_decl:
 	    }
             i= new sp_instr_cpush(sp->instructions(), ctx, $5,
                                   ctx->current_cursor_count());
-	    if ( i==NULL )
+	    if (i == NULL)
               MYSQL_YYABORT;
             sp->add_instr(i);
 	    ctx->push_cursor(&$2);
@@ -2061,6 +2077,8 @@ sp_cond:
 	  ulong_num
 	  {			/* mysql errno */
 	    $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
+            if ($$ == NULL)
+              YYABORT;
 	    $$->type= sp_cond_type_t::number;
 	    $$->mysqlerr= $1;
 	  }
@@ -2072,6 +2090,8 @@ sp_cond:
 	      MYSQL_YYABORT;
 	    }
 	    $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
+            if ($$ == NULL)
+              YYABORT;
 	    $$->type= sp_cond_type_t::state;
 	    memcpy($$->sqlstate, $3.str, 5);
 	    $$->sqlstate[5]= '\0';
@@ -2100,16 +2120,22 @@ sp_hcond:
 	| SQLWARNING_SYM	/* SQLSTATEs 01??? */
 	  {
 	    $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
+            if ($$ == NULL)
+              YYABORT;
 	    $$->type= sp_cond_type_t::warning;
 	  }
 	| not FOUND_SYM		/* SQLSTATEs 02??? */
 	  {
 	    $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
+            if ($$ == NULL)
+              YYABORT;
 	    $$->type= sp_cond_type_t::notfound;
 	  }
 	| SQLEXCEPTION_SYM	/* All other SQLSTATEs */
 	  {
 	    $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t));
+            if ($$ == NULL)
+              YYABORT;
 	    $$->type= sp_cond_type_t::exception;
 	  }
 	;
@@ -3085,6 +3111,8 @@ key_def:
 	  {
 	    LEX *lex=Lex;
             Key *key= new Key($1, $2, $7 ? $7 : $3, 0, lex->col_list);
+            if (key == NULL)
+              MYSQL_YYABORT;
             lex->alter_info.key_list.push_back(key);
 
 	    lex->col_list.empty();		/* Alloced by sql_alloc */
@@ -3094,6 +3122,8 @@ key_def:
 	    LEX *lex=Lex;
 	    const char *key_name= $3 ? $3:$1;
             Key *key= new Key($2, key_name, $4, 0, lex->col_list);
+            if (key == NULL)
+              MYSQL_YYABORT;
             lex->alter_info.key_list.push_back(key);
 	    lex->col_list.empty();		/* Alloced by sql_alloc */
 	  }
@@ -3107,10 +3137,14 @@ key_def:
                                       lex->fk_delete_opt,
                                       lex->fk_update_opt,
                                       lex->fk_match_option);
+            if (key == NULL)
+              MYSQL_YYABORT;
             lex->alter_info.key_list.push_back(key);
             key= new Key(Key::MULTIPLE, key_name,
                          HA_KEY_ALG_UNDEF, 1,
                          lex->col_list);
+            if (key == NULL)
+              MYSQL_YYABORT;
             lex->alter_info.key_list.push_back(key);
 	    lex->col_list.empty();		/* Alloced by sql_alloc */
 	  }
@@ -3400,7 +3434,12 @@ attribute:
 	;
 
 now_or_signed_literal:
-        NOW_SYM optional_braces { $$= new Item_func_now_local(); }
+        NOW_SYM optional_braces
+          {
+            $$= new Item_func_now_local();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | signed_literal { $$=$1; }
         ;
 
@@ -3526,8 +3565,21 @@ opt_ref_list:
 	| '(' ref_list ')' opt_on_delete {};
 
 ref_list:
-	ref_list ',' ident	{ Lex->ref_list.push_back(new key_part_spec($3.str)); }
-	| ident			{ Lex->ref_list.push_back(new key_part_spec($1.str)); };
+          ref_list ',' ident
+          {
+            key_part_spec *key= new key_part_spec($3.str);
+            if (key == NULL)
+              MYSQL_YYABORT;
+            Lex->ref_list.push_back(key);
+          }
+        | ident
+          {
+            key_part_spec *key= new key_part_spec($1.str);
+            if (key == NULL)
+              MYSQL_YYABORT;
+            Lex->ref_list.push_back(key);
+          }
+        ;
 
 
 opt_on_delete:
@@ -3618,16 +3670,24 @@ key_list:
 	| key_part order_dir		{ Lex->col_list.push_back($1); };
 
 key_part:
-	ident			{ $$=new key_part_spec($1.str); }
-	| ident '(' NUM ')'	
-        {
-          int key_part_len= atoi($3.str);
-          if (!key_part_len)
+          ident
           {
-            my_error(ER_KEY_PART_0, MYF(0), $1.str);
+            $$= new key_part_spec($1.str);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
-          $$=new key_part_spec($1.str,(uint) key_part_len);
-        };
+	| ident '(' NUM ')'
+          {
+            int key_part_len= atoi($3.str);
+            if (!key_part_len)
+            {
+              my_error(ER_KEY_PART_0, MYF(0), $1.str);
+            }
+            $$=new key_part_spec($1.str,(uint) key_part_len);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+        ;
 
 opt_ident:
 	/* empty */	{ $$=(char*) 0; }	/* Defaultlength */
@@ -3797,8 +3857,10 @@ alter_list_item:
 	| DROP opt_column field_ident opt_restrict
 	  {
 	    LEX *lex=Lex;
-	    lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN,
-                                                               $3.str));
+            Alter_drop *ad= new Alter_drop(Alter_drop::COLUMN, $3.str);
+            if (ad == NULL)
+              MYSQL_YYABORT;
+	    lex->alter_info.drop_list.push_back(ad);
 	    lex->alter_info.flags|= ALTER_DROP_COLUMN;
 	  }
 	| DROP FOREIGN KEY_SYM opt_ident
@@ -3808,15 +3870,19 @@ alter_list_item:
 	| DROP PRIMARY_SYM KEY_SYM
 	  {
 	    LEX *lex=Lex;
-	    lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
-				               primary_key_name));
+            Alter_drop *ad= new Alter_drop(Alter_drop::KEY, primary_key_name);
+            if (ad == NULL)
+              MYSQL_YYABORT;
+	    lex->alter_info.drop_list.push_back(ad);
 	    lex->alter_info.flags|= ALTER_DROP_INDEX;
 	  }
 	| DROP key_or_index field_ident
 	  {
 	    LEX *lex=Lex;
-	    lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
-					                       $3.str));
+            Alter_drop *ad= new Alter_drop(Alter_drop::KEY, $3.str);
+            if (ad == NULL)
+              MYSQL_YYABORT;
+	    lex->alter_info.drop_list.push_back(ad);
 	    lex->alter_info.flags|= ALTER_DROP_INDEX;
 	  }
 	| DISABLE_SYM KEYS
@@ -3834,14 +3900,19 @@ alter_list_item:
 	| ALTER opt_column field_ident SET DEFAULT signed_literal
 	  {
 	    LEX *lex=Lex;
-	    lex->alter_info.alter_list.push_back(new Alter_column($3.str,$6));
+            Alter_column *ac= new Alter_column($3.str, $6);
+            if (ac == NULL)
+              MYSQL_YYABORT;
+	    lex->alter_info.alter_list.push_back(ac);
 	    lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT;
 	  }
 	| ALTER opt_column field_ident DROP DEFAULT
 	  {
 	    LEX *lex=Lex;
-	    lex->alter_info.alter_list.push_back(new Alter_column($3.str,
-                                                                  (Item*) 0));
+            Alter_column *ac= new Alter_column($3.str, (Item*) 0);
+            if (ac == NULL)
+              MYSQL_YYABORT;
+	    lex->alter_info.alter_list.push_back(ac);
 	    lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT;
 	  }
 	| RENAME opt_to table_ident
@@ -4467,10 +4538,11 @@ select_item_list:
 	| '*'
 	  {
 	    THD *thd= YYTHD;
-	    if (add_item_to_list(thd,
-                                 new Item_field(&thd->lex->current_select->
-                                                context,
-                                                NULL, NULL, "*")))
+            Item *item= new Item_field(&thd->lex->current_select->context,
+                                       NULL, NULL, "*");
+            if (item == NULL)
+              MYSQL_YYABORT;
+	    if (add_item_to_list(thd, item))
 	      MYSQL_YYABORT;
 	    (thd->lex->current_select->with_wild)++;
 	  };
@@ -4577,12 +4649,16 @@ expr:
             {
               /* X OR Y */
               $$ = new (YYTHD->mem_root) Item_cond_or($1, $3);
+              if ($$ == NULL)
+                MYSQL_YYABORT;
             }
           }
         | expr XOR expr %prec XOR
           {
             /* XOR is a proprietary extension */
             $$ = new (YYTHD->mem_root) Item_cond_xor($1, $3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
         | expr and expr %prec AND_SYM
           {
@@ -4623,62 +4699,124 @@ expr:
             {
               /* X AND Y */
               $$ = new (YYTHD->mem_root) Item_cond_and($1, $3);
+              if ($$ == NULL)
+                MYSQL_YYABORT;
             }
           }
 	| NOT_SYM expr %prec NOT_SYM
-          { $$= negate_expression(YYTHD, $2); }
+          {
+            $$= negate_expression(YYTHD, $2);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bool_pri IS TRUE_SYM %prec IS
-          { $$= new (YYTHD->mem_root) Item_func_istrue($1); }
+          {
+            $$= new (YYTHD->mem_root) Item_func_istrue($1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bool_pri IS not TRUE_SYM %prec IS
-          { $$= new (YYTHD->mem_root) Item_func_isnottrue($1); }
+          {
+            $$= new (YYTHD->mem_root) Item_func_isnottrue($1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bool_pri IS FALSE_SYM %prec IS
-          { $$= new (YYTHD->mem_root) Item_func_isfalse($1); }
+          {
+            $$= new (YYTHD->mem_root) Item_func_isfalse($1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bool_pri IS not FALSE_SYM %prec IS
-          { $$= new (YYTHD->mem_root) Item_func_isnotfalse($1); }
+          {
+            $$= new (YYTHD->mem_root) Item_func_isnotfalse($1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bool_pri IS UNKNOWN_SYM %prec IS
-          { $$= new Item_func_isnull($1); }
+          {
+            $$= new Item_func_isnull($1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bool_pri IS not UNKNOWN_SYM %prec IS
-          { $$= new Item_func_isnotnull($1); }
+          {
+            $$= new Item_func_isnotnull($1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bool_pri
         ;
 
 bool_pri:
 	bool_pri IS NULL_SYM %prec IS
-          { $$= new Item_func_isnull($1); }
+          {
+            $$= new Item_func_isnull($1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| bool_pri IS not NULL_SYM %prec IS
-          { $$= new Item_func_isnotnull($1); }
+          {
+            $$= new Item_func_isnotnull($1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| bool_pri EQUAL_SYM predicate %prec EQUAL_SYM
-          { $$= new Item_func_equal($1,$3); }
+          {
+            $$= new Item_func_equal($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| bool_pri comp_op predicate %prec EQ
-	  { $$= (*$2)(0)->create($1,$3); }
+	  {
+            $$= (*$2)(0)->create($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| bool_pri comp_op all_or_any '(' subselect ')' %prec EQ
-	  { $$= all_any_subquery_creator($1, $2, $3, $5); }
+	  {
+            $$= all_any_subquery_creator($1, $2, $3, $5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| predicate ;
 
 predicate:
           bit_expr IN_SYM '(' subselect ')'
           {
             $$= new (YYTHD->mem_root) Item_in_subselect($1, $4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
         | bit_expr not IN_SYM '(' subselect ')'
           {
             THD *thd= YYTHD;
             Item *item= new (thd->mem_root) Item_in_subselect($1, $5);
+            if (item == NULL)
+              MYSQL_YYABORT;
             $$= negate_expression(thd, item);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
         | bit_expr IN_SYM '(' expr ')'
           {
             $$= handle_sql2003_note184_exception(YYTHD, $1, true, $4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
         | bit_expr IN_SYM '(' expr ',' expr_list ')'
           { 
             $6->push_front($4);
             $6->push_front($1);
             $$= new (YYTHD->mem_root) Item_func_in(*$6);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
         | bit_expr not IN_SYM '(' expr ')'
           {
             $$= handle_sql2003_note184_exception(YYTHD, $1, false, $5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
         | bit_expr not IN_SYM '(' expr ',' expr_list ')'
           {
@@ -4691,54 +4829,146 @@ predicate:
             $$= item;
           }
 	| bit_expr BETWEEN_SYM bit_expr AND_SYM predicate
-	  { $$= new Item_func_between($1,$3,$5); }
+	  {
+            $$= new Item_func_between($1,$3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| bit_expr not BETWEEN_SYM bit_expr AND_SYM predicate
           {
             Item_func_between *item= new Item_func_between($1,$4,$6);
+            if (item == NULL)
+              MYSQL_YYABORT;
             item->negate();
             $$= item;
           }
 	| bit_expr SOUNDS_SYM LIKE bit_expr
-	  { $$= new Item_func_eq(new Item_func_soundex($1),
-				 new Item_func_soundex($4)); }
+	  {
+            Item *item1= new Item_func_soundex($1);
+            Item *item4= new Item_func_soundex($4);
+            if ((item1 == NULL) || (item4 == NULL))
+              MYSQL_YYABORT;
+            $$= new Item_func_eq(item1, item4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| bit_expr LIKE simple_expr opt_escape
-          { $$= new Item_func_like($1,$3,$4,Lex->escape_used); }
+          {
+            $$= new Item_func_like($1,$3,$4,Lex->escape_used);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| bit_expr not LIKE simple_expr opt_escape
-          { $$= new Item_func_not(new Item_func_like($1,$4,$5, Lex->escape_used)); }
-	| bit_expr REGEXP bit_expr	{ $$= new Item_func_regex($1,$3); }
+          {
+            Item *item= new Item_func_like($1,$4,$5, Lex->escape_used);
+            if (item == NULL)
+              MYSQL_YYABORT;
+            $$= new Item_func_not(item);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| bit_expr REGEXP bit_expr
+          {
+            $$= new Item_func_regex($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| bit_expr not REGEXP bit_expr
-          { $$= negate_expression(YYTHD, new Item_func_regex($1,$4)); }
+          {
+            Item *item= new Item_func_regex($1,$4);
+            if (item == NULL)
+              MYSQL_YYABORT;
+            $$= negate_expression(YYTHD, item);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| bit_expr ;
 
 bit_expr:
           bit_expr '|' bit_expr %prec '|'
-          { $$= new Item_func_bit_or($1,$3); }
+          {
+            $$= new Item_func_bit_or($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr '&' bit_expr %prec '&'
-          { $$= new Item_func_bit_and($1,$3); }
+          {
+            $$= new Item_func_bit_and($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr SHIFT_LEFT bit_expr %prec SHIFT_LEFT
-          { $$= new Item_func_shift_left($1,$3); }
+          {
+            $$= new Item_func_shift_left($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr SHIFT_RIGHT bit_expr %prec SHIFT_RIGHT
-          { $$= new Item_func_shift_right($1,$3); }
+          {
+            $$= new Item_func_shift_right($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr '+' bit_expr %prec '+'
-          { $$= new Item_func_plus($1,$3); }
+          {
+            $$= new Item_func_plus($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr '-' bit_expr %prec '-'
-          { $$= new Item_func_minus($1,$3); }
+          {
+            $$= new Item_func_minus($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr '+' interval_expr interval %prec '+'
-          { $$= new Item_date_add_interval($1,$3,$4,0); }
+          {
+            $$= new Item_date_add_interval($1,$3,$4,0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr '-' interval_expr interval %prec '-'
-          { $$= new Item_date_add_interval($1,$3,$4,1); }
+          {
+            $$= new Item_date_add_interval($1,$3,$4,1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr '*' bit_expr %prec '*'
-          { $$= new Item_func_mul($1,$3); }
+          {
+            $$= new Item_func_mul($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr '/' bit_expr %prec '/'
-          { $$= new Item_func_div($1,$3); }
+          {
+            $$= new Item_func_div($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr '%' bit_expr %prec '%'
-          { $$= new Item_func_mod($1,$3); }
+          {
+            $$= new Item_func_mod($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr DIV_SYM bit_expr %prec DIV_SYM
-          { $$= new Item_func_int_div($1,$3); }
+          {
+            $$= new Item_func_int_div($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr MOD_SYM bit_expr %prec MOD_SYM
-          { $$= new Item_func_mod($1,$3); }
+          {
+            $$= new Item_func_mod($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | bit_expr '^' bit_expr
-          { $$= new Item_func_bit_xor($1,$3); }
+          {
+            $$= new Item_func_bit_xor($1,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | simple_expr
         ;
 
@@ -4768,67 +4998,118 @@ simple_expr:
 	simple_ident
  	| simple_expr COLLATE_SYM ident_or_text %prec NEG
 	  {
-	    $$= new Item_func_set_collation($1,
-					    new Item_string($3.str,
-							    $3.length,
-                                                            YYTHD->charset()));
+            Item *item= new Item_string($3.str, $3.length, YYTHD->charset());
+            if (item == NULL)
+              MYSQL_YYABORT;
+	    $$= new Item_func_set_collation($1, item);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| literal
 	| param_marker
 	| variable
 	| sum_expr
 	| simple_expr OR_OR_SYM simple_expr
-	  { $$= new Item_func_concat($1, $3); }
-	| '+' simple_expr %prec NEG	{ $$= $2; }
-	| '-' simple_expr %prec NEG	{ $$= new Item_func_neg($2); }
-	| '~' simple_expr %prec NEG	{ $$= new Item_func_bit_neg($2); }
-	| not2 simple_expr %prec NEG	{ $$= negate_expression(YYTHD, $2); }
+	  {
+            $$= new Item_func_concat($1, $3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| '+' simple_expr %prec NEG
+          { $$= $2; }
+	| '-' simple_expr %prec NEG
+          {
+            $$= new Item_func_neg($2);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| '~' simple_expr %prec NEG
+          {
+            $$= new Item_func_bit_neg($2);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| not2 simple_expr %prec NEG
+          {
+            $$= negate_expression(YYTHD, $2);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| '(' subselect ')'   
           { 
             $$= new Item_singlerow_subselect($2); 
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
 	| '(' expr ')'		{ $$= $2; }
 	| '(' expr ',' expr_list ')'
 	  {
 	    $4->push_front($2);
 	    $$= new Item_row(*$4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| ROW_SYM '(' expr ',' expr_list ')'
 	  {
 	    $5->push_front($3);
 	    $$= new Item_row(*$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| EXISTS '(' subselect ')' 
           {
             $$= new Item_exists_subselect($3); 
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
-	| '{' ident expr '}'	{ $$= $3; }
+	| '{' ident expr '}'
+          { $$= $3; }
         | MATCH ident_list_arg AGAINST '(' bit_expr fulltext_options ')'
-          { $2->push_front($5);
-            Select->add_ftfunc_to_list((Item_func_match*)
-                                        ($$=new Item_func_match(*$2,$6))); }
-	| ASCII_SYM '(' expr ')' { $$= new Item_func_ascii($3); }
+          {
+            $2->push_front($5);
+            Item_func_match *item= new Item_func_match(*$2,$6);
+            if (item == NULL)
+              MYSQL_YYABORT;
+            Select->add_ftfunc_to_list(item);
+            $$= item;
+          }
+	| ASCII_SYM '(' expr ')'
+          {
+            $$= new Item_func_ascii($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| BINARY simple_expr %prec NEG
 	  {
             $$= create_func_cast($2, ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| CAST_SYM '(' expr AS cast_type ')'
 	  {
             LEX *lex= Lex;
 	    $$= create_func_cast($3, $5, lex->length, lex->dec, lex->charset);
-            if (!$$)
+            if ($$ == NULL)
               MYSQL_YYABORT;
 	  }
 	| CASE_SYM opt_expr when_list opt_else END
-	  { $$= new Item_func_case(* $3, $2, $4 ); }
+	  {
+            $$= new Item_func_case(* $3, $2, $4 );
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| CONVERT_SYM '(' expr ',' cast_type ')'
 	  {
 	    $$= create_func_cast($3, $5, Lex->length, Lex->dec, Lex->charset);
-            if (!$$)
+            if ($$ == NULL)
               MYSQL_YYABORT;
 	  }
 	| CONVERT_SYM '(' expr USING charset_name ')'
-	  { $$= new Item_func_conv_charset($3,$5); }
+	  {
+            $$= new Item_func_conv_charset($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| DEFAULT '(' simple_ident ')'
 	  {
 	    if ($3->is_splocal())
@@ -4839,9 +5120,15 @@ simple_expr:
 	      MYSQL_YYABORT;
 	    }
 	    $$= new Item_default_value(Lex->current_context(), $3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| VALUES '(' simple_ident_nospvar ')'
-	  { $$= new Item_insert_value(Lex->current_context(), $3); }
+	  {
+            $$= new Item_insert_value(Lex->current_context(), $3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| FUNC_ARG0 '(' ')'
 	  {
 	    if (!$1.symbol->create_func)
@@ -4852,6 +5139,8 @@ simple_expr:
 	      MYSQL_YYABORT;
 	    }
 	    $$= ((Item*(*)(void))($1.symbol->create_func))();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| FUNC_ARG1 '(' expr ')'
 	  {
@@ -4863,6 +5152,8 @@ simple_expr:
 	      MYSQL_YYABORT;
 	    }
 	    $$= ((Item*(*)(Item*))($1.symbol->create_func))($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| FUNC_ARG2 '(' expr ',' expr ')'
 	  {
@@ -4874,6 +5165,8 @@ simple_expr:
 	      MYSQL_YYABORT;
 	    }
 	    $$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| FUNC_ARG3 '(' expr ',' expr ',' expr ')'
 	  {
@@ -4885,106 +5178,264 @@ simple_expr:
 	      MYSQL_YYABORT;
 	    }
 	    $$= ((Item*(*)(Item*,Item*,Item*))($1.symbol->create_func))($3,$5,$7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| ADDDATE_SYM '(' expr ',' expr ')'
-	  { $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 0);}
+	  {
+            $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| ADDDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')'
-	  { $$= new Item_date_add_interval($3, $6, $7, 0); }
+	  {
+            $$= new Item_date_add_interval($3, $6, $7, 0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| REPEAT_SYM '(' expr ',' expr ')'
-	  { $$= new Item_func_repeat($3,$5); }
+	  {
+            $$= new Item_func_repeat($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| ATAN	'(' expr ')'
-	  { $$= new Item_func_atan($3); }
+	  {
+            $$= new Item_func_atan($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| ATAN	'(' expr ',' expr ')'
-	  { $$= new Item_func_atan($3,$5); }
+	  {
+            $$= new Item_func_atan($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| CHAR_SYM '(' expr_list ')'
-	  { $$= new Item_func_char(*$3); }
+	  {
+            $$= new Item_func_char(*$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| CHAR_SYM '(' expr_list USING charset_name ')'
-	  { $$= new Item_func_char(*$3, $5); }
+	  {
+            $$= new Item_func_char(*$3, $5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| CHARSET '(' expr ')'
-	  { $$= new Item_func_charset($3); }
+	  {
+            $$= new Item_func_charset($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| COALESCE '(' expr_list ')'
-	  { $$= new Item_func_coalesce(* $3); }
+	  {
+            $$= new Item_func_coalesce(* $3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| COLLATION_SYM '(' expr ')'
-	  { $$= new Item_func_collation($3); }
+	  {
+            $$= new Item_func_collation($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| CONCAT '(' expr_list ')'
-	  { $$= new Item_func_concat(* $3); }
+	  {
+            $$= new Item_func_concat(* $3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| CONCAT_WS '(' expr ',' expr_list ')'
-	  { $5->push_front($3); $$= new Item_func_concat_ws(*$5); }
+	  {
+            $5->push_front($3);
+            $$= new Item_func_concat_ws(*$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| CONVERT_TZ_SYM '(' expr ',' expr ',' expr ')'
 	  {
             if (Lex->add_time_zone_tables_to_query_tables(YYTHD))
               MYSQL_YYABORT;
 	    $$= new Item_func_convert_tz($3, $5, $7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| CURDATE optional_braces
-	  { $$= new Item_func_curdate_local(); Lex->safe_to_cache_query=0; }
+	  {
+            $$= new Item_func_curdate_local();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+            Lex->safe_to_cache_query=0;
+          }
 	| CURTIME optional_braces
-	  { $$= new Item_func_curtime_local(); Lex->safe_to_cache_query=0; }
+	  {
+            $$= new Item_func_curtime_local();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+            Lex->safe_to_cache_query=0;
+          }
 	| CURTIME '(' expr ')'
 	  {
 	    $$= new Item_func_curtime_local($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    Lex->safe_to_cache_query=0;
 	  }
 	| CURRENT_USER optional_braces
           {
             $$= new Item_func_current_user(Lex->current_context());
+            if ($$ == NULL)
+              MYSQL_YYABORT;
             Lex->safe_to_cache_query= 0;
           }
 	| DATE_ADD_INTERVAL '(' expr ',' interval_expr interval ')'
-	  { $$= new Item_date_add_interval($3,$5,$6,0); }
+	  {
+            $$= new Item_date_add_interval($3,$5,$6,0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| DATE_SUB_INTERVAL '(' expr ',' interval_expr interval ')'
-	  { $$= new Item_date_add_interval($3,$5,$6,1); }
+	  {
+            $$= new Item_date_add_interval($3,$5,$6,1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| DATABASE '(' ')'
 	  {
 	    $$= new Item_func_database();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
             Lex->safe_to_cache_query=0;
 	  }
 	| DATE_SYM '(' expr ')'
-	  { $$= new Item_date_typecast($3); }
+	  {
+            $$= new Item_date_typecast($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| DAY_SYM '(' expr ')'
-	  { $$= new Item_func_dayofmonth($3); }
+	  {
+            $$= new Item_func_dayofmonth($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| ELT_FUNC '(' expr ',' expr_list ')'
-	  { $5->push_front($3); $$= new Item_func_elt(*$5); }
+	  {
+            $5->push_front($3);
+            $$= new Item_func_elt(*$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| MAKE_SET_SYM '(' expr ',' expr_list ')'
-	  { $$= new Item_func_make_set($3, *$5); }
+	  {
+            $$= new Item_func_make_set($3, *$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| ENCRYPT '(' expr ')'
 	  {
 	    $$= new Item_func_encrypt($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    Lex->uncacheable(UNCACHEABLE_RAND);
 	  }
-	| ENCRYPT '(' expr ',' expr ')'   { $$= new Item_func_encrypt($3,$5); }
+	| ENCRYPT '(' expr ',' expr ')'
+          {
+            $$= new Item_func_encrypt($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| DECODE_SYM '(' expr ',' TEXT_STRING_literal ')'
-	  { $$= new Item_func_decode($3,$5.str); }
+	  {
+            $$= new Item_func_decode($3,$5.str);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| ENCODE_SYM '(' expr ',' TEXT_STRING_literal ')'
-	 { $$= new Item_func_encode($3,$5.str); }
+	  {
+            $$= new Item_func_encode($3,$5.str);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| DES_DECRYPT_SYM '(' expr ')'
-        { $$= new Item_func_des_decrypt($3); }
+          {
+            $$= new Item_func_des_decrypt($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| DES_DECRYPT_SYM '(' expr ',' expr ')'
-        { $$= new Item_func_des_decrypt($3,$5); }
+          {
+            $$= new Item_func_des_decrypt($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| DES_ENCRYPT_SYM '(' expr ')'
-        { $$= new Item_func_des_encrypt($3); }
+          {
+            $$= new Item_func_des_encrypt($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| DES_ENCRYPT_SYM '(' expr ',' expr ')'
-        { $$= new Item_func_des_encrypt($3,$5); }
+          {
+            $$= new Item_func_des_encrypt($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| EXPORT_SET '(' expr ',' expr ',' expr ')'
-		{ $$= new Item_func_export_set($3, $5, $7); }
+          {
+            $$= new Item_func_export_set($3, $5, $7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| EXPORT_SET '(' expr ',' expr ',' expr ',' expr ')'
-		{ $$= new Item_func_export_set($3, $5, $7, $9); }
+          {
+            $$= new Item_func_export_set($3, $5, $7, $9);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| EXPORT_SET '(' expr ',' expr ',' expr ',' expr ',' expr ')'
-		{ $$= new Item_func_export_set($3, $5, $7, $9, $11); }
+          {
+            $$= new Item_func_export_set($3, $5, $7, $9, $11);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| FORMAT_SYM '(' expr ',' NUM ')'
-	  { $$= new Item_func_format($3,atoi($5.str)); }
+	  {
+            $$= new Item_func_format($3,atoi($5.str));
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| FROM_UNIXTIME '(' expr ')'
-	  { $$= new Item_func_from_unixtime($3); }
+	  {
+            $$= new Item_func_from_unixtime($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| FROM_UNIXTIME '(' expr ',' expr ')'
 	  {
-	    $$= new Item_func_date_format (new Item_func_from_unixtime($3),$5,0);
+            Item *item= new Item_func_from_unixtime($3);
+            if (item == NULL)
+              MYSQL_YYABORT;
+	    $$= new Item_func_date_format (item, $5, 0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| FIELD_FUNC '(' expr ',' expr_list ')'
-	  { $5->push_front($3); $$= new Item_func_field(*$5); }
+	  {
+            $5->push_front($3);
+            $$= new Item_func_field(*$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| geometry_function
 	  {
 #ifdef HAVE_SPATIAL
 	    $$= $1;
+            /* $1 may be NULL, GEOM_NEW not tested for out of memory */
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 #else
 	    my_error(ER_FEATURE_DISABLED, MYF(0),
                      sym_group_geom.name, sym_group_geom.needed_define);
@@ -4992,16 +5443,36 @@ simple_expr:
 #endif
 	  }
 	| GET_FORMAT '(' date_time_type  ',' expr ')'
-	  { $$= new Item_func_get_format($3, $5); }
+	  {
+            $$= new Item_func_get_format($3, $5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| HOUR_SYM '(' expr ')'
-	  { $$= new Item_func_hour($3); }
+	  {
+            $$= new Item_func_hour($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| IF '(' expr ',' expr ',' expr ')'
-	  { $$= new Item_func_if($3,$5,$7); }
+	  {
+            $$= new Item_func_if($3,$5,$7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| INSERT '(' expr ',' expr ',' expr ',' expr ')'
-	  { $$= new Item_func_insert($3,$5,$7,$9); }
+	  {
+            $$= new Item_func_insert($3,$5,$7,$9);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| interval_expr interval '+' expr
 	  /* we cannot put interval before - */
-	  { $$= new Item_date_add_interval($4,$1,$2,0); }
+	  {
+            $$= new Item_date_add_interval($4,$1,$2,0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| interval_expr
 	  {
             if ($1->type() != Item::ROW_ITEM)
@@ -5010,102 +5481,248 @@ simple_expr:
               MYSQL_YYABORT;
             }
             $$= new Item_func_interval((Item_row *)$1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
 	| LAST_INSERT_ID '(' ')'
 	  {
 	    $$= new Item_func_last_insert_id();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    Lex->safe_to_cache_query= 0;
 	  }
 	| LAST_INSERT_ID '(' expr ')'
 	  {
 	    $$= new Item_func_last_insert_id($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    Lex->safe_to_cache_query= 0;
 	  }
 	| LEFT '(' expr ',' expr ')'
-	  { $$= new Item_func_left($3,$5); }
+	  {
+            $$= new Item_func_left($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| LOCATE '(' expr ',' expr ')'
-	  { $$= new Item_func_locate($5,$3); }
+	  {
+            $$= new Item_func_locate($5,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| LOCATE '(' expr ',' expr ',' expr ')'
-	  { $$= new Item_func_locate($5,$3,$7); }
+	  {
+            $$= new Item_func_locate($5,$3,$7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| GREATEST_SYM '(' expr ',' expr_list ')'
-	  { $5->push_front($3); $$= new Item_func_max(*$5); }
+	  {
+            $5->push_front($3);
+            $$= new Item_func_max(*$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| LEAST_SYM '(' expr ',' expr_list ')'
-	  { $5->push_front($3); $$= new Item_func_min(*$5); }
+	  {
+            $5->push_front($3);
+            $$= new Item_func_min(*$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| LOG_SYM '(' expr ')'
-	  { $$= new Item_func_log($3); }
+	  {
+            $$= new Item_func_log($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| LOG_SYM '(' expr ',' expr ')'
-	  { $$= new Item_func_log($3, $5); }
+	  {
+            $$= new Item_func_log($3, $5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| MASTER_POS_WAIT '(' expr ',' expr ')'
 	  {
 	    $$= new Item_master_pos_wait($3, $5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    Lex->safe_to_cache_query=0;
-		  }
+          }
 	| MASTER_POS_WAIT '(' expr ',' expr ',' expr ')'
 	  {
 	    $$= new Item_master_pos_wait($3, $5, $7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    Lex->safe_to_cache_query=0;
 	  }
 	| MICROSECOND_SYM '(' expr ')'
-	  { $$= new Item_func_microsecond($3); }
+	  {
+            $$= new Item_func_microsecond($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| MINUTE_SYM '(' expr ')'
-	  { $$= new Item_func_minute($3); }
+	  {
+            $$= new Item_func_minute($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| MOD_SYM '(' expr ',' expr ')'
-	  { $$ = new Item_func_mod( $3, $5); }
+	  {
+            $$= new Item_func_mod( $3, $5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| MONTH_SYM '(' expr ')'
-	  { $$= new Item_func_month($3); }
+	  {
+            $$= new Item_func_month($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| NOW_SYM optional_braces
-	  { $$= new Item_func_now_local(); Lex->safe_to_cache_query=0;}
+	  {
+            $$= new Item_func_now_local();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+            Lex->safe_to_cache_query=0;
+          }
 	| NOW_SYM '(' expr ')'
-	  { $$= new Item_func_now_local($3); Lex->safe_to_cache_query=0;}
+	  {
+            $$= new Item_func_now_local($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+            Lex->safe_to_cache_query=0;
+          }
 	| PASSWORD '(' expr ')'
 	  {
 	    $$= YYTHD->variables.old_passwords ?
               (Item *) new Item_func_old_password($3) :
 	      (Item *) new Item_func_password($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| OLD_PASSWORD '(' expr ')'
-	  { $$=  new Item_func_old_password($3); }
+	  {
+            $$= new Item_func_old_password($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| POSITION_SYM '(' bit_expr IN_SYM expr ')'
-	  { $$ = new Item_func_locate($5,$3); }
+	  {
+            $$= new Item_func_locate($5,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| QUARTER_SYM '(' expr ')'
-	  { $$ = new Item_func_quarter($3); }
+	  {
+            $$= new Item_func_quarter($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| RAND '(' expr ')'
-	  { $$= new Item_func_rand($3); Lex->uncacheable(UNCACHEABLE_RAND);}
+	  {
+            $$= new Item_func_rand($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+            Lex->uncacheable(UNCACHEABLE_RAND);
+          }
 	| RAND '(' ')'
-	  { $$= new Item_func_rand(); Lex->uncacheable(UNCACHEABLE_RAND);}
+	  {
+            $$= new Item_func_rand();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+            Lex->uncacheable(UNCACHEABLE_RAND);
+          }
 	| REPLACE '(' expr ',' expr ',' expr ')'
-	  { $$= new Item_func_replace($3,$5,$7); }
+	  {
+            $$= new Item_func_replace($3,$5,$7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| RIGHT '(' expr ',' expr ')'
-	  { $$= new Item_func_right($3,$5); }
+	  {
+            $$= new Item_func_right($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| ROUND '(' expr ')'
-	  { $$= new Item_func_round($3, new Item_int((char*)"0",0,1),0); }
-	| ROUND '(' expr ',' expr ')' { $$= new Item_func_round($3,$5,0); }
+	  {
+            Item *item= new Item_int((char*)"0",0,1);
+            if (item == NULL)
+              MYSQL_YYABORT;
+            $$= new Item_func_round($3, item, 0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| ROUND '(' expr ',' expr ')'
+          {
+            $$= new Item_func_round($3,$5,0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| ROW_COUNT_SYM '(' ')'
 	  {
 	    $$= new Item_func_row_count();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    Lex->safe_to_cache_query= 0;
 	  }
 	| SUBDATE_SYM '(' expr ',' expr ')'
-	  { $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 1);}
+	  {
+            $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| SUBDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')'
-	  { $$= new Item_date_add_interval($3, $6, $7, 1); }
+	  {
+            $$= new Item_date_add_interval($3, $6, $7, 1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| SECOND_SYM '(' expr ')'
-	  { $$= new Item_func_second($3); }
+	  {
+            $$= new Item_func_second($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| SUBSTRING '(' expr ',' expr ',' expr ')'
-	  { $$= new Item_func_substr($3,$5,$7); }
+	  {
+            $$= new Item_func_substr($3,$5,$7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| SUBSTRING '(' expr ',' expr ')'
-	  { $$= new Item_func_substr($3,$5); }
+	  {
+            $$= new Item_func_substr($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| SUBSTRING '(' expr FROM expr FOR_SYM expr ')'
-	  { $$= new Item_func_substr($3,$5,$7); }
+	  {
+            $$= new Item_func_substr($3,$5,$7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| SUBSTRING '(' expr FROM expr ')'
-	  { $$= new Item_func_substr($3,$5); }
+	  {
+            $$= new Item_func_substr($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| SUBSTRING_INDEX '(' expr ',' expr ',' expr ')'
-	  { $$= new Item_func_substr_index($3,$5,$7); }
+	  {
+            $$= new Item_func_substr_index($3,$5,$7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| SYSDATE optional_braces
           {
             if (global_system_variables.sysdate_is_now == 0)
               $$= new Item_func_sysdate_local();
             else $$= new Item_func_now_local();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
             Lex->safe_to_cache_query=0;
           }
 	| SYSDATE '(' expr ')'
@@ -5113,36 +5730,94 @@ simple_expr:
             if (global_system_variables.sysdate_is_now == 0)
               $$= new Item_func_sysdate_local($3);
             else $$= new Item_func_now_local($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
             Lex->safe_to_cache_query=0;
           }
 	| TIME_SYM '(' expr ')'
-	  { $$= new Item_time_typecast($3); }
+	  {
+            $$= new Item_time_typecast($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TIMESTAMP '(' expr ')'
-	  { $$= new Item_datetime_typecast($3); }
+	  {
+            $$= new Item_datetime_typecast($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TIMESTAMP '(' expr ',' expr ')'
-	  { $$= new Item_func_add_time($3, $5, 1, 0); }
+	  {
+            $$= new Item_func_add_time($3, $5, 1, 0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TIMESTAMP_ADD '(' interval_time_stamp ',' expr ',' expr ')'
-	  { $$= new Item_date_add_interval($7,$5,$3,0); }
+	  {
+            $$= new Item_date_add_interval($7,$5,$3,0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TIMESTAMP_DIFF '(' interval_time_stamp ',' expr ',' expr ')'
-	  { $$= new Item_func_timestamp_diff($5,$7,$3); }
+	  {
+            $$= new Item_func_timestamp_diff($5,$7,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TRIM '(' expr ')'
-	  { $$= new Item_func_trim($3); }
+	  {
+            $$= new Item_func_trim($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TRIM '(' LEADING expr FROM expr ')'
-	  { $$= new Item_func_ltrim($6,$4); }
+	  {
+            $$= new Item_func_ltrim($6,$4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TRIM '(' TRAILING expr FROM expr ')'
-	  { $$= new Item_func_rtrim($6,$4); }
+	  {
+            $$= new Item_func_rtrim($6,$4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TRIM '(' BOTH expr FROM expr ')'
-	  { $$= new Item_func_trim($6,$4); }
+	  {
+            $$= new Item_func_trim($6,$4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TRIM '(' LEADING FROM expr ')'
-	 { $$= new Item_func_ltrim($5); }
+	  {
+            $$= new Item_func_ltrim($5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TRIM '(' TRAILING FROM expr ')'
-	  { $$= new Item_func_rtrim($5); }
+	  {
+            $$= new Item_func_rtrim($5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TRIM '(' BOTH FROM expr ')'
-	  { $$= new Item_func_trim($5); }
+	  {
+            $$= new Item_func_trim($5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TRIM '(' expr FROM expr ')'
-	  { $$= new Item_func_trim($5,$3); }
+	  {
+            $$= new Item_func_trim($5,$3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| TRUNCATE_SYM '(' expr ',' expr ')'
-	  { $$= new Item_func_round($3,$5,1); }
+	  {
+            $$= new Item_func_round($3,$5,1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| ident '.' ident '(' opt_expr_list ')'
 	  {
 	    LEX *lex= Lex;
@@ -5155,6 +5830,8 @@ simple_expr:
 	      $$= new Item_func_sp(Lex->current_context(), name, *$5);
 	    else
 	      $$= new Item_func_sp(Lex->current_context(), name);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    lex->safe_to_cache_query=0;
 	  }
 	| IDENT_sys '(' 
@@ -5295,47 +5972,110 @@ simple_expr:
               else
                 $$= new Item_func_sp(Lex->current_context(), name);
             }          
-          lex->safe_to_cache_query=0;
+            lex->safe_to_cache_query=0;
+
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
 	| UNIQUE_USERS '(' text_literal ',' NUM ',' NUM ',' expr_list ')'
 	  {
             $$= new Item_func_unique_users($3,atoi($5.str),atoi($7.str), * $9);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| UNIX_TIMESTAMP '(' ')'
 	  {
 	    $$= new Item_func_unix_timestamp();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    Lex->safe_to_cache_query=0;
 	  }
 	| UNIX_TIMESTAMP '(' expr ')'
-	  { $$= new Item_func_unix_timestamp($3); }
+	  {
+            $$= new Item_func_unix_timestamp($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| USER '(' ')'
-	  { $$= new Item_func_user(); Lex->safe_to_cache_query=0; }
+	  {
+            $$= new Item_func_user();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+            Lex->safe_to_cache_query=0;
+          }
 	| UTC_DATE_SYM optional_braces
-	  { $$= new Item_func_curdate_utc(); Lex->safe_to_cache_query=0;}
+	  {
+            $$= new Item_func_curdate_utc();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+            Lex->safe_to_cache_query=0;
+          }
 	| UTC_TIME_SYM optional_braces
-	  { $$= new Item_func_curtime_utc(); Lex->safe_to_cache_query=0;}
+	  {
+            $$= new Item_func_curtime_utc();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+            Lex->safe_to_cache_query=0;
+          }
 	| UTC_TIMESTAMP_SYM optional_braces
-	  { $$= new Item_func_now_utc(); Lex->safe_to_cache_query=0;}
+	  {
+            $$= new Item_func_now_utc();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+            Lex->safe_to_cache_query=0;
+          }
 	| WEEK_SYM '(' expr ')'
 	  {
-            $$= new Item_func_week($3,new Item_int((char*) "0",
-				   YYTHD->variables.default_week_format,1));
+            Item *item= new Item_int((char*) "0",
+                                     YYTHD->variables.default_week_format,
+                                     1);
+            if (item == NULL)
+              MYSQL_YYABORT;
+            $$= new Item_func_week($3, item);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
 	| WEEK_SYM '(' expr ',' expr ')'
-	  { $$= new Item_func_week($3,$5); }
+	  {
+            $$= new Item_func_week($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| YEAR_SYM '(' expr ')'
-	  { $$= new Item_func_year($3); }
+	  {
+            $$= new Item_func_year($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| YEARWEEK '(' expr ')'
-	  { $$= new Item_func_yearweek($3,new Item_int((char*) "0",0,1)); }
+	  {
+            Item *item= new Item_int((char*) "0",0,1);
+            if (item == NULL)
+              MYSQL_YYABORT;
+            $$= new Item_func_yearweek($3, item);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| YEARWEEK '(' expr ',' expr ')'
-	  { $$= new Item_func_yearweek($3, $5); }
+	  {
+            $$= new Item_func_yearweek($3, $5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| BENCHMARK_SYM '(' ulong_num ',' expr ')'
 	  {
 	    $$=new Item_func_benchmark($3,$5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
 	  }
 	| EXTRACT_SYM '(' interval FROM expr ')'
-	{ $$=new Item_extract( $3, $5); };
+          {
+            $$=new Item_extract( $3, $5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+        ;
 
 geometry_function:
 	  CONTAINS_SYM '(' expr ',' expr ')'
@@ -5411,7 +6151,12 @@ udf_expr_list:
 	;
 
 udf_expr_list2:
-	{ Select->expr_list.push_front(new List<Item>); }
+	  {
+            List<Item> *list= new List<Item>;
+            if (list == NULL)
+              MYSQL_YYABORT;
+            Select->expr_list.push_front(list);
+          }
 	udf_expr_list3
 	{ $$= Select->expr_list.pop(); }
 	;
@@ -5459,53 +6204,132 @@ udf_expr:
 	;
 
 sum_expr:
-	AVG_SYM '(' in_sum_expr ')'
-	  { $$=new Item_sum_avg($3); }
+	  AVG_SYM '(' in_sum_expr ')'
+	  {
+            $$=new Item_sum_avg($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| AVG_SYM '(' DISTINCT in_sum_expr ')'
-	  { $$=new Item_sum_avg_distinct($4); }
+	  {
+            $$=new Item_sum_avg_distinct($4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| BIT_AND  '(' in_sum_expr ')'
-	  { $$=new Item_sum_and($3); }
+	  {
+            $$=new Item_sum_and($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| BIT_OR  '(' in_sum_expr ')'
-	  { $$=new Item_sum_or($3); }
+	  {
+            $$=new Item_sum_or($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| BIT_XOR  '(' in_sum_expr ')'
-	  { $$=new Item_sum_xor($3); }
+	  {
+            $$=new Item_sum_xor($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| COUNT_SYM '(' opt_all '*' ')'
-	  { $$=new Item_sum_count(new Item_int((int32) 0L,1)); }
+	  {
+            Item *item= new Item_int((int32) 0L,1);
+            if (item == NULL)
+              MYSQL_YYABORT;
+            $$=new Item_sum_count(new Item_int((int32) 0L,1));
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| COUNT_SYM '(' in_sum_expr ')'
-	  { $$=new Item_sum_count($3); }
+	  {
+            $$=new Item_sum_count($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| COUNT_SYM '(' DISTINCT
 	  { Select->in_sum_expr++; }
 	   expr_list
 	  { Select->in_sum_expr--; }
 	  ')'
-	  { $$=new Item_sum_count_distinct(* $5); }
+	  {
+            $$=new Item_sum_count_distinct(* $5);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| GROUP_UNIQUE_USERS '(' text_literal ',' NUM ',' NUM ',' in_sum_expr ')'
-	  { $$= new Item_sum_unique_users($3,atoi($5.str),atoi($7.str),$9); }
+	  {
+            $$= new Item_sum_unique_users($3,atoi($5.str),atoi($7.str),$9);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| MIN_SYM '(' in_sum_expr ')'
-	  { $$=new Item_sum_min($3); }
+	  {
+            $$=new Item_sum_min($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 /*
    According to ANSI SQL, DISTINCT is allowed and has
    no sence inside MIN and MAX grouping functions; so MIN|MAX(DISTINCT ...)
    is processed like an ordinary MIN | MAX()
  */
 	| MIN_SYM '(' DISTINCT in_sum_expr ')'
-	  { $$=new Item_sum_min($4); }
+	  {
+            $$=new Item_sum_min($4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| MAX_SYM '(' in_sum_expr ')'
-	  { $$=new Item_sum_max($3); }
+	  {
+            $$=new Item_sum_max($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| MAX_SYM '(' DISTINCT in_sum_expr ')'
-	  { $$=new Item_sum_max($4); }
+	  {
+            $$=new Item_sum_max($4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| STD_SYM '(' in_sum_expr ')'
-	  { $$=new Item_sum_std($3, 0); }
+	  {
+            $$=new Item_sum_std($3, 0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| VARIANCE_SYM '(' in_sum_expr ')'
-	  { $$=new Item_sum_variance($3, 0); }
+	  {
+            $$=new Item_sum_variance($3, 0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| STDDEV_SAMP_SYM '(' in_sum_expr ')'
-	  { $$=new Item_sum_std($3, 1); }
+	  {
+            $$=new Item_sum_std($3, 1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| VAR_SAMP_SYM '(' in_sum_expr ')'
-	  { $$=new Item_sum_variance($3, 1); }
+	  {
+            $$=new Item_sum_variance($3, 1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| SUM_SYM '(' in_sum_expr ')'
-	  { $$=new Item_sum_sum($3); }
+	  {
+            $$=new Item_sum_sum($3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| SUM_SYM '(' DISTINCT in_sum_expr ')'
-	  { $$=new Item_sum_sum_distinct($4); }
+	  {
+            $$=new Item_sum_sum_distinct($4);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| GROUP_CONCAT_SYM '(' opt_distinct
 	  { Select->in_sum_expr++; }
 	  expr_list opt_gorder_clause
@@ -5516,6 +6340,8 @@ sum_expr:
 	    sel->in_sum_expr--;
 	    $$=new Item_func_group_concat(Lex->current_context(), $3, $5,
                                           sel->gorder_list, $7);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	    $5->empty();
 	  };
 
@@ -5538,12 +6364,16 @@ variable_aux:
           ident_or_text SET_VAR expr
           {
             $$= new Item_func_set_user_var($1, $3);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
             LEX *lex= Lex;
             lex->uncacheable(UNCACHEABLE_RAND);
           }
         | ident_or_text
           {
             $$= new Item_func_get_user_var($1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
             LEX *lex= Lex;
             lex->uncacheable(UNCACHEABLE_RAND);
           }
@@ -5564,11 +6394,14 @@ opt_distinct:
     |DISTINCT   { $$ = 1; };
 
 opt_gconcat_separator:
-    /* empty */
-      {
-        $$= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1);
-      }
-    | SEPARATOR_SYM text_string { $$ = $2; };
+          /* empty */
+          {
+            $$= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+        | SEPARATOR_SYM text_string { $$ = $2; }
+        ;
 
 
 opt_gorder_clause:
@@ -5582,6 +6415,8 @@ opt_gorder_clause:
             select->gorder_list=
 	      (SQL_LIST*) sql_memdup((char*) &select->order_list,
 				     sizeof(st_sql_list));
+            if (select->gorder_list == NULL)
+              MYSQL_YYABORT;
 	    select->order_list.empty();
 	  };
 
@@ -5622,7 +6457,12 @@ opt_expr_list:
 	;
 
 expr_list:
-	{ Select->expr_list.push_front(new List<Item>); }
+	{
+          List<Item> *list= new List<Item>;
+          if (list == NULL)
+            MYSQL_YYABORT;
+          Select->expr_list.push_front(list);
+        }
 	expr_list2
 	{ $$= Select->expr_list.pop(); };
 
@@ -5635,7 +6475,12 @@ ident_list_arg:
         | '(' ident_list ')'  { $$= $2; };
 
 ident_list:
-        { Select->expr_list.push_front(new List<Item>); }
+        {
+          List<Item> *list= new List<Item>;
+          if (list == NULL)
+            MYSQL_YYABORT;
+          Select->expr_list.push_front(new List<Item>);
+        }
         ident_list2
         { $$= Select->expr_list.pop(); };
 
@@ -5655,6 +6500,8 @@ when_list:
           WHEN_SYM expr THEN_SYM expr
           {
             $$= new List<Item>;
+            if ($$ == NULL)
+              MYSQL_YYABORT;
             $$->push_back($2);
             $$->push_back($4);
           }
@@ -6061,32 +6908,53 @@ key_list_or_empty:
 
 key_usage_list2:
 	key_usage_list2 ',' ident
-        { Select->
-	    interval_list.push_back(new (YYTHD->mem_root) String((const char*) $3.str, $3.length,
-				    system_charset_info)); }
+        {
+          String *s= new (YYTHD->mem_root) String((const char*) $3.str,
+                                                   $3.length,
+                                                   system_charset_info);
+          if (s == NULL)
+            MYSQL_YYABORT;
+          Select->interval_list.push_back(s);
+        }
 	| ident
-        { Select->
-	    interval_list.push_back(new (YYTHD->mem_root) String((const char*) $1.str, $1.length,
-				    system_charset_info)); }
+        {
+          String *s= new (YYTHD->mem_root) String((const char*) $1.str,
+                                                   $1.length,
+                                                   system_charset_info);
+          if (s == NULL)
+            MYSQL_YYABORT;
+          Select->interval_list.push_back(s);
+        }
 	| PRIMARY_SYM
-        { Select->
-	    interval_list.push_back(new (YYTHD->mem_root) String("PRIMARY", 7,
-				    system_charset_info)); };
+        {
+          String *s= new (YYTHD->mem_root) String("PRIMARY", 7,
+                                                  system_charset_info);
+          if (s == NULL)
+            MYSQL_YYABORT;
+          Select->interval_list.push_back(s);
+        }
+        ;
 
 using_list:
 	ident
 	  {
             if (!($$= new List<String>))
 	      MYSQL_YYABORT;
-            $$->push_back(new (YYTHD->mem_root)
-                              String((const char *) $1.str, $1.length,
-                                      system_charset_info));
+            String *s= new (YYTHD->mem_root) String((const char *) $1.str,
+                                                    $1.length,
+                                                    system_charset_info);
+            if (s == NULL)
+              MYSQL_YYABORT;
+            $$->push_back(s);
 	  }
 	| using_list ',' ident
 	  {
-            $1->push_back(new (YYTHD->mem_root)
-                              String((const char *) $3.str, $3.length,
-                                      system_charset_info));
+            String *s= new (YYTHD->mem_root) String((const char *) $3.str,
+                                                    $3.length,
+                                                    system_charset_info);
+            if (s == NULL)
+              MYSQL_YYABORT;
+            $1->push_back(s);
             $$= $1;
 	  };
 
@@ -6151,7 +7019,12 @@ table_alias:
 opt_table_alias:
 	/* empty */		{ $$=0; }
 	| table_alias ident
-	  { $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); };
+	  {
+            $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING));
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+        ;
 
 opt_all:
 	/* empty */
@@ -6202,6 +7075,8 @@ opt_escape:
             $$= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ?
 		 new Item_string("", 0, &my_charset_latin1) :
                  new Item_string("\\", 1, &my_charset_latin1));
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
         ;
 
@@ -6372,9 +7247,24 @@ limit_option:
         {
           ((Item_param *) $1)->limit_clause_param= TRUE;
         }
-        | ULONGLONG_NUM { $$= new Item_uint($1.str, $1.length); }
-        | LONG_NUM     { $$= new Item_uint($1.str, $1.length); }
-        | NUM           { $$= new Item_uint($1.str, $1.length); }
+        | ULONGLONG_NUM
+          {
+            $$= new Item_uint($1.str, $1.length);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+        | LONG_NUM
+          {
+            $$= new Item_uint($1.str, $1.length);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+        | NUM
+          {
+            $$= new Item_uint($1.str, $1.length);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         ;
 
 delete_limit_clause:
@@ -6427,10 +7317,11 @@ procedure_clause:
 	    lex->proc_list.elements=0;
 	    lex->proc_list.first=0;
 	    lex->proc_list.next= (byte**) &lex->proc_list.first;
-	    if (add_proc_to_list(lex->thd, new Item_field(&lex->
-                                                          current_select->
-                                                          context,
-                                                          NULL,NULL,$2.str)))
+            Item_field *item= new Item_field(&lex->current_select->context,
+                                             NULL,NULL,$2.str);
+            if (item == NULL)
+              MYSQL_YYABORT;
+	    if (add_proc_to_list(lex->thd, item))
 	      MYSQL_YYABORT;
 	    Lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
 	  }
@@ -6481,13 +7372,20 @@ select_var_ident:
            {
              LEX *lex=Lex;
 	     if (lex->result) 
-	       ((select_dumpvar *)lex->result)->var_list.push_back( new my_var($2,0,0,(enum_field_types)0));
+             {
+               my_var *var= new my_var($2,0,0,(enum_field_types)0);
+               if (var == NULL)
+                 MYSQL_YYABORT;
+	       ((select_dumpvar *)lex->result)->var_list.push_back(var);
+             }
 	     else
+             {
                /*
                  The parser won't create select_result instance only
 	         if it's an EXPLAIN.
                */
                DBUG_ASSERT(lex->describe);
+             }
 	   }
            | ident_or_text
            {
@@ -6501,12 +7399,12 @@ select_var_ident:
 	     }
 	     if (lex->result)
              {
-               my_var *var;
-	       ((select_dumpvar *)lex->result)->
-                 var_list.push_back(var= new my_var($1,1,t->offset,t->type));
+               my_var *var= new my_var($1,1,t->offset,t->type);
+               if (var == NULL)
+                 MYSQL_YYABORT;
+	       ((select_dumpvar *)lex->result)->var_list.push_back(var);
 #ifndef DBUG_OFF
-	       if (var)
-		 var->sp= lex->sphead;
+               var->sp= lex->sphead;
 #endif
              }
 	     else
@@ -6591,11 +7489,13 @@ drop:
 	| DROP INDEX_SYM ident ON table_ident {}
 	  {
 	     LEX *lex=Lex;
+             Alter_drop *ad= new Alter_drop(Alter_drop::KEY, $3.str);
+             if (ad == NULL)
+               MYSQL_YYABORT;
 	     lex->sql_command= SQLCOM_DROP_INDEX;
              lex->alter_info.reset();
              lex->alter_info.flags= ALTER_DROP_INDEX;
-	     lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
-                                                                $3.str));
+	     lex->alter_info.drop_list.push_back(ad);
 	     if (!lex->current_select->add_table_to_list(lex->thd, $5, NULL,
 							TL_OPTION_UPDATING))
 	      MYSQL_YYABORT;
@@ -6620,6 +7520,8 @@ drop:
 	    lex->sql_command = SQLCOM_DROP_FUNCTION;
 	    lex->drop_if_exists= $3;
 	    spname= new sp_name($4, $6, true);
+            if (spname == NULL)
+              MYSQL_YYABORT;
 	    spname->init_qname(thd);
 	    lex->spname= spname;
 	  }
@@ -6639,6 +7541,8 @@ drop:
 	    lex->sql_command = SQLCOM_DROP_FUNCTION;
 	    lex->drop_if_exists= $3;
 	    spname= new sp_name(db, $4, false);
+            if (spname == NULL)
+              MYSQL_YYABORT;
 	    spname->init_qname(thd);
 	    lex->spname= spname;
 	  }
@@ -6853,7 +7757,12 @@ values:
 
 expr_or_default:
 	expr	  { $$= $1;}
-	| DEFAULT {$$= new Item_default_value(Lex->current_context()); }
+	| DEFAULT
+          {
+            $$= new Item_default_value(Lex->current_context());
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	;
 
 opt_insert_update:
@@ -6971,15 +7880,21 @@ table_wild_list:
 table_wild_one:
 	ident opt_wild opt_table_alias
 	{
-	  if (!Select->add_table_to_list(YYTHD, new Table_ident($1), $3,
+          Table_ident *ti= new Table_ident($1);
+          if (ti == NULL)
+            MYSQL_YYABORT;
+	  if (!Select->add_table_to_list(YYTHD, ti, $3,
 					 TL_OPTION_UPDATING | 
                                          TL_OPTION_ALIAS, Lex->lock_option))
 	    MYSQL_YYABORT;
         }
 	| ident '.' ident opt_wild opt_table_alias
 	  {
+            Table_ident *ti= new Table_ident(YYTHD, $1, $3, 0);
+            if (ti == NULL)
+              MYSQL_YYABORT;
 	    if (!Select->add_table_to_list(YYTHD,
-					   new Table_ident(YYTHD, $1, $3, 0),
+                                           ti,
 					   $5, 
                                            TL_OPTION_UPDATING | 
                                            TL_OPTION_ALIAS,
@@ -7357,8 +8272,12 @@ binlog_from:
 wild_and_where:
       /* empty */
       | LIKE TEXT_STRING_sys
-	{ Lex->wild=  new (YYTHD->mem_root) String($2.str, $2.length,
-                                                   system_charset_info); }
+	{
+          Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length,
+                                                  system_charset_info);
+          if (Lex->wild == NULL)
+            MYSQL_YYABORT;
+        }
       | WHERE expr
         {
           Select->where= $2;
@@ -7406,7 +8325,14 @@ opt_describe_column:
 	/* empty */	{}
 	| text_string	{ Lex->wild= $1; }
 	| ident
-	  { Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); };
+	  {
+            Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str,
+                                                    $1.length,
+                                                    system_charset_info);
+            if (Lex->wild == NULL)
+              MYSQL_YYABORT;
+          }
+        ;
 
 
 /* flush things */
@@ -7690,7 +8616,11 @@ fields_or_vars:
 field_or_var:
         simple_ident_nospvar {$$= $1;}
         | '@' ident_or_text
-          { $$= new Item_user_var_as_out_param($2); }
+          {
+            $$= new Item_user_var_as_out_param($2);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         ;
 
 opt_load_data_set_spec:
@@ -7715,9 +8645,14 @@ text_literal:
                my_charset_is_ascii_based(cs_con)))
             tmp= $1;
           else
-            thd->convert_string(&tmp, cs_con, $1.str, $1.length, cs_cli);
+          {
+            if (thd->convert_string(&tmp, cs_con, $1.str, $1.length, cs_cli))
+              MYSQL_YYABORT;
+          }
           $$= new Item_string(tmp.str, tmp.length, cs_con,
                               DERIVATION_COERCIBLE, repertoire);
+          if ($$ == NULL)
+            MYSQL_YYABORT;
         }
         | NCHAR_STRING
         {
@@ -7726,10 +8661,14 @@ text_literal:
           DBUG_ASSERT(my_charset_is_ascii_based(national_charset_info));
           $$= new Item_string($1.str, $1.length, national_charset_info,
                               DERIVATION_COERCIBLE, repertoire);
+          if ($$ == NULL)
+            MYSQL_YYABORT;
         }
         | UNDERSCORE_CHARSET TEXT_STRING
           {
             $$= new Item_string($2.str, $2.length, Lex->underscore_charset);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
             ((Item_string*) $$)->set_repertoire_from_value();
           }
         | text_literal TEXT_STRING_literal
@@ -7751,28 +8690,37 @@ text_literal:
         ;
 
 text_string:
-	TEXT_STRING_literal
-	{ $$=  new (YYTHD->mem_root) String($1.str,$1.length,YYTHD->variables.collation_connection); }
+	  TEXT_STRING_literal
+          {
+            $$= new (YYTHD->mem_root) String($1.str,
+                                             $1.length,
+                                             YYTHD->variables.collation_connection);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	| HEX_NUM
 	  {
 	    Item *tmp= new Item_hex_string($1.str, $1.length);
+            if (tmp == NULL)
+              MYSQL_YYABORT;
 	    /*
 	      it is OK only emulate fix_fields, because we need only
               value of constant
 	    */
-	    $$= tmp ?
-	      tmp->quick_fix_field(), tmp->val_str((String*) 0) :
-	      (String*) 0;
+            tmp->quick_fix_field();
+            $$= tmp->val_str((String*) 0);
 	  }
         | BIN_NUM
           {
 	    Item *tmp= new Item_bin_string($1.str, $1.length);
+            if (tmp == NULL)
+              MYSQL_YYABORT;
 	    /*
 	      it is OK only emulate fix_fields, because we need only
               value of constant
 	    */
-	    $$= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) :
-		      (String*) 0;
+            tmp->quick_fix_field();
+            $$= tmp->val_str((String*) 0);
           }
 	;
 
@@ -7814,76 +8762,121 @@ literal:
 	| NULL_SYM
           {
             $$ = new Item_null();
+            if ($$ == NULL)
+              MYSQL_YYABORT;
             YYLIP->next_state= MY_LEX_OPERATOR_OR_IDENT;
           }
-	| FALSE_SYM	{ $$= new Item_int((char*) "FALSE",0,1); }
-	| TRUE_SYM	{ $$= new Item_int((char*) "TRUE",1,1); }
-	| HEX_NUM	{ $$ =	new Item_hex_string($1.str, $1.length);}
-	| BIN_NUM	{ $$= new Item_bin_string($1.str, $1.length); }
+	| FALSE_SYM
+          {
+            $$= new Item_int((char*) "FALSE",0,1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| TRUE_SYM
+          {
+            $$= new Item_int((char*) "TRUE",1,1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| HEX_NUM
+          {
+            $$=	new Item_hex_string($1.str, $1.length);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| BIN_NUM
+          {
+            $$= new Item_bin_string($1.str, $1.length);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         | UNDERSCORE_CHARSET HEX_NUM
           {
             Item *tmp= new Item_hex_string($2.str, $2.length);
+            if (tmp == NULL)
+              MYSQL_YYABORT;
             /*
               it is OK only emulate fix_fieds, because we need only
               value of constant
             */
-            String *str= tmp ?
-              tmp->quick_fix_field(), tmp->val_str((String*) 0) :
-              (String*) 0;
-            $$= new Item_string(NULL, /* name will be set in select_item */
-                                str ? str->ptr() : "",
-                                str ? str->length() : 0,
-                                Lex->underscore_charset);
-            if (!$$ || !$$->check_well_formed_result(&$$->str_value, TRUE))
+            tmp->quick_fix_field();
+            String *str= tmp->val_str((String*) 0);
+            Item_string *item_str;
+            item_str= new Item_string(NULL, /* name will be set in select_item */
+                                      str ? str->ptr() : "",
+                                      str ? str->length() : 0,
+                                      Lex->underscore_charset);
+            if (!item_str ||
+                !item_str->check_well_formed_result(&item_str->str_value, TRUE))
             {
               MYSQL_YYABORT;
             }
-            ((Item_string *) $$)->set_repertoire_from_value();
+            item_str->set_repertoire_from_value();
+            $$= item_str;
           }
 	| UNDERSCORE_CHARSET BIN_NUM
           {
 	    Item *tmp= new Item_bin_string($2.str, $2.length);
+            if (tmp == NULL)
+              MYSQL_YYABORT;
 	    /*
 	      it is OK only emulate fix_fieds, because we need only
               value of constant
 	    */
-	    String *str= tmp ?
-	      tmp->quick_fix_field(), tmp->val_str((String*) 0) :
-	      (String*) 0;
-            $$= new Item_string(NULL, /* name will be set in select_item */
-                                str ? str->ptr() : "",
-                                str ? str->length() : 0,
-                                Lex->underscore_charset);
-            if (!$$ || !$$->check_well_formed_result(&$$->str_value, TRUE))
+            tmp->quick_fix_field();
+	    String *str= tmp->val_str((String*) 0);
+            Item_string *item_str;
+            item_str= new Item_string(NULL, /* name will be set in select_item */
+                                      str ? str->ptr() : "",
+                                      str ? str->length() : 0,
+                                      Lex->underscore_charset);
+            if (!item_str ||
+                !item_str->check_well_formed_result(&item_str->str_value, TRUE))
             {
               MYSQL_YYABORT;
             }
+            $$= item_str;
           }
 	| DATE_SYM text_literal { $$ = $2; }
 	| TIME_SYM text_literal { $$ = $2; }
 	| TIMESTAMP text_literal { $$ = $2; };
 
 NUM_literal:
-	NUM		{ int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); }
-	| LONG_NUM	{ int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); }
-	| ULONGLONG_NUM	{ $$ =	new Item_uint($1.str, $1.length); }
+	  NUM
+          {
+            int error;
+            $$ = new Item_int($1.str,
+                              (longlong) my_strtoll10($1.str, NULL, &error),
+                              $1.length);
+          }
+	| LONG_NUM
+          {
+            int error;
+            $$ = new Item_int($1.str,
+                              (longlong) my_strtoll10($1.str, NULL, &error),
+                              $1.length);
+          }
+	| ULONGLONG_NUM
+          {
+            $$=	new Item_uint($1.str, $1.length);
+          }
         | DECIMAL_NUM
-	{
-           $$= new Item_decimal($1.str, $1.length, YYTHD->charset());
-	   if (YYTHD->net.report_error)
-	   {
-	     MYSQL_YYABORT;
-	   }
-	}
+	  {
+            $$= new Item_decimal($1.str, $1.length, YYTHD->charset());
+            if (($$ == NULL) || (YYTHD->net.report_error))
+            {
+              MYSQL_YYABORT;
+            }
+          }
 	| FLOAT_NUM
-	{
-	   $$ =	new Item_float($1.str, $1.length);
-	   if (YYTHD->net.report_error)
-	   {
-	     MYSQL_YYABORT;
-	   }
-	}
-	;
+          {
+            $$= new Item_float($1.str, $1.length);
+            if (($$ == NULL) || (YYTHD->net.report_error))
+            {
+              MYSQL_YYABORT;
+            }
+          }
+        ;
 
 /**********************************************************************
 ** Creating different items.
@@ -7898,6 +8891,8 @@ table_wild:
 	{
           SELECT_LEX *sel= Select;
 	  $$ = new Item_field(Lex->current_context(), NullS, $1.str, "*");
+          if ($$ == NULL)
+            MYSQL_YYABORT;
 	  sel->with_wild++;
 	}
 	| ident '.' ident '.' '*'
@@ -7906,6 +8901,8 @@ table_wild:
 	  $$ = new Item_field(Lex->current_context(), (YYTHD->client_capabilities &
                              CLIENT_NO_SCHEMA ? NullS : $1.str),
                              $3.str,"*");
+          if ($$ == NULL)
+            MYSQL_YYABORT;
 	  sel->with_wild++;
 	}
 	;
@@ -7935,11 +8932,12 @@ simple_ident:
                                       lip->tok_start_prev - 
                                       lex->sphead->m_tmp_query,
                                       lip->tok_end - lip->tok_start_prev);
+            if (splocal == NULL)
+              MYSQL_YYABORT;
 #ifndef DBUG_OFF
-            if (splocal)
-              splocal->m_sp= lex->sphead;
+            splocal->m_sp= lex->sphead;
 #endif
-	    $$ = (Item*) splocal;
+	    $$= splocal;
 	    lex->safe_to_cache_query=0;
 	  }
 	  else
@@ -7949,6 +8947,8 @@ simple_ident:
 	         sel->get_in_sum_expr() > 0) ?
                  (Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) :
 	         (Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
         }
         | simple_ident_q { $$= $1; }
@@ -7962,6 +8962,8 @@ simple_ident_nospvar:
 	       sel->get_in_sum_expr() > 0) ?
               (Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) :
 	      (Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str);
+          if ($$ == NULL)
+            MYSQL_YYABORT;
 	}
 	| simple_ident_q { $$= $1; }
 	;
@@ -8033,6 +9035,8 @@ simple_ident_q:
 	         sel->get_in_sum_expr() > 0) ?
 	        (Item*) new Item_field(Lex->current_context(), NullS, $1.str, $3.str) :
 	        (Item*) new Item_ref(Lex->current_context(), NullS, $1.str, $3.str);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
           }
         }
 	| '.' ident '.' ident
@@ -8049,6 +9053,8 @@ simple_ident_q:
 	       sel->get_in_sum_expr() > 0) ?
 	      (Item*) new Item_field(Lex->current_context(), NullS, $2.str, $4.str) :
               (Item*) new Item_ref(Lex->current_context(), NullS, $2.str, $4.str);
+          if ($$ == NULL)
+            MYSQL_YYABORT;
 	}
 	| ident '.' ident '.' ident
 	{
@@ -8070,6 +9076,8 @@ simple_ident_q:
                                    (YYTHD->client_capabilities &
 				    CLIENT_NO_SCHEMA ? NullS : $1.str),
                                    $3.str, $5.str);
+          if ($$ == NULL)
+            MYSQL_YYABORT;
 	};
 
 
@@ -8104,13 +9112,34 @@ field_ident:
 	| '.' ident		{ $$=$2;}	/* For Delphi */;
 
 table_ident:
-	ident			{ $$=new Table_ident($1); }
-	| ident '.' ident	{ $$=new Table_ident(YYTHD, $1,$3,0);}
-	| '.' ident		{ $$=new Table_ident($2);} /* For Delphi */
+	  ident
+          {
+            $$=new Table_ident($1);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| ident '.' ident
+          {
+            $$=new Table_ident(YYTHD, $1,$3,0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| '.' ident
+          {
+            $$=new Table_ident($2); /* For Delphi */
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         ;
 
 table_ident_nodb:
-	ident			{ LEX_STRING db={(char*) any_db,3}; $$=new Table_ident(YYTHD, db,$1,0); }
+	ident
+          {
+            LEX_STRING db={(char*) any_db,3};
+            $$=new Table_ident(YYTHD, db,$1,0);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
         ;
 
 IDENT_sys:
@@ -8134,8 +9163,11 @@ IDENT_sys:
 	      $$= $1;
             }
 	    else
-	      thd->convert_string(&$$, system_charset_info,
-				  $1.str, $1.length, thd->charset());
+            {
+	      if (thd->convert_string(&$$, system_charset_info,
+				  $1.str, $1.length, thd->charset()))
+                MYSQL_YYABORT;
+            }
 	  }
 	;
 
@@ -8146,8 +9178,11 @@ TEXT_STRING_sys:
 	  if (thd->charset_is_system_charset)
 	    $$= $1;
 	  else
-	    thd->convert_string(&$$, system_charset_info,
-				$1.str, $1.length, thd->charset());
+          {
+	    if (thd->convert_string(&$$, system_charset_info,
+				$1.str, $1.length, thd->charset()))
+              MYSQL_YYABORT;
+          }
 	}
 	;
 
@@ -8158,8 +9193,11 @@ TEXT_STRING_literal:
 	  if (thd->charset_is_collation_connection)
 	    $$= $1;
 	  else
-	    thd->convert_string(&$$, thd->variables.collation_connection,
-				$1.str, $1.length, thd->charset());
+          {
+	    if (thd->convert_string(&$$, thd->variables.collation_connection,
+				$1.str, $1.length, thd->charset()))
+              MYSQL_YYABORT;
+          }
 	}
 	;
 
@@ -8171,8 +9209,11 @@ TEXT_STRING_filesystem:
 	  if (thd->charset_is_character_set_filesystem)
 	    $$= $1;
 	  else
-	    thd->convert_string(&$$, thd->variables.character_set_filesystem,
-				$1.str, $1.length, thd->charset());
+          {
+	    if (thd->convert_string(&$$, thd->variables.character_set_filesystem,
+				$1.str, $1.length, thd->charset()))
+              MYSQL_YYABORT;
+          }
 	}
 	;
 
@@ -8182,6 +9223,8 @@ ident:
 	{
 	  THD *thd= YYTHD;
 	  $$.str=    thd->strmake($1.str, $1.length);
+          if ($$.str == NULL)
+            MYSQL_YYABORT;
 	  $$.length= $1.length;
 	}
 	;
@@ -8192,6 +9235,8 @@ label_ident:
 	{
 	  THD *thd= YYTHD;
 	  $$.str=    thd->strmake($1.str, $1.length);
+          if ($$.str == NULL)
+            MYSQL_YYABORT;
 	  $$.length= $1.length;
 	}
 	;
@@ -8723,29 +9768,50 @@ sys_option_value:
 	  LEX *lex=Lex;
           if ($1)
             lex->option_type= $1;
-	  lex->var_list.push_back(new set_var(lex->option_type,
-                                              find_sys_var("tx_isolation"),
-                                              &null_lex_str,
-                                              new Item_int((int32) $5)));
+          Item *item= new Item_int((int32) $5);
+          if (item == NULL)
+            MYSQL_YYABORT;
+          set_var *var= new set_var(lex->option_type,
+                                    find_sys_var("tx_isolation"),
+                                    &null_lex_str,
+                                    item);
+          if (var == NULL)
+            MYSQL_YYABORT;
+	  lex->var_list.push_back(var);
 	}
         ;
 
 option_value:
 	'@' ident_or_text equal expr
 	{
-          Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4)));
+          Item_func_set_user_var *item= new Item_func_set_user_var($2,$4);
+          if (item == NULL)
+            MYSQL_YYABORT;
+          set_var_user *var= new set_var_user(item);
+          if (var == NULL)
+            MYSQL_YYABORT;
+          Lex->var_list.push_back(var);
 	}
 	| '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default
 	  {
 	    LEX *lex=Lex;
-	    lex->var_list.push_back(new set_var($3, $4.var, &$4.base_name, $6));
+            set_var *var= new set_var($3, $4.var, &$4.base_name, $6);
+            if (var == NULL)
+              MYSQL_YYABORT;
+	    lex->var_list.push_back(var);
 	  }
 	| charset old_or_new_charset_name_or_default
 	{
 	  THD *thd= YYTHD;
 	  LEX *lex= Lex;
 	  $2= $2 ? $2: global_system_variables.character_set_client;
-	  lex->var_list.push_back(new set_var_collation_client($2,thd->variables.collation_database,$2));
+          set_var_collation_client *var;
+          var= new set_var_collation_client($2,
+                                            thd->variables.collation_database,
+                                            $2);
+          if (var == NULL)
+            MYSQL_YYABORT;
+	  lex->var_list.push_back(var);
 	}
         | NAMES_SYM equal expr
 	  {
@@ -8773,7 +9839,11 @@ option_value:
                      $3->name, $2->csname);
 	    MYSQL_YYABORT;
 	  }
-	  lex->var_list.push_back(new set_var_collation_client($3,$3,$3));
+          set_var_collation_client *var;
+          var= new set_var_collation_client($3,$3,$3);
+          if (var == NULL)
+            MYSQL_YYABORT;
+	  lex->var_list.push_back(var);
 	}
 	| PASSWORD equal text_or_password
 	  {
@@ -8794,11 +9864,17 @@ option_value:
 	      MYSQL_YYABORT;
 	    user->host=null_lex_str;
 	    user->user.str=thd->security_ctx->priv_user;
-	    thd->lex->var_list.push_back(new set_var_password(user, $3));
+            set_var_password *var= new set_var_password(user, $3);
+            if (var == NULL)
+              MYSQL_YYABORT;
+	    thd->lex->var_list.push_back(var);
 	  }
 	| PASSWORD FOR_SYM user equal text_or_password
 	  {
-	    Lex->var_list.push_back(new set_var_password($3,$5));
+            set_var_password *var= new set_var_password($3,$5);
+            if (var == NULL)
+              MYSQL_YYABORT;
+	    Lex->var_list.push_back(var);
 	  }
 	;
 
@@ -8912,11 +9988,15 @@ text_or_password:
 	        Item_func_old_password::alloc(YYTHD, $3.str) :
 	        Item_func_password::alloc(YYTHD, $3.str) :
 	      $3.str;
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
 	| OLD_PASSWORD '(' TEXT_STRING ')'
 	  {
 	    $$= $3.length ? Item_func_old_password::alloc(YYTHD, $3.str) :
 	      $3.str;
+            if ($$ == NULL)
+              MYSQL_YYABORT;
 	  }
           ;
 
@@ -8924,9 +10004,24 @@ text_or_password:
 set_expr_or_default:
 	expr      { $$=$1; }
 	| DEFAULT { $$=0; }
-	| ON	  { $$=new Item_string("ON",  2, system_charset_info); }
-	| ALL	  { $$=new Item_string("ALL", 3, system_charset_info); }
-	| BINARY  { $$=new Item_string("binary", 6, system_charset_info); }
+	| ON
+          {
+            $$=new Item_string("ON",  2, system_charset_info);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| ALL
+          {
+            $$=new Item_string("ALL", 3, system_charset_info);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
+	| BINARY
+          {
+            $$=new Item_string("binary", 6, system_charset_info);
+            if ($$ == NULL)
+              MYSQL_YYABORT;
+          }
 	;
 
 
@@ -9027,7 +10122,10 @@ handler:
 	  }
 	  lex->sql_command = SQLCOM_HA_READ;
 	  lex->ha_rkey_mode= HA_READ_KEY_EXACT;	/* Avoid purify warnings */
-	  lex->current_select->select_limit= new Item_int((int32) 1);
+          Item *one= new Item_int((int32) 1);
+          if (one == NULL)
+            MYSQL_YYABORT;
+	  lex->current_select->select_limit= one;
 	  lex->current_select->offset_limit= 0;
 	  if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0))
 	    MYSQL_YYABORT;
@@ -9334,8 +10432,9 @@ grant_user:
              {
                char *buff= 
                  (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1);
-               if (buff)
-                 make_scrambled_password_323(buff, $4.str);
+               if (buff == NULL)
+                 MYSQL_YYABORT;
+               make_scrambled_password_323(buff, $4.str);
                $1->password.str= buff;
                $1->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323;
              }
@@ -9343,8 +10442,9 @@ grant_user:
              {
                char *buff= 
                  (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH+1);
-               if (buff)
-                 make_scrambled_password(buff, $4.str);
+               if (buff == NULL)
+                 MYSQL_YYABORT;
+               make_scrambled_password(buff, $4.str);
                $1->password.str= buff;
                $1->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH;
              }
@@ -9373,6 +10473,8 @@ column_list_id:
 	ident
 	{
 	  String *new_str = new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info);
+          if (new_str == NULL)
+            MYSQL_YYABORT;
 	  List_iterator <LEX_COLUMN> iter(Lex->columns);
 	  class LEX_COLUMN *point;
 	  LEX *lex=Lex;
@@ -9386,7 +10488,12 @@ column_list_id:
 	  if (point)
 	    point->rights |= lex->which_columns;
 	  else
-	    lex->columns.push_back(new LEX_COLUMN (*new_str,lex->which_columns));
+          {
+            LEX_COLUMN *col= new LEX_COLUMN (*new_str,lex->which_columns);
+            if (col == NULL)
+              MYSQL_YYABORT;
+	    lex->columns.push_back(col);
+          }
 	}
         ;
 
@@ -9800,13 +10907,17 @@ view_list_opt:
 view_list:
 	ident 
 	  {
-	    Lex->view_list.push_back((LEX_STRING*)
-				     sql_memdup(&$1, sizeof(LEX_STRING)));
+            LEX_STRING *ls= (LEX_STRING*) sql_memdup(&$1, sizeof(LEX_STRING));
+            if (ls == NULL)
+              MYSQL_YYABORT;
+	    Lex->view_list.push_back(ls);
 	  }
 	| view_list ',' ident
 	  {
-	    Lex->view_list.push_back((LEX_STRING*)
-				     sql_memdup(&$3, sizeof(LEX_STRING)));
+            LEX_STRING *ls= (LEX_STRING*) sql_memdup(&$3, sizeof(LEX_STRING));
+            if (ls == NULL)
+              MYSQL_YYABORT;
+	    Lex->view_list.push_back(ls);
 	  }
 	;
 
@@ -9979,6 +11090,8 @@ sf_tail:
 
 	    /* Order is important here: new - reset - init */
 	    sp= new sp_head();
+            if (sp == NULL)
+              MYSQL_YYABORT;
 	    sp->reset_thd_mem_root(thd);
 	    sp->init(lex);
             sp->init_sp_name(thd, lex->spname);
diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc
index 392db9224c3..4ebcf1c50af 100644
--- a/sql/thr_malloc.cc
+++ b/sql/thr_malloc.cc
@@ -21,10 +21,35 @@
 extern "C" {
   void sql_alloc_error_handler(void)
   {
-    THD *thd=current_thd;
-    if (thd)					// QQ;  To be removed
-      thd->fatal_error();			/* purecov: inspected */
     sql_print_error(ER(ER_OUT_OF_RESOURCES));
+
+    THD *thd=current_thd;
+    if (thd)
+    {
+      /*
+        This thread is Out Of Memory.
+        An OOM condition is a fatal error.
+        It should not be caught by error handlers in stored procedures.
+        Also, recording that SQL condition in the condition area could
+        cause more memory allocations, which in turn could raise more
+        OOM conditions, causing recursion in the error handling code itself.
+        As a result, my_error() should not be invoked, and the
+        thread diagnostics area is set to an error status directly.
+        The visible result for a client application will be:
+        - a query fails with an ER_OUT_OF_RESOURCES error,
+        returned in the error packet.
+        - SHOW ERROR/SHOW WARNINGS may be empty.
+      */
+
+      NET *net= &thd->net;
+      thd->fatal_error();
+      if (!net->last_error[0])                  // Return only first message
+      {
+        strmake(net->last_error, ER(ER_OUT_OF_RESOURCES),
+                sizeof(net->last_error)-1);
+        net->last_errno= ER_OUT_OF_RESOURCES;
+      }
+    }
   }
 }
 

From fd324dd3ff92594e8aa7fc04b0481639788c41c2 Mon Sep 17 00:00:00 2001
From: Marc Alff <marc.alff@sun.com>
Date: Mon, 11 Aug 2008 15:08:12 -0600
Subject: [PATCH 32/33] Bug#37302 (missing DBUG_RETURN macro in function
 "find_key_block" (5.0 only))

Fixed missing DBUG_RETURN in the function find_key_block
---
 mysys/mf_keycache.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index f27ade7bfc0..0720d172317 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -1382,7 +1382,7 @@ restart:
       /* We don't need the page in the cache: we are going to write on disk */
       hash_link->requests--;
       unlink_hash(keycache, hash_link);
-      return 0;
+      DBUG_RETURN(0);
     }
     if (!(block->status & BLOCK_IN_FLUSH))
     {
@@ -1399,7 +1399,7 @@ restart:
         flag (see the code below that handles reading requests).
       */
       free_block(keycache, block);
-      return 0;
+      DBUG_RETURN(0);
     }
     /* Wait intil the page is flushed on disk */
     hash_link->requests--;
@@ -1429,7 +1429,7 @@ restart:
     /* Invalidate page in the block if it has not been done yet */
     if (block->status)
       free_block(keycache, block);
-    return 0;
+    DBUG_RETURN(0);
   }
 
   if (page_status == PAGE_READ &&

From d5620961a6acf7d334726dd0a9739b91c2f8a375 Mon Sep 17 00:00:00 2001
From: Davi Arnaut <Davi.Arnaut@Sun.COM>
Date: Mon, 11 Aug 2008 20:27:09 -0300
Subject: [PATCH 33/33] Bug#38486: Crash when using cursor protocol

Post-merge fix: mysql_client_test.c is compiled by C compilers
and some C compilers don't support mixed declarations and code
and it's explicitly forbidden by ISO C90.
---
 tests/mysql_client_test.c | 41 +++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 4336bfa0c59..ac5473a1ccd 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -16196,25 +16196,28 @@ static void test_bug32265()
 
 static void test_bug38486(void)
 {
-    myheader("test_bug38486");
-    
-    MYSQL_STMT *stmt;
-    stmt= mysql_stmt_init(mysql);
-    unsigned long type= CURSOR_TYPE_READ_ONLY;
-    mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
-    const char *sql= "CREATE TABLE t1 (a INT)";
-    mysql_stmt_prepare(stmt,sql,strlen(sql));
-    
-    mysql_stmt_execute(stmt);
-    mysql_stmt_close(stmt);
-    
-    stmt= mysql_stmt_init(mysql);
-    mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
-    const char *sql2= "INSERT INTO t1 VALUES (1)";
-    mysql_stmt_prepare(stmt,sql2,strlen(sql2));
-    mysql_stmt_execute(stmt);
-    
-    mysql_stmt_close(stmt);
+  MYSQL_STMT *stmt;
+  const char *stmt_text;
+  unsigned long type= CURSOR_TYPE_READ_ONLY;
+
+  DBUG_ENTER("test_bug38486");
+  myheader("test_bug38486");
+
+  stmt= mysql_stmt_init(mysql);
+  mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
+  stmt_text= "CREATE TABLE t1 (a INT)";
+  mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+  mysql_stmt_execute(stmt);
+  mysql_stmt_close(stmt);
+
+  stmt= mysql_stmt_init(mysql);
+  mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
+  stmt_text= "INSERT INTO t1 VALUES (1)";
+  mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+  mysql_stmt_execute(stmt);
+  mysql_stmt_close(stmt);
+
+  DBUG_VOID_RETURN;
 }