Commit 0de72ae9 authored by unknown's avatar unknown
Browse files

after review fixes


mysql-test/t/disabled.def:
  enable test
parent cc14a84c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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
#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.
+38 −39
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
   check for dups and to find handlerton from legacy_db_type.
   Remove when legacy_db_type is finally gone */
static handlerton *installed_htons[128];
st_mysql_plugin *hton2plugin[MAX_HA];
st_plugin_int *hton2plugin[MAX_HA];

#define BITMAP_STACKBUF_SIZE (128/8)

@@ -102,7 +102,7 @@ handlerton *ha_resolve_by_name(THD *thd, LEX_STRING *name)

  if ((plugin= plugin_lock(name, MYSQL_STORAGE_ENGINE_PLUGIN)))
  {
    handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
    handlerton *hton= (handlerton *)plugin->data;
    if (!(hton->flags & HTON_NOT_USER_SELECTABLE))
      return hton;
    plugin_unlock(plugin);
@@ -135,7 +135,7 @@ const char *ha_get_storage_engine(enum legacy_db_type db_type)
  default:
    if (db_type > DB_TYPE_UNKNOWN && db_type < DB_TYPE_DEFAULT &&
        installed_htons[db_type])
      return hton2plugin[installed_htons[db_type]->slot]->name;
      return hton2plugin[installed_htons[db_type]->slot]->name.str;
      return "*NONE*";
  }
}
@@ -351,22 +351,19 @@ static int ha_finish_errors(void)

int ha_finalize_handlerton(st_plugin_int *plugin)
{
  handlerton *hton;
  handlerton *hton= (handlerton *)plugin->data;
  DBUG_ENTER("ha_finalize_handlerton");

  if (!(hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton))
    DBUG_RETURN(1);

  switch (hton->state)
  {
  case SHOW_OPTION_NO:
  case SHOW_OPTION_DISABLED:
    break;
  case SHOW_OPTION_YES:
    if (hton->panic && hton->panic(HA_PANIC_CLOSE))
      DBUG_RETURN(1);
    if (installed_htons[hton->db_type] == hton)
      installed_htons[hton->db_type]= NULL;
    if (hton->panic && hton->panic(HA_PANIC_CLOSE))
      DBUG_RETURN(1);
    break;
  };
  DBUG_RETURN(0);
@@ -376,9 +373,10 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
int ha_initialize_handlerton(st_plugin_int *plugin)
{
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;

  DBUG_ENTER("ha_initialize_handlerton");

  plugin->data= hton; // shortcut for the future

  /*
    the switch below and hton->state should be removed when
    command-line options for plugins will be implemented
@@ -388,6 +386,7 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
    break;
  case SHOW_OPTION_YES:
    {
      uint tmp;
      /* now check the db_type for conflict */
      if (hton->db_type <= DB_TYPE_UNKNOWN ||
          hton->db_type >= DB_TYPE_DEFAULT ||
@@ -409,11 +408,11 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
        hton->db_type= (enum legacy_db_type) idx;
      }
      installed_htons[hton->db_type]= hton;
      uint tmp= hton->savepoint_offset;
      tmp= hton->savepoint_offset;
      hton->savepoint_offset= savepoint_alloc_size;
      savepoint_alloc_size+= tmp;
      hton->slot= total_ha++;
      hton2plugin[hton->slot]=plugin->plugin;
      hton2plugin[hton->slot]=plugin;
      if (hton->prepare)
        total_ha_2pc++;
      break;
@@ -445,16 +444,14 @@ int ha_init()
  DBUG_RETURN(error);
}

/*
  close, flush or restart databases
  Ignore this for other databases than ours
*/



	/* close, flush or restart databases */
	/* Ignore this for other databases than ours */

static my_bool panic_handlerton(THD *unused1, st_plugin_int *plugin,
                               void *arg)
static my_bool panic_handlerton(THD *unused1, st_plugin_int *plugin, void *arg)
{
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;
  if (hton->state == SHOW_OPTION_YES && hton->panic)
    ((int*)arg)[0]|= hton->panic((enum ha_panic_function)((int*)arg)[1]);
  return FALSE;
@@ -476,7 +473,7 @@ int ha_panic(enum ha_panic_function flag)
static my_bool dropdb_handlerton(THD *unused1, st_plugin_int *plugin,
                                 void *path)
{
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;
  if (hton->state == SHOW_OPTION_YES && hton->drop_database)
    hton->drop_database((char *)path);
  return FALSE;
@@ -492,9 +489,11 @@ void ha_drop_database(char* path)
static my_bool closecon_handlerton(THD *thd, st_plugin_int *plugin,
                                   void *unused)
{
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  /* there's no need to rollback here as all transactions must
     be rolled back already */
  handlerton *hton= (handlerton *)plugin->data;
  /*
    there's no need to rollback here as all transactions must
    be rolled back already
  */
  if (hton->state == SHOW_OPTION_YES && hton->close_connection &&
      thd->ha_data[hton->slot])
    hton->close_connection(thd);
@@ -585,7 +584,7 @@ int ha_prepare(THD *thd)
      {
        push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                            ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
                            hton2plugin[(*ht)->slot]->name);
                            hton2plugin[(*ht)->slot]->name.str);
      }
    }
  }
@@ -824,7 +823,7 @@ struct xahton_st {
static my_bool xacommit_handlerton(THD *unused1, st_plugin_int *plugin,
                                   void *arg)
{
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;
  if (hton->state == SHOW_OPTION_YES && hton->recover)
  {
    hton->commit_by_xid(((struct xahton_st *)arg)->xid);
@@ -836,7 +835,7 @@ static my_bool xacommit_handlerton(THD *unused1, st_plugin_int *plugin,
static my_bool xarollback_handlerton(THD *unused1, st_plugin_int *plugin,
                                     void *arg)
{
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;
  if (hton->state == SHOW_OPTION_YES && hton->recover)
  {
    hton->rollback_by_xid(((struct xahton_st *)arg)->xid);
@@ -943,7 +942,7 @@ struct xarecover_st
static my_bool xarecover_handlerton(THD *unused, st_plugin_int *plugin,
                                    void *arg)
{
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;
  struct xarecover_st *info= (struct xarecover_st *) arg;
  int got;

@@ -952,7 +951,7 @@ static my_bool xarecover_handlerton(THD *unused, st_plugin_int *plugin,
    while ((got= hton->recover(info->list, info->len)) > 0 )
    {
      sql_print_information("Found %d prepared transaction(s) in %s",
                            got, hton2plugin[hton->slot]->name);
                            got, hton2plugin[hton->slot]->name.str);
      for (int i=0; i < got; i ++)
      {
        my_xid x=info->list[i].get_my_xid();
@@ -1132,7 +1131,7 @@ bool mysql_xa_recover(THD *thd)
static my_bool release_temporary_latches(THD *thd, st_plugin_int *plugin,
                                 void *unused)
{
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;

  if (hton->state == SHOW_OPTION_YES && hton->release_temporary_latches)
    hton->release_temporary_latches(thd);
@@ -1257,7 +1256,7 @@ int ha_release_savepoint(THD *thd, SAVEPOINT *sv)
static my_bool snapshot_handlerton(THD *thd, st_plugin_int *plugin,
                                   void *arg)
{
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;
  if (hton->state == SHOW_OPTION_YES &&
      hton->start_consistent_snapshot)
  {
@@ -1288,7 +1287,7 @@ int ha_start_consistent_snapshot(THD *thd)
static my_bool flush_handlerton(THD *thd, st_plugin_int *plugin,
                                void *arg)
{
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;
  if (hton->state == SHOW_OPTION_YES && hton->flush_logs && hton->flush_logs())
    return TRUE;
  return FALSE;
@@ -2599,7 +2598,7 @@ struct binlog_func_st
static my_bool binlog_func_list(THD *thd, st_plugin_int *plugin, void *arg)
{
  hton_list_st *hton_list= (hton_list_st *)arg;
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;
  if (hton->state == SHOW_OPTION_YES && hton->binlog_func)
  {
    uint sz= hton_list->sz;
@@ -2689,7 +2688,7 @@ static my_bool binlog_log_query_handlerton(THD *thd,
                                           st_plugin_int *plugin,
                                           void *args)
{
  return binlog_log_query_handlerton2(thd, (const handlerton *) plugin->plugin->info, args);
  return binlog_log_query_handlerton2(thd, (const handlerton *)plugin->data, args);
}

void ha_binlog_log_query(THD *thd, const handlerton *hton,
@@ -2984,7 +2983,7 @@ static my_bool exts_handlerton(THD *unused, st_plugin_int *plugin,
                               void *arg)
{
  List<char> *found_exts= (List<char> *) arg;
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;
  handler *file;
  if (hton->state == SHOW_OPTION_YES && hton->create &&
      (file= hton->create((TABLE_SHARE*) 0)))
@@ -3060,7 +3059,7 @@ static my_bool showstat_handlerton(THD *thd, st_plugin_int *plugin,
                                   void *arg)
{
  enum ha_stat_type stat= *(enum ha_stat_type *) arg;
  handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton;
  handlerton *hton= (handlerton *)plugin->data;
  if (hton->state == SHOW_OPTION_YES && hton->show_status &&
      hton->show_status(thd, stat_print, stat))
    return TRUE;
@@ -3090,8 +3089,8 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
  {
    if (db_type->state != SHOW_OPTION_YES)
    {
      const char *name=hton2plugin[db_type->slot]->name;
      result= stat_print(thd, name, strlen(name),
      const LEX_STRING *name=&hton2plugin[db_type->slot]->name;
      result= stat_print(thd, name->str, name->length,
                         "", 0, "DISABLED", 8) ? 1 : 0;
    }
    else
+2 −2
Original line number Diff line number Diff line
@@ -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 *status, uint status_len);
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 -
@@ -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)
{
  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)
+1 −1
Original line number Diff line number Diff line
@@ -3307,7 +3307,7 @@ byte *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type,
  handlerton *val;
  val= (type == OPT_GLOBAL) ? global_system_variables.*offset :
        thd->variables.*offset;
  return (byte *) hton2plugin[val->slot]->name;
  return (byte *) hton2plugin[val->slot]->name.str;
}


+5 −5
Original line number Diff line number Diff line
@@ -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)
{
  const char *engine_str= hton2plugin[engine_type->slot]->name;
  DBUG_PRINT("info", ("ENGINE = %s", engine_str));
  const char *engine_str= hton2plugin[engine_type->slot]->name.str;
  DBUG_PRINT("info", ("ENGINE: %s", engine_str));
  int err= add_string(fptr, "ENGINE = ");
  return err + add_string(fptr, engine_str);
}
@@ -4515,8 +4515,8 @@ the generated partition syntax in a correct manner.
          DBUG_PRINT("info", ("No explicit engine used"));
          create_info->db_type= table->part_info->default_engine_type;
        }
        DBUG_PRINT("info", ("New engine type = %s",
                   hton2plugin[create_info->db_type->slot]->name));
        DBUG_PRINT("info", ("New engine type: %s",
                   hton2plugin[create_info->db_type->slot]->name.str));
        thd->work_part_info= NULL;
        *partition_changed= TRUE;
      }
Loading