diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 0357804..21e4be4 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -3882,6 +3882,7 @@ row_import_for_mysql(
 	discard all remaining adaptive hash index entries, because the
 	adaptive hash index must be a subset of the table contents;
 	false positives are not tolerated. */
+#ifdef BTR_CUR_HASH_ADAPT
 	while (buf_LRU_drop_page_hash_for_tablespace(table)) {
 		if (trx_is_interrupted(trx)
 		    || srv_shutdown_state != SRV_SHUTDOWN_NONE) {
@@ -3889,6 +3890,7 @@ row_import_for_mysql(
 			break;
 		}
 	}
+#endif /* BTR_CUR_HASH_ADAPT */
 
 	if (err != DB_SUCCESS) {
 		char	table_name[MAX_FULL_NAME_LEN + 1];
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 49ac263..1026409 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -3539,6 +3539,7 @@ row_drop_table_for_mysql(
 			calling btr_search_drop_page_hash_index() while we
 			hold the InnoDB dictionary lock, we will drop any
 			adaptive hash index entries upfront. */
+#ifdef BTR_CUR_HASH_ADAPT
 			while (buf_LRU_drop_page_hash_for_tablespace(table)) {
 				if (trx_is_interrupted(trx)
 				    || srv_shutdown_state
@@ -3549,6 +3550,7 @@ row_drop_table_for_mysql(
 					goto funct_exit;
 				}
 			}
+#endif /* BTR_CUR_HASH_ADAPT */
 
 			/* Delete the link file if used. */
 			if (DICT_TF_HAS_DATA_DIR(table->flags)) {
