summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bindar <robert@mariadb.org>2019-04-24 09:00:59 +0300
committerSergey Vojtovich <svoj@mariadb.org>2019-06-06 22:09:31 +0400
commitbf70430ead122649fd22f0d4c52f49451569d6c3 (patch)
treef3f901e265ddf04a60c812e1671b8198fbe10239
parentab190194cfa5243492c452722463e56c74c49f9b (diff)
downloadmariadb-git-bf70430ead122649fd22f0d4c52f49451569d6c3.tar.gz
MDEV-17709 Remove handlerton::state
-rw-r--r--sql/ha_partition.cc1
-rw-r--r--sql/ha_sequence.cc1
-rw-r--r--sql/handler.cc228
-rw-r--r--sql/handler.h10
-rw-r--r--sql/log.cc10
-rw-r--r--sql/sql_reload.cc2
-rw-r--r--sql/sql_show.cc7
-rw-r--r--sql/sql_tablespace.cc2
-rw-r--r--storage/archive/ha_archive.cc1
-rw-r--r--storage/blackhole/ha_blackhole.cc1
-rw-r--r--storage/cassandra/ha_cassandra.cc1
-rw-r--r--storage/connect/ha_connect.cc1
-rw-r--r--storage/csv/ha_tina.cc1
-rw-r--r--storage/example/ha_example.cc1
-rw-r--r--storage/federated/ha_federated.cc1
-rw-r--r--storage/federatedx/ha_federatedx.cc1
-rw-r--r--storage/heap/ha_heap.cc1
-rw-r--r--storage/innobase/handler/ha_innodb.cc1
-rw-r--r--storage/maria/ha_maria.cc1
-rw-r--r--storage/mroonga/ha_mroonga.cpp1
-rw-r--r--storage/myisam/ha_myisam.cc1
-rw-r--r--storage/oqgraph/ha_oqgraph.cc1
-rw-r--r--storage/perfschema/ha_perfschema.cc1
-rw-r--r--storage/rocksdb/ha_rocksdb.cc1
-rw-r--r--storage/sphinx/ha_sphinx.cc1
-rw-r--r--storage/spider/spd_table.cc1
-rw-r--r--storage/tokudb/hatoku_hton.cc1
27 files changed, 104 insertions, 176 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 8f5e4e33e47..3050c62d908 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -126,7 +126,6 @@ static int partition_initialize(void *p)
handlerton *partition_hton;
partition_hton= (handlerton *)p;
- partition_hton->state= SHOW_OPTION_YES;
partition_hton->db_type= DB_TYPE_PARTITION_DB;
partition_hton->create= partition_create_handler;
partition_hton->partition_flags= partition_flags;
diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc
index ad5e54ba82e..d676e4d41f6 100644
--- a/sql/ha_sequence.cc
+++ b/sql/ha_sequence.cc
@@ -413,7 +413,6 @@ static int sequence_initialize(void *p)
handlerton *local_sequence_hton= (handlerton *)p;
DBUG_ENTER("sequence_initialize");
- local_sequence_hton->state= SHOW_OPTION_YES;
local_sequence_hton->db_type= DB_TYPE_SEQUENCE;
local_sequence_hton->create= sequence_create_handler;
local_sequence_hton->panic= sequence_end;
diff --git a/sql/handler.cc b/sql/handler.cc
index b3487e69670..5f368720390 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -271,7 +271,7 @@ handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc,
DBUG_ENTER("get_new_handler");
DBUG_PRINT("enter", ("alloc: %p", alloc));
- if (db_type && db_type->state == SHOW_OPTION_YES && db_type->create)
+ if (ha_storage_engine_is_enabled(db_type))
{
if ((file= db_type->create(db_type, share, alloc)))
file->init();
@@ -456,15 +456,8 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
if (!hton)
goto end;
- switch (hton->state) {
- case SHOW_OPTION_NO:
- case SHOW_OPTION_DISABLED:
- break;
- case SHOW_OPTION_YES:
- if (installed_htons[hton->db_type] == hton)
- installed_htons[hton->db_type]= NULL;
- break;
- };
+ if (installed_htons[hton->db_type] == hton)
+ installed_htons[hton->db_type]= NULL;
if (hton->panic)
hton->panic(hton, HA_PANIC_CLOSE);
@@ -531,7 +524,7 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
if (plugin->plugin->init && plugin->plugin->init(hton))
{
sql_print_error("Plugin '%s' init function returned error.",
- plugin->name.str);
+ plugin->name.str);
goto err;
}
@@ -550,90 +543,78 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
hton->discover_table_existence= full_discover_for_existence;
}
- switch (hton->state) {
- case SHOW_OPTION_NO:
- break;
- case SHOW_OPTION_YES:
- {
- uint tmp;
- ulong fslot;
-
- DBUG_EXECUTE_IF("unstable_db_type", {
- static int i= (int) DB_TYPE_FIRST_DYNAMIC;
- hton->db_type= (enum legacy_db_type)++i;
- });
-
- /* now check the db_type for conflict */
- if (hton->db_type <= DB_TYPE_UNKNOWN ||
- hton->db_type >= DB_TYPE_DEFAULT ||
- installed_htons[hton->db_type])
- {
- int idx= (int) DB_TYPE_FIRST_DYNAMIC;
+ uint tmp;
+ ulong fslot;
- while (idx < (int) DB_TYPE_DEFAULT && installed_htons[idx])
- idx++;
+ DBUG_EXECUTE_IF("unstable_db_type", {
+ static int i= (int) DB_TYPE_FIRST_DYNAMIC;
+ hton->db_type= (enum legacy_db_type)++i;
+ });
- if (idx == (int) DB_TYPE_DEFAULT)
- {
- sql_print_warning("Too many storage engines!");
- goto err_deinit;
- }
- if (hton->db_type != DB_TYPE_UNKNOWN)
- sql_print_warning("Storage engine '%s' has conflicting typecode. "
- "Assigning value %d.", plugin->plugin->name, idx);
- hton->db_type= (enum legacy_db_type) idx;
- }
+ /* now check the db_type for conflict */
+ if (hton->db_type <= DB_TYPE_UNKNOWN ||
+ hton->db_type >= DB_TYPE_DEFAULT ||
+ installed_htons[hton->db_type])
+ {
+ int idx= (int) DB_TYPE_FIRST_DYNAMIC;
- /*
- In case a plugin is uninstalled and re-installed later, it should
- reuse an array slot. Otherwise the number of uninstall/install
- cycles would be limited. So look for a free slot.
- */
- DBUG_PRINT("plugin", ("total_ha: %lu", total_ha));
- for (fslot= 0; fslot < total_ha; fslot++)
- {
- if (!hton2plugin[fslot])
- break;
- }
- if (fslot < total_ha)
- hton->slot= fslot;
- else
- {
- if (total_ha >= MAX_HA)
- {
- sql_print_error("Too many plugins loaded. Limit is %lu. "
- "Failed on '%s'", (ulong) MAX_HA, plugin->name.str);
- goto err_deinit;
- }
- hton->slot= total_ha++;
- }
- installed_htons[hton->db_type]= hton;
- tmp= hton->savepoint_offset;
- hton->savepoint_offset= savepoint_alloc_size;
- savepoint_alloc_size+= tmp;
- hton2plugin[hton->slot]=plugin;
- if (hton->prepare)
- {
- total_ha_2pc++;
- if (tc_log && tc_log != get_tc_log_implementation())
- {
- total_ha_2pc--;
- hton->prepare= 0;
- push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
- ER_UNKNOWN_ERROR,
- "Cannot enable tc-log at run-time. "
- "XA features of %s are disabled",
- plugin->name.str);
- }
- }
+ while (idx < (int) DB_TYPE_DEFAULT && installed_htons[idx])
+ idx++;
+
+ if (idx == (int) DB_TYPE_DEFAULT)
+ {
+ sql_print_warning("Too many storage engines!");
+ goto err_deinit;
+ }
+ if (hton->db_type != DB_TYPE_UNKNOWN)
+ sql_print_warning("Storage engine '%s' has conflicting typecode. "
+ "Assigning value %d.", plugin->plugin->name, idx);
+ hton->db_type= (enum legacy_db_type) idx;
+ }
+
+ /*
+ In case a plugin is uninstalled and re-installed later, it should
+ reuse an array slot. Otherwise the number of uninstall/install
+ cycles would be limited. So look for a free slot.
+ */
+ DBUG_PRINT("plugin", ("total_ha: %lu", total_ha));
+ for (fslot= 0; fslot < total_ha; fslot++)
+ {
+ if (!hton2plugin[fslot])
break;
+ }
+ if (fslot < total_ha)
+ hton->slot= fslot;
+ else
+ {
+ if (total_ha >= MAX_HA)
+ {
+ sql_print_error("Too many plugins loaded. Limit is %lu. "
+ "Failed on '%s'", (ulong) MAX_HA, plugin->name.str);
+ goto err_deinit;
}
- /* fall through */
- default:
- hton->state= SHOW_OPTION_DISABLED;
- break;
+ hton->slot= total_ha++;
}
-
+ installed_htons[hton->db_type]= hton;
+ tmp= hton->savepoint_offset;
+ hton->savepoint_offset= savepoint_alloc_size;
+ savepoint_alloc_size+= tmp;
+ hton2plugin[hton->slot]=plugin;
+ if (hton->prepare)
+ {
+ total_ha_2pc++;
+ if (tc_log && tc_log != get_tc_log_implementation())
+ {
+ total_ha_2pc--;
+ hton->prepare= 0;
+ push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_UNKNOWN_ERROR,
+ "Cannot enable tc-log at run-time. "
+ "XA features of %s are disabled",
+ plugin->name.str);
+ }
+ }
+
/*
This is entirely for legacy. We will create a new "disk based" hton and a
"memory" hton which will be configurable longterm. We should be able to
@@ -668,10 +649,10 @@ err_deinit:
*/
if (plugin->plugin->deinit)
(void) plugin->plugin->deinit(NULL);
-
+
err:
#ifdef DBUG_ASSERT_EXISTS
- if (hton->prepare && hton->state == SHOW_OPTION_YES)
+ if (hton->prepare)
failed_ha_2pc++;
#endif
my_free(hton);
@@ -716,7 +697,7 @@ static my_bool dropdb_handlerton(THD *unused1, plugin_ref plugin,
void *path)
{
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->drop_database)
+ if (hton->drop_database)
hton->drop_database(hton, (char *)path);
return FALSE;
}
@@ -732,7 +713,7 @@ static my_bool checkpoint_state_handlerton(THD *unused1, plugin_ref plugin,
void *disable)
{
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->checkpoint_state)
+ if (hton->checkpoint_state)
hton->checkpoint_state(hton, (int) *(bool*) disable);
return FALSE;
}
@@ -754,7 +735,7 @@ static my_bool commit_checkpoint_request_handlerton(THD *unused1, plugin_ref plu
{
st_commit_checkpoint_request *st= (st_commit_checkpoint_request *)data;
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->commit_checkpoint_request)
+ if (hton->commit_checkpoint_request)
{
void *cookie= st->cookie;
if (st->pre_hook)
@@ -811,8 +792,7 @@ static my_bool kill_handlerton(THD *thd, plugin_ref plugin,
{
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->kill_query &&
- thd_get_ha_data(thd, hton))
+ if (hton->kill_query && thd_get_ha_data(thd, hton))
hton->kill_query(hton, thd, *(enum thd_kill_levels *) level);
return FALSE;
}
@@ -833,7 +813,7 @@ static my_bool plugin_prepare_for_backup(THD *unused1, plugin_ref plugin,
void *not_used)
{
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->prepare_for_backup)
+ if (hton->prepare_for_backup)
hton->prepare_for_backup();
return FALSE;
}
@@ -849,7 +829,7 @@ static my_bool plugin_end_backup(THD *unused1, plugin_ref plugin,
void *not_used)
{
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->end_backup)
+ if (hton->end_backup)
hton->end_backup();
return FALSE;
}
@@ -1927,7 +1907,7 @@ static my_bool xacommit_handlerton(THD *unused1, plugin_ref plugin,
void *arg)
{
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->recover)
+ if (hton->recover)
{
hton->commit_by_xid(hton, ((struct xahton_st *)arg)->xid);
((struct xahton_st *)arg)->result= 0;
@@ -1939,7 +1919,7 @@ static my_bool xarollback_handlerton(THD *unused1, plugin_ref plugin,
void *arg)
{
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->recover)
+ if (hton->recover)
{
hton->rollback_by_xid(hton, ((struct xahton_st *)arg)->xid);
((struct xahton_st *)arg)->result= 0;
@@ -2070,7 +2050,7 @@ static my_bool xarecover_handlerton(THD *unused, plugin_ref plugin,
struct xarecover_st *info= (struct xarecover_st *) arg;
int got;
- if (hton->state == SHOW_OPTION_YES && hton->recover)
+ if (hton->recover)
{
while ((got= hton->recover(hton, info->list, info->len)) > 0 )
{
@@ -2415,8 +2395,7 @@ static my_bool snapshot_handlerton(THD *thd, plugin_ref plugin,
void *arg)
{
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES &&
- hton->start_consistent_snapshot)
+ if (hton->start_consistent_snapshot)
{
if (hton->start_consistent_snapshot(hton, thd))
return TRUE;
@@ -2462,28 +2441,14 @@ static my_bool flush_handlerton(THD *thd, plugin_ref plugin,
void *arg)
{
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->flush_logs &&
- hton->flush_logs(hton))
- return TRUE;
- return FALSE;
+ return hton->flush_logs && hton->flush_logs(hton);
}
-bool ha_flush_logs(handlerton *db_type)
+bool ha_flush_logs()
{
- if (db_type == NULL)
- {
- if (plugin_foreach(NULL, flush_handlerton,
- MYSQL_STORAGE_ENGINE_PLUGIN, 0))
- return TRUE;
- }
- else
- {
- if (db_type->state != SHOW_OPTION_YES ||
- (db_type->flush_logs && db_type->flush_logs(db_type)))
- return TRUE;
- }
- return FALSE;
+ return plugin_foreach(NULL, flush_handlerton,
+ MYSQL_STORAGE_ENGINE_PLUGIN, 0);
}
@@ -5316,7 +5281,7 @@ static my_bool discover_handlerton(THD *thd, plugin_ref plugin,
{
TABLE_SHARE *share= (TABLE_SHARE *)arg;
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->discover_table)
+ if (hton->discover_table)
{
share->db_plugin= plugin;
int error= hton->discover_table(hton, thd, share);
@@ -5392,7 +5357,7 @@ static my_bool discover_existence(THD *thd, plugin_ref plugin,
{
st_discover_existence_args *args= (st_discover_existence_args*)arg;
handlerton *ht= plugin_hton(plugin);
- if (ht->state != SHOW_OPTION_YES || !ht->discover_table_existence)
+ if (!ht->discover_table_existence)
return args->frm_exists;
args->hton= ht;
@@ -5682,7 +5647,7 @@ static my_bool discover_names(THD *thd, plugin_ref plugin,
st_discover_names_args *args= (st_discover_names_args *)arg;
handlerton *ht= plugin_hton(plugin);
- if (ht->state == SHOW_OPTION_YES && ht->discover_table_names)
+ if (ht->discover_table_names)
{
size_t old_elements= args->result->tables->elements();
if (ht->discover_table_names(ht, args->db, args->dirp, args->result))
@@ -6083,7 +6048,7 @@ static my_bool showstat_handlerton(THD *thd, plugin_ref plugin,
{
enum ha_stat_type stat= *(enum ha_stat_type *) arg;
handlerton *hton= plugin_hton(plugin);
- if (hton->state == SHOW_OPTION_YES && hton->show_status &&
+ if (hton->show_status &&
hton->show_status(hton, thd, stat_print, stat))
return TRUE;
return FALSE;
@@ -6115,17 +6080,8 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
}
else
{
- if (db_type->state != SHOW_OPTION_YES)
- {
- const LEX_CSTRING *name= hton_name(db_type);
- result= stat_print(thd, name->str, name->length,
- "", 0, "DISABLED", 8) ? 1 : 0;
- }
- else
- {
- result= db_type->show_status &&
- db_type->show_status(db_type, thd, stat_print, stat) ? 1 : 0;
- }
+ result= db_type->show_status &&
+ db_type->show_status(db_type, thd, stat_print, stat) ? 1 : 0;
}
/*
diff --git a/sql/handler.h b/sql/handler.h
index 476244f6325..ccd5f038b70 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1243,11 +1243,6 @@ typedef struct st_order ORDER;
struct handlerton
{
/*
- Historical marker for if the engine is available of not
- */
- SHOW_COMP_OPTION state;
-
- /*
Historical number used for frm file to determine the correct
storage engine. This is going away and new engines will just use
"name" for this.
@@ -4859,8 +4854,7 @@ static inline bool ha_check_storage_engine_flag(const handlerton *db_type, uint3
static inline bool ha_storage_engine_is_enabled(const handlerton *db_type)
{
- return (db_type && db_type->create) ?
- (db_type->state == SHOW_OPTION_YES) : FALSE;
+ return db_type && db_type->create;
}
#define view_pseudo_hton ((handlerton *)1)
@@ -4876,7 +4870,7 @@ TYPELIB *ha_known_exts(void);
int ha_panic(enum ha_panic_function flag);
void ha_close_connection(THD* thd);
void ha_kill_query(THD* thd, enum thd_kill_levels level);
-bool ha_flush_logs(handlerton *db_type);
+bool ha_flush_logs();
void ha_drop_database(char* path);
void ha_checkpoint_state(bool disable);
void ha_commit_checkpoint_request(void *cookie, void (*pre_hook)(void *));
diff --git a/sql/log.cc b/sql/log.cc
index 30a966ed95f..78c1debcb4d 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1680,9 +1680,6 @@ binlog_trans_log_truncate(THD *thd, my_off_t pos)
int binlog_init(void *p)
{
binlog_hton= (handlerton *)p;
- binlog_hton->state= (WSREP_ON || opt_bin_log) ? SHOW_OPTION_YES
- : SHOW_OPTION_NO;
- binlog_hton->db_type=DB_TYPE_BINLOG;
binlog_hton->savepoint_offset= sizeof(my_off_t);
binlog_hton->close_connection= binlog_close_connection;
binlog_hton->savepoint_set= binlog_savepoint_set;
@@ -1691,8 +1688,11 @@ int binlog_init(void *p)
binlog_savepoint_rollback_can_release_mdl;
binlog_hton->commit= binlog_commit;
binlog_hton->rollback= binlog_rollback;
- binlog_hton->prepare= binlog_prepare;
- binlog_hton->start_consistent_snapshot= binlog_start_consistent_snapshot;
+ if (WSREP_ON || opt_bin_log)
+ {
+ binlog_hton->prepare= binlog_prepare;
+ binlog_hton->start_consistent_snapshot= binlog_start_consistent_snapshot;
+ }
binlog_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN;
return 0;
}
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index 0e166b169aa..5562de8d8d5 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -133,7 +133,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
logger.flush_general_log();
if (options & REFRESH_ENGINE_LOG)
- if (ha_flush_logs(NULL))
+ if (ha_flush_logs())
result= 1;
if (options & REFRESH_BINARY_LOG)
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index a9a013bc1d2..3d2bc310004 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -6148,12 +6148,11 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
LEX_CSTRING yesno[2]= {{ STRING_WITH_LEN("NO") },
{ STRING_WITH_LEN("YES") }};
LEX_CSTRING *tmp;
- const char *option_name= show_comp_option_name[(int) hton->state];
+ const char *option_name= default_type != hton ? yesno[1].str
+ : "DEFAULT";
restore_record(table, s->default_values);
table->field[0]->store(name->str, name->length, scs);
- if (hton->state == SHOW_OPTION_YES && default_type == hton)
- option_name= "DEFAULT";
table->field[1]->store(option_name, strlen(option_name), scs);
table->field[2]->store(plugin_decl(plugin)->descr,
strlen(plugin_decl(plugin)->descr), scs);
@@ -8796,7 +8795,7 @@ static my_bool run_hton_fill_schema_table(THD *thd, plugin_ref plugin,
struct run_hton_fill_schema_table_args *args=
(run_hton_fill_schema_table_args *) arg;
handlerton *hton= plugin_hton(plugin);
- if (hton->fill_is_table && hton->state == SHOW_OPTION_YES)
+ if (hton->fill_is_table)
hton->fill_is_table(hton, thd, args->tables, args->cond,
get_schema_table_idx(args->tables->schema_table));
return false;
diff --git a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc
index d912fabe8c8..bfbaf185243 100644
--- a/sql/sql_tablespace.cc
+++ b/sql/sql_tablespace.cc
@@ -32,7 +32,7 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info)
If the user haven't defined an engine, this will fallback to using the
default storage engine.
*/
- if (hton == NULL || hton->state != SHOW_OPTION_YES)
+ if (hton == NULL)
{
hton= ha_default_handlerton(thd);
if (ts_info->storage_engine != 0)
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 0cf9763a0ee..b62f78ad318 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -215,7 +215,6 @@ int archive_db_init(void *p)
#endif
archive_hton= (handlerton *)p;
- archive_hton->state= SHOW_OPTION_YES;
archive_hton->db_type= DB_TYPE_ARCHIVE_DB;
archive_hton->create= archive_create_handler;
archive_hton->flags= HTON_NO_FLAGS;
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index 3180fe4bbfc..c3be2e5f768 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -380,7 +380,6 @@ static int blackhole_init(void *p)
#endif
blackhole_hton= (handlerton *)p;
- blackhole_hton->state= SHOW_OPTION_YES;
blackhole_hton->db_type= DB_TYPE_BLACKHOLE_DB;
blackhole_hton->create= blackhole_create_handler;
blackhole_hton->flags= HTON_CAN_RECREATE;
diff --git a/storage/cassandra/ha_cassandra.cc b/storage/cassandra/ha_cassandra.cc
index 4f9e207235f..fbce6b61f17 100644
--- a/storage/cassandra/ha_cassandra.cc
+++ b/storage/cassandra/ha_cassandra.cc
@@ -245,7 +245,6 @@ static int cassandra_init_func(void *p)
(void) my_hash_init(&cassandra_open_tables,system_charset_info,32,0,0,
(my_hash_get_key) cassandra_get_key,0,0);
- cassandra_hton->state= SHOW_OPTION_YES;
cassandra_hton->create= cassandra_create_handler;
/*
Don't specify HTON_CAN_RECREATE in flags. re-create is used by TRUNCATE
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index b746bb3d962..8e0927f3082 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -758,7 +758,6 @@ static int connect_init_func(void *p)
init_connect_psi_keys();
connect_hton= (handlerton *)p;
- connect_hton->state= SHOW_OPTION_YES;
connect_hton->create= connect_create_handler;
connect_hton->flags= HTON_TEMPORARY_NOT_SUPPORTED;
connect_hton->table_options= connect_table_option_list;
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 3ff3b5bd1ba..8a27ea19b3d 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -168,7 +168,6 @@ static int tina_init_func(void *p)
mysql_mutex_init(csv_key_mutex_tina, &tina_mutex, MY_MUTEX_INIT_FAST);
(void) my_hash_init(&tina_open_tables,system_charset_info,32,0,0,
(my_hash_get_key) tina_get_key,0,0);
- tina_hton->state= SHOW_OPTION_YES;
tina_hton->db_type= DB_TYPE_CSV_DB;
tina_hton->create= tina_create_handler;
tina_hton->flags= (HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES |
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 643fa1ae09a..477aacd666e 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -257,7 +257,6 @@ static int example_init_func(void *p)
#endif
example_hton= (handlerton *)p;
- example_hton->state= SHOW_OPTION_YES;
example_hton->create= example_create_handler;
example_hton->flags= HTON_CAN_RECREATE;
example_hton->table_options= example_table_option_list;
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 79e70ce5123..81367f0a80f 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -480,7 +480,6 @@ int federated_db_init(void *p)
#endif /* HAVE_PSI_INTERFACE */
handlerton *federated_hton= (handlerton *)p;
- federated_hton->state= SHOW_OPTION_YES;
federated_hton->db_type= DB_TYPE_FEDERATED_DB;
federated_hton->commit= federated_commit;
federated_hton->rollback= federated_rollback;
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index 932791c9d46..7a83440cc19 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -426,7 +426,6 @@ int federatedx_db_init(void *p)
DBUG_ENTER("federatedx_db_init");
init_federated_psi_keys();
federatedx_hton= (handlerton *)p;
- federatedx_hton->state= SHOW_OPTION_YES;
/* Needed to work with old .frm files */
federatedx_hton->db_type= DB_TYPE_FEDERATED_DB;
federatedx_hton->savepoint_offset= sizeof(ulong);
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 73857a14a2f..846c9322090 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -49,7 +49,6 @@ int heap_init(void *p)
#endif
heap_hton= (handlerton *)p;
- heap_hton->state= SHOW_OPTION_YES;
heap_hton->db_type= DB_TYPE_HEAP;
heap_hton->create= heap_create_handler;
heap_hton->panic= heap_panic;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 0e8fbfac599..e6bddd32438 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4015,7 +4015,6 @@ static int innodb_init(void* p)
handlerton* innobase_hton= static_cast<handlerton*>(p);
innodb_hton_ptr = innobase_hton;
- innobase_hton->state = SHOW_OPTION_YES;
innobase_hton->db_type = DB_TYPE_INNODB;
innobase_hton->savepoint_offset = sizeof(trx_named_savept_t);
innobase_hton->close_connection = innobase_close_connection;
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 513213a13f5..fb41ce525e2 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -3588,7 +3588,6 @@ static int ha_maria_init(void *p)
#endif
maria_hton= (handlerton *)p;
- maria_hton->state= SHOW_OPTION_YES;
maria_hton->db_type= DB_TYPE_ARIA;
maria_hton->create= maria_create_handler;
maria_hton->panic= maria_hton_panic;
diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp
index 81da26dc8ef..f99c3693462 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -1806,7 +1806,6 @@ static int mrn_init(void *p)
// init handlerton
grn_ctx *ctx = NULL;
handlerton *hton = static_cast<handlerton *>(p);
- hton->state = SHOW_OPTION_YES;
hton->create = mrn_handler_create;
hton->flags = HTON_NO_FLAGS;
#ifndef MRN_SUPPORT_PARTITION
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 19382ee4a50..218033edc4f 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -2493,7 +2493,6 @@ static int myisam_init(void *p)
myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size);
hton= (handlerton *)p;
- hton->state= SHOW_OPTION_YES;
hton->db_type= DB_TYPE_MYISAM;
hton->create= myisam_create_handler;
hton->panic= myisam_panic;
diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc
index 4154f89028a..2770fa97777 100644
--- a/storage/oqgraph/ha_oqgraph.cc
+++ b/storage/oqgraph/ha_oqgraph.cc
@@ -179,7 +179,6 @@ static int oqgraph_init(void *p)
handlerton *hton= (handlerton *)p;
DBUG_PRINT( "oq-debug", ("oqgraph_init"));
- hton->state= SHOW_OPTION_YES;
hton->db_type= DB_TYPE_AUTOASSIGN;
hton->create= oqgraph_create_handler;
hton->flags= HTON_ALTER_NOT_SUPPORTED;
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index cb5805db5da..8f6346fcf15 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -83,7 +83,6 @@ static int pfs_init_func(void *p)
pfs_hton= reinterpret_cast<handlerton *> (p);
- pfs_hton->state= SHOW_OPTION_YES;
pfs_hton->create= pfs_create_handler;
pfs_hton->show_status= pfs_show_status;
pfs_hton->flags= HTON_ALTER_NOT_SUPPORTED |
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index c80722f22eb..fe517e9d9b5 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -4848,7 +4848,6 @@ static int rocksdb_init_func(void *const p) {
&rdb_block_cache_resize_mutex, MY_MUTEX_INIT_FAST);
Rdb_transaction::init_mutex();
- rocksdb_hton->state = SHOW_OPTION_YES;
rocksdb_hton->create = rocksdb_create_handler;
rocksdb_hton->close_connection = rocksdb_close_connection;
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index d7189f3e73c..544b7a80383 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -742,7 +742,6 @@ static int sphinx_init_func ( void * p )
#if MYSQL_VERSION_ID > 50100
handlerton * hton = (handlerton*) p;
- hton->state = SHOW_OPTION_YES;
hton->db_type = DB_TYPE_AUTOASSIGN;
hton->create = sphinx_create_handler;
hton->close_connection = sphinx_close_connection;
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index f5876706b94..fb29dc8dc04 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -6870,7 +6870,6 @@ int spider_db_init(
DBUG_ENTER("spider_db_init");
spider_hton_ptr = spider_hton;
- spider_hton->state = SHOW_OPTION_YES;
spider_hton->flags = HTON_NO_FLAGS;
#ifdef HTON_CAN_READ_CONNECT_STRING_IN_PARTITION
spider_hton->flags |= HTON_CAN_READ_CONNECT_STRING_IN_PARTITION;
diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc
index 81355ea20ff..a52f64dc807 100644
--- a/storage/tokudb/hatoku_hton.cc
+++ b/storage/tokudb/hatoku_hton.cc
@@ -348,7 +348,6 @@ static int tokudb_init_func(void *p) {
TOKUDB_SHARE::static_init();
tokudb::background::initialize();
- tokudb_hton->state = SHOW_OPTION_YES;
// tokudb_hton->flags= HTON_CAN_RECREATE; // QQQ this came from skeleton
tokudb_hton->flags = HTON_CLOSE_CURSORS_AT_COMMIT | HTON_SUPPORTS_EXTENDED_KEYS;