Commit 192e22ea authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: index options don't need hton anymore

parent dbd996e9
...@@ -250,7 +250,7 @@ static const size_t ha_option_type_sizeof[]= ...@@ -250,7 +250,7 @@ static const size_t ha_option_type_sizeof[]=
@retval FALSE OK @retval FALSE OK
*/ */
bool parse_option_list(THD* thd, handlerton *hton, void *option_struct_arg, bool parse_option_list(THD* thd, st_plugin_int *plugin, void *option_struct_arg,
engine_option_value **option_list, engine_option_value **option_list,
ha_create_table_option *rules, ha_create_table_option *rules,
bool suppress_warning, MEM_ROOT *root) bool suppress_warning, MEM_ROOT *root)
...@@ -326,7 +326,7 @@ bool parse_option_list(THD* thd, handlerton *hton, void *option_struct_arg, ...@@ -326,7 +326,7 @@ bool parse_option_list(THD* thd, handlerton *hton, void *option_struct_arg,
(thd->lex->sql_command == SQLCOM_CREATE_TABLE || seen)) (thd->lex->sql_command == SQLCOM_CREATE_TABLE || seen))
{ {
// take a value from the variable and add it to the list // take a value from the variable and add it to the list
sys_var *sysvar= find_hton_sysvar(hton, opt->var); sys_var *sysvar= find_plugin_sysvar(plugin, opt->var);
DBUG_ASSERT(sysvar); DBUG_ASSERT(sysvar);
if (!sysvar->session_is_default(thd)) if (!sysvar->session_is_default(thd))
...@@ -368,7 +368,7 @@ bool parse_option_list(THD* thd, handlerton *hton, void *option_struct_arg, ...@@ -368,7 +368,7 @@ bool parse_option_list(THD* thd, handlerton *hton, void *option_struct_arg,
This is done when an engine is loaded. This is done when an engine is loaded.
*/ */
static bool resolve_sysvars(handlerton *hton, ha_create_table_option *rules) bool resolve_sysvar_table_options(ha_create_table_option *rules)
{ {
for (ha_create_table_option *opt= rules; rules && opt->name; opt++) for (ha_create_table_option *opt= rules; rules && opt->name; opt++)
{ {
...@@ -421,13 +421,6 @@ static bool resolve_sysvars(handlerton *hton, ha_create_table_option *rules) ...@@ -421,13 +421,6 @@ static bool resolve_sysvars(handlerton *hton, ha_create_table_option *rules)
return 0; return 0;
} }
bool resolve_sysvar_table_options(handlerton *hton)
{
return resolve_sysvars(hton, hton->table_options) ||
resolve_sysvars(hton, hton->field_options) ||
resolve_sysvars(hton, hton->index_options);
}
/* /*
Restore HA_OPTION_TYPE_SYSVAR options back as they were Restore HA_OPTION_TYPE_SYSVAR options back as they were
before resolve_sysvars(). before resolve_sysvars().
...@@ -435,7 +428,7 @@ bool resolve_sysvar_table_options(handlerton *hton) ...@@ -435,7 +428,7 @@ bool resolve_sysvar_table_options(handlerton *hton)
This is done when the engine is unloaded, so that we could This is done when the engine is unloaded, so that we could
call resolve_sysvars() if the engine is installed again. call resolve_sysvars() if the engine is installed again.
*/ */
static void free_sysvars(handlerton *hton, ha_create_table_option *rules) void free_sysvar_table_options(ha_create_table_option *rules)
{ {
for (ha_create_table_option *opt= rules; rules && opt->name; opt++) for (ha_create_table_option *opt= rules; rules && opt->name; opt++)
{ {
...@@ -452,14 +445,6 @@ static void free_sysvars(handlerton *hton, ha_create_table_option *rules) ...@@ -452,14 +445,6 @@ static void free_sysvars(handlerton *hton, ha_create_table_option *rules)
} }
} }
void free_sysvar_table_options(handlerton *hton)
{
free_sysvars(hton, hton->table_options);
free_sysvars(hton, hton->field_options);
free_sysvars(hton, hton->index_options);
}
/** /**
Parses all table/fields/keys options Parses all table/fields/keys options
......
...@@ -89,16 +89,25 @@ class engine_option_value: public Sql_alloc ...@@ -89,16 +89,25 @@ class engine_option_value: public Sql_alloc
typedef struct st_key KEY; typedef struct st_key KEY;
class Create_field; class Create_field;
bool resolve_sysvar_table_options(handlerton *hton); bool resolve_sysvar_table_options(ha_create_table_option *rules);
void free_sysvar_table_options(handlerton *hton); void free_sysvar_table_options(ha_create_table_option *rules);
bool parse_engine_table_options(THD *thd, handlerton *ht, TABLE_SHARE *share); bool parse_engine_table_options(THD *thd, handlerton *ht, TABLE_SHARE *share);
#ifdef WITH_PARTITION_STORAGE_ENGINE #ifdef WITH_PARTITION_STORAGE_ENGINE
bool parse_engine_part_options(THD *thd, TABLE *table); bool parse_engine_part_options(THD *thd, TABLE *table);
#endif #endif
bool parse_option_list(THD* thd, handlerton *hton, void *option_struct, bool parse_option_list(THD* thd, st_plugin_int *plugin, void *option_struct,
engine_option_value **option_list, engine_option_value **option_list,
ha_create_table_option *rules, ha_create_table_option *rules,
bool suppress_warning, MEM_ROOT *root); bool suppress_warning, MEM_ROOT *root);
static inline bool parse_option_list(THD* thd, handlerton *hton,
void *option_struct, engine_option_value **option_list,
ha_create_table_option *rules, bool suppress_warning, MEM_ROOT *root)
{
return parse_option_list(thd, hton2plugin[hton->slot], option_struct,
option_list, rules, suppress_warning, root);
}
bool engine_table_options_frm_read(const uchar *buff, size_t length, bool engine_table_options_frm_read(const uchar *buff, size_t length,
TABLE_SHARE *share); TABLE_SHARE *share);
bool merge_engine_options(engine_option_value *source, bool merge_engine_options(engine_option_value *source,
......
...@@ -607,7 +607,9 @@ int ha_finalize_handlerton(st_plugin_int *plugin) ...@@ -607,7 +607,9 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
if (plugin->plugin->deinit) if (plugin->plugin->deinit)
deinit_status= plugin->plugin->deinit(NULL); deinit_status= plugin->plugin->deinit(NULL);
free_sysvar_table_options(hton); free_sysvar_table_options(hton->table_options);
free_sysvar_table_options(hton->field_options);
free_sysvar_table_options(hton->index_options);
update_discovery_counters(hton, -1); update_discovery_counters(hton, -1);
/* /*
...@@ -811,7 +813,9 @@ int ha_initialize_handlerton(st_plugin_int *plugin) ...@@ -811,7 +813,9 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
break; break;
}; };
resolve_sysvar_table_options(hton); resolve_sysvar_table_options(hton->table_options);
resolve_sysvar_table_options(hton->field_options);
resolve_sysvar_table_options(hton->index_options);
update_discovery_counters(hton, 1); update_discovery_counters(hton, 1);
if (ddl_recovery_done && hton->signal_ddl_recovery_done) if (ddl_recovery_done && hton->signal_ddl_recovery_done)
......
...@@ -1760,11 +1760,6 @@ static inline handlerton *plugin_hton(plugin_ref plugin) ...@@ -1760,11 +1760,6 @@ static inline handlerton *plugin_hton(plugin_ref plugin)
return plugin_data(plugin, handlerton *); return plugin_data(plugin, handlerton *);
} }
static inline sys_var *find_hton_sysvar(transaction_participant *hton, st_mysql_sys_var *var)
{
return find_plugin_sysvar(hton2plugin[hton->slot], var);
}
handlerton *ha_default_handlerton(THD *thd); handlerton *ha_default_handlerton(THD *thd);
handlerton *ha_default_tmp_handlerton(THD *thd); handlerton *ha_default_tmp_handlerton(THD *thd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment