after review fixes

parent 4accfd29
...@@ -38,4 +38,3 @@ rpl_sp : BUG#16456 2006-02-16 jmiller ...@@ -38,4 +38,3 @@ rpl_sp : BUG#16456 2006-02-16 jmiller
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events #ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
ndb_dd_backuprestore : Nikolay: removed partitions from the test. Review pending.
This diff is collapsed.
...@@ -461,7 +461,7 @@ typedef bool (stat_print_fn)(THD *thd, const char *type, uint type_len, ...@@ -461,7 +461,7 @@ typedef bool (stat_print_fn)(THD *thd, const char *type, uint type_len,
const char *file, uint file_len, const char *file, uint file_len,
const char *status, uint status_len); const char *status, uint status_len);
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX }; enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
extern st_mysql_plugin *hton2plugin[MAX_HA]; extern st_plugin_int *hton2plugin[MAX_HA];
/* /*
handlerton is a singleton structure - one instance per storage engine - handlerton is a singleton structure - one instance per storage engine -
...@@ -1530,7 +1530,7 @@ static inline enum legacy_db_type ha_legacy_type(const handlerton *db_type) ...@@ -1530,7 +1530,7 @@ static inline enum legacy_db_type ha_legacy_type(const handlerton *db_type)
static inline const char *ha_resolve_storage_engine_name(const handlerton *db_type) static inline const char *ha_resolve_storage_engine_name(const handlerton *db_type)
{ {
return db_type == NULL ? "UNKNOWN" : hton2plugin[db_type->slot]->name; return db_type == NULL ? "UNKNOWN" : hton2plugin[db_type->slot]->name.str;
} }
static inline bool ha_check_storage_engine_flag(const handlerton *db_type, uint32 flag) static inline bool ha_check_storage_engine_flag(const handlerton *db_type, uint32 flag)
......
...@@ -3307,7 +3307,7 @@ byte *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type, ...@@ -3307,7 +3307,7 @@ byte *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type,
handlerton *val; handlerton *val;
val= (type == OPT_GLOBAL) ? global_system_variables.*offset : val= (type == OPT_GLOBAL) ? global_system_variables.*offset :
thd->variables.*offset; thd->variables.*offset;
return (byte *) hton2plugin[val->slot]->name; return (byte *) hton2plugin[val->slot]->name.str;
} }
......
...@@ -1665,8 +1665,8 @@ static int add_keyword_int(File fptr, const char *keyword, longlong num) ...@@ -1665,8 +1665,8 @@ static int add_keyword_int(File fptr, const char *keyword, longlong num)
static int add_engine(File fptr, handlerton *engine_type) static int add_engine(File fptr, handlerton *engine_type)
{ {
const char *engine_str= hton2plugin[engine_type->slot]->name; const char *engine_str= hton2plugin[engine_type->slot]->name.str;
DBUG_PRINT("info", ("ENGINE = %s", engine_str)); DBUG_PRINT("info", ("ENGINE: %s", engine_str));
int err= add_string(fptr, "ENGINE = "); int err= add_string(fptr, "ENGINE = ");
return err + add_string(fptr, engine_str); return err + add_string(fptr, engine_str);
} }
...@@ -1676,7 +1676,7 @@ static int add_partition_options(File fptr, partition_element *p_elem) ...@@ -1676,7 +1676,7 @@ static int add_partition_options(File fptr, partition_element *p_elem)
int err= 0; int err= 0;
if (p_elem->tablespace_name) if (p_elem->tablespace_name)
err+= add_keyword_string(fptr,"TABLESPACE", FALSE, err+= add_keyword_string(fptr,"TABLESPACE", FALSE,
p_elem->tablespace_name); p_elem->tablespace_name);
if (p_elem->nodegroup_id != UNDEF_NODEGROUP) if (p_elem->nodegroup_id != UNDEF_NODEGROUP)
err+= add_keyword_int(fptr,"NODEGROUP",(longlong)p_elem->nodegroup_id); err+= add_keyword_int(fptr,"NODEGROUP",(longlong)p_elem->nodegroup_id);
...@@ -4515,8 +4515,8 @@ the generated partition syntax in a correct manner. ...@@ -4515,8 +4515,8 @@ the generated partition syntax in a correct manner.
DBUG_PRINT("info", ("No explicit engine used")); DBUG_PRINT("info", ("No explicit engine used"));
create_info->db_type= table->part_info->default_engine_type; create_info->db_type= table->part_info->default_engine_type;
} }
DBUG_PRINT("info", ("New engine type = %s", DBUG_PRINT("info", ("New engine type: %s",
hton2plugin[create_info->db_type->slot]->name)); hton2plugin[create_info->db_type->slot]->name.str));
thd->work_part_info= NULL; thd->work_part_info= NULL;
*partition_changed= TRUE; *partition_changed= TRUE;
} }
......
...@@ -58,7 +58,8 @@ struct st_plugin_int ...@@ -58,7 +58,8 @@ struct st_plugin_int
struct st_mysql_plugin *plugin; struct st_mysql_plugin *plugin;
struct st_plugin_dl *plugin_dl; struct st_plugin_dl *plugin_dl;
enum enum_plugin_state state; enum enum_plugin_state state;
uint ref_count; /* number of threads using the plugin */ uint ref_count; /* number of threads using the plugin */
void *data; /* plugin type specific, e.g. handlerton */
}; };
typedef int (*plugin_type_init)(struct st_plugin_int *); typedef int (*plugin_type_init)(struct st_plugin_int *);
......
...@@ -55,12 +55,13 @@ static my_bool show_handlerton(THD *thd, st_plugin_int *plugin, ...@@ -55,12 +55,13 @@ static my_bool show_handlerton(THD *thd, st_plugin_int *plugin,
{ {
handlerton *default_type= (handlerton *) arg; handlerton *default_type= (handlerton *) arg;
Protocol *protocol= thd->protocol; Protocol *protocol= thd->protocol;
handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton; handlerton *hton= (handlerton *)plugin->data;
if (!(hton->flags & HTON_HIDDEN)) if (!(hton->flags & HTON_HIDDEN))
{ {
protocol->prepare_for_resend(); protocol->prepare_for_resend();
protocol->store(plugin->plugin->name, system_charset_info); protocol->store(plugin->name.str, plugin->name.length,
system_charset_info);
const char *option_name= show_comp_option_name[(int) hton->state]; const char *option_name= show_comp_option_name[(int) hton->state];
if (hton->state == SHOW_OPTION_YES && default_type == hton) if (hton->state == SHOW_OPTION_YES && default_type == hton)
...@@ -3091,7 +3092,7 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin, ...@@ -3091,7 +3092,7 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin,
void *ptable) void *ptable)
{ {
TABLE *table= (TABLE *) ptable; TABLE *table= (TABLE *) ptable;
handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton; handlerton *hton= (handlerton *)plugin->data;
const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS; const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
CHARSET_INFO *scs= system_charset_info; CHARSET_INFO *scs= system_charset_info;
DBUG_ENTER("iter_schema_engines"); DBUG_ENTER("iter_schema_engines");
...@@ -3099,7 +3100,7 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin, ...@@ -3099,7 +3100,7 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin,
if (!(hton->flags & HTON_HIDDEN)) if (!(hton->flags & HTON_HIDDEN))
{ {
if (!(wild && wild[0] && if (!(wild && wild[0] &&
wild_case_compare(scs, plugin->plugin->name,wild))) wild_case_compare(scs, plugin->name.str,wild)))
{ {
LEX_STRING state[2]={{STRING_WITH_LEN("ENABLED")}, LEX_STRING state[2]={{STRING_WITH_LEN("ENABLED")},
{STRING_WITH_LEN("DISABLED")}}; {STRING_WITH_LEN("DISABLED")}};
...@@ -3107,8 +3108,7 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin, ...@@ -3107,8 +3108,7 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin,
LEX_STRING *tmp; LEX_STRING *tmp;
restore_record(table, s->default_values); restore_record(table, s->default_values);
table->field[0]->store(plugin->plugin->name, table->field[0]->store(plugin->name.str, plugin->name.length, scs);
strlen(plugin->plugin->name), scs);
tmp= &state[test(hton->state)]; tmp= &state[test(hton->state)];
table->field[1]->store(tmp->str, tmp->length, scs); table->field[1]->store(tmp->str, tmp->length, scs);
table->field[2]->store(plugin->plugin->descr, table->field[2]->store(plugin->plugin->descr,
...@@ -5008,7 +5008,7 @@ static my_bool run_hton_fill_schema_files(THD *thd, st_plugin_int *plugin, ...@@ -5008,7 +5008,7 @@ static my_bool run_hton_fill_schema_files(THD *thd, st_plugin_int *plugin,
{ {
struct run_hton_fill_schema_files_args *args= struct run_hton_fill_schema_files_args *args=
(run_hton_fill_schema_files_args *) arg; (run_hton_fill_schema_files_args *) arg;
handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton; handlerton *hton= (handlerton *)plugin->data;
if(hton->fill_files_table) if(hton->fill_files_table)
hton->fill_files_table(thd, args->tables, args->cond); hton->fill_files_table(thd, args->tables, args->cond);
return false; return false;
......
...@@ -6465,7 +6465,7 @@ static bool check_engine(THD *thd, const char *table_name, ...@@ -6465,7 +6465,7 @@ static bool check_engine(THD *thd, const char *table_name,
if (create_info->used_fields & HA_CREATE_USED_ENGINE) if (create_info->used_fields & HA_CREATE_USED_ENGINE)
{ {
my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
hton2plugin[(*new_engine)->slot]->name, "TEMPORARY"); hton2plugin[(*new_engine)->slot]->name.str, "TEMPORARY");
*new_engine= 0; *new_engine= 0;
return TRUE; return TRUE;
} }
......
...@@ -35,7 +35,7 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info) ...@@ -35,7 +35,7 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_WARN_USING_OTHER_HANDLER, ER_WARN_USING_OTHER_HANDLER,
ER(ER_WARN_USING_OTHER_HANDLER), ER(ER_WARN_USING_OTHER_HANDLER),
hton2plugin[hton->slot]->name, hton2plugin[hton->slot]->name.str,
ts_info->tablespace_name ? ts_info->tablespace_name ts_info->tablespace_name ? ts_info->tablespace_name
: ts_info->logfile_group_name); : ts_info->logfile_group_name);
} }
...@@ -64,7 +64,7 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info) ...@@ -64,7 +64,7 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_ILLEGAL_HA_CREATE_OPTION, ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION), ER(ER_ILLEGAL_HA_CREATE_OPTION),
hton2plugin[hton->slot]->name, hton2plugin[hton->slot]->name.str,
"TABLESPACE or LOGFILE GROUP"); "TABLESPACE or LOGFILE GROUP");
} }
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
......
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