diff --git a/mysql-test/include/have_archive.inc b/mysql-test/include/have_archive.inc
index 262f66076a85d125baa67700350eec4d5e424328..9f0038db97a5709048f4901d77f2327cc976f95d 100644
--- a/mysql-test/include/have_archive.inc
+++ b/mysql-test/include/have_archive.inc
@@ -1,4 +1,4 @@
---require r/have_archive.require
 --disable_query_log
-show variables like "have_archive";
+--require r/true.require
+select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'archive';
 --enable_query_log
diff --git a/mysql-test/include/have_blackhole.inc b/mysql-test/include/have_blackhole.inc
index c2b6ea1883073453b00872f22c99e33dd65ae295..e13cff52094542c6b850dfa72b01663e011a0d0d 100644
--- a/mysql-test/include/have_blackhole.inc
+++ b/mysql-test/include/have_blackhole.inc
@@ -1,4 +1,4 @@
--- require r/have_blackhole.require
 disable_query_log;
-show variables like "have_blackhole_engine";
+--require r/true.require
+select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'blackhole';
 enable_query_log;
diff --git a/mysql-test/include/have_csv.inc b/mysql-test/include/have_csv.inc
index d28199831b8fed08665660f1149de6fe1e68a99e..3175fc16fe7d14d1903932d5af69b00fafd65ea7 100644
--- a/mysql-test/include/have_csv.inc
+++ b/mysql-test/include/have_csv.inc
@@ -1,4 +1,4 @@
--- require r/have_csv.require
 disable_query_log;
-show variables like "have_csv";
+--require r/true.require
+select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'csv';
 enable_query_log;
diff --git a/mysql-test/include/have_exampledb.inc b/mysql-test/include/have_exampledb.inc
index 7ddd15c48b38ae909373567ad2e2ca30e82526fb..e3fd068b4856eb18173915790da1f52641d42edb 100644
--- a/mysql-test/include/have_exampledb.inc
+++ b/mysql-test/include/have_exampledb.inc
@@ -1,4 +1,4 @@
--- require r/have_exampledb.require
 disable_query_log;
-show variables like "have_example_engine";
+--require r/true.require
+select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'example';
 enable_query_log;
diff --git a/mysql-test/include/have_federated_db.inc b/mysql-test/include/have_federated_db.inc
index e4cf1366fdaf9f3c1cbf104b3220b33a954838ba..abef5a64d30febfff0f785aac40543320aa07de1 100644
--- a/mysql-test/include/have_federated_db.inc
+++ b/mysql-test/include/have_federated_db.inc
@@ -1,4 +1,4 @@
--- require r/have_federated_db.require
 disable_query_log;
-show variables like "have_federated_engine";
+--require r/true.require
+select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'federated';
 enable_query_log;
diff --git a/mysql-test/include/have_innodb.inc b/mysql-test/include/have_innodb.inc
index 4f83d378cbc6ed29f9b9ba5044e70dfc2e792d86..be8850725e5e061939da7d42ce9b46015a1b794f 100644
--- a/mysql-test/include/have_innodb.inc
+++ b/mysql-test/include/have_innodb.inc
@@ -1,4 +1,4 @@
--- require r/have_innodb.require
 disable_query_log;
-show variables like "have_innodb";
+--require r/true.require
+select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'innodb';
 enable_query_log;
diff --git a/mysql-test/include/have_multi_ndb.inc b/mysql-test/include/have_multi_ndb.inc
index 45a551274f7f42777f8e514183257cb579337d11..218a6852c4169cb3a74f3fbf72bb8228b25f6e1c 100644
--- a/mysql-test/include/have_multi_ndb.inc
+++ b/mysql-test/include/have_multi_ndb.inc
@@ -9,8 +9,8 @@ disable_query_log;
 drop table if exists t1, t2;
 --enable_warnings
 flush tables;
---require r/have_ndb.require
-show variables like "have_ndbcluster";
+--require r/true.require
+select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
 enable_query_log;
 
 # Check that server2 has NDB support
@@ -20,8 +20,8 @@ disable_query_log;
 drop table if exists t1, t2;
 --enable_warnings
 flush tables;
---require r/have_ndb.require
-show variables like "have_ndbcluster";
+--require r/true.require
+select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
 enable_query_log;
 
 # Set the default connection to 'server1'
diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc
index 8c277ea82a040699e97dcbb0e1a189f2d174c4b5..be339d412387e4df66e9820fb78b2910256574d1 100644
--- a/mysql-test/include/have_ndb.inc
+++ b/mysql-test/include/have_ndb.inc
@@ -1,7 +1,7 @@
 # Check that server is compiled and started with support for NDB
--- require r/have_ndb.require
 disable_query_log;
-show variables like "have_ndbcluster";
+--require r/true.require
+select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
 enable_query_log;
 
 # Check that NDB is installed and known to be working
diff --git a/mysql-test/r/have_archive.require b/mysql-test/r/have_archive.require
deleted file mode 100644
index c4b4ba24fcde193d20d6256c9cc1759fc290b930..0000000000000000000000000000000000000000
--- a/mysql-test/r/have_archive.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name	Value
-have_archive	YES
diff --git a/mysql-test/r/have_blackhole.require b/mysql-test/r/have_blackhole.require
deleted file mode 100644
index 15029a460f6b70514256f5685c88cca25959d1fe..0000000000000000000000000000000000000000
--- a/mysql-test/r/have_blackhole.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name	Value
-have_blackhole_engine	YES
diff --git a/mysql-test/r/have_csv.require b/mysql-test/r/have_csv.require
deleted file mode 100644
index cc2fb28289cfc8d27f8344bbf4d538a28907bf9c..0000000000000000000000000000000000000000
--- a/mysql-test/r/have_csv.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name	Value
-have_csv	YES
diff --git a/mysql-test/r/have_exampledb.require b/mysql-test/r/have_exampledb.require
deleted file mode 100644
index 29d0cf8b1a68642b3094eb350699759f8e78a8b3..0000000000000000000000000000000000000000
--- a/mysql-test/r/have_exampledb.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name	Value
-have_example_engine	YES
diff --git a/mysql-test/r/have_federated_db.require b/mysql-test/r/have_federated_db.require
deleted file mode 100644
index f4c521a8f3518b31e7cdf6f832bcdfb8ef626f6a..0000000000000000000000000000000000000000
--- a/mysql-test/r/have_federated_db.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name	Value
-have_federated_engine	YES
diff --git a/mysql-test/r/have_innodb.require b/mysql-test/r/have_innodb.require
deleted file mode 100644
index 48a764a6c584e987de554e0bcc1c80ee6bcf234b..0000000000000000000000000000000000000000
--- a/mysql-test/r/have_innodb.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name	Value
-have_innodb	YES
diff --git a/mysql-test/r/have_ndb.require b/mysql-test/r/have_ndb.require
deleted file mode 100644
index f0402b72c6a88abe493845338ae8a6e52c15df5b..0000000000000000000000000000000000000000
--- a/mysql-test/r/have_ndb.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name	Value
-have_ndbcluster	YES
diff --git a/mysql-test/r/have_raid.require b/mysql-test/r/have_raid.require
deleted file mode 100644
index 8390f4dbb8511458fbc0906ca81cc968e2f5dad0..0000000000000000000000000000000000000000
--- a/mysql-test/r/have_raid.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name	Value
-have_raid	YES
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 9ee3c3e2e03a28f5ea9370203564919766c0b34b..ea40e96c5347d8eb5a3f50f1217c133e60287ff3 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -1624,67 +1624,34 @@ extern TYPELIB log_output_typelib;
 
 /* optional things, have_* variables */
 
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
-extern handlerton *innobase_hton;
 extern SHOW_COMP_OPTION have_innodb;
-#else
-extern SHOW_COMP_OPTION have_innodb;
-#endif
-#ifdef WITH_EXAMPLE_STORAGE_ENGINE
-extern handlerton *example_hton;
-extern SHOW_COMP_OPTION have_example_db;
-#else
 extern SHOW_COMP_OPTION have_example_db;
-#endif
-#ifdef WITH_ARCHIVE_STORAGE_ENGINE
-extern handlerton *archive_hton;
-extern SHOW_COMP_OPTION have_archive_db;
-#else
 extern SHOW_COMP_OPTION have_archive_db;
-#endif
-#ifdef WITH_CSV_STORAGE_ENGINE
-extern handlerton *tina_hton;
 extern SHOW_COMP_OPTION have_csv_db;
-#else
-extern SHOW_COMP_OPTION have_csv_db;
-#endif
-#ifdef WITH_FEDERATED_STORAGE_ENGINE
-extern handlerton *federated_hton;
 extern SHOW_COMP_OPTION have_federated_db;
-#else
-extern SHOW_COMP_OPTION have_federated_db;
-#endif
-#ifdef WITH_BLACKHOLE_STORAGE_ENGINE
-extern handlerton *blackhole_hton;
-extern SHOW_COMP_OPTION have_blackhole_db;
-#else
 extern SHOW_COMP_OPTION have_blackhole_db;
+extern SHOW_COMP_OPTION have_ndbcluster;
+extern SHOW_COMP_OPTION have_partition_db;
+extern SHOW_COMP_OPTION have_merge_db;
+
+#ifdef WITH_CSV_STORAGE_ENGINE
+extern handlerton *tina_hton;
 #endif
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
 extern handlerton *ndbcluster_hton;
-extern SHOW_COMP_OPTION have_ndbcluster;
-#else
-extern SHOW_COMP_OPTION have_ndbcluster;
 #endif
 #ifdef WITH_PARTITION_STORAGE_ENGINE
 extern handlerton *partition_hton;
-extern SHOW_COMP_OPTION have_partition_db;
-#else
-extern SHOW_COMP_OPTION have_partition_db;
 #endif
-
 #ifdef WITH_MYISAMMRG_STORAGE_ENGINE
 extern handlerton *myisammrg_hton;
-extern SHOW_COMP_OPTION have_merge_db;
-#else
-extern SHOW_COMP_OPTION have_merge_db;
 #endif
 
 extern handlerton *myisam_hton;
 extern handlerton *heap_hton;
 
 extern SHOW_COMP_OPTION have_row_based_replication;
-extern SHOW_COMP_OPTION have_raid, have_openssl, have_symlink, have_dlopen;
+extern SHOW_COMP_OPTION have_openssl, have_symlink, have_dlopen;
 extern SHOW_COMP_OPTION have_query_cache;
 extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
 extern SHOW_COMP_OPTION have_crypt;