Commit 48d5b3bd authored by unknown's avatar unknown
Browse files

This removes the passing of global hton to engine instance.


sql/ha_ndbcluster.cc:
  Removed global hton
sql/ha_ndbcluster.h:
  Removed global hton need
sql/ha_partition.cc:
  Removed global hton
sql/ha_partition.h:
  Removed global hton
sql/handler.cc:
  Removed global hton
sql/handler.h:
  Removed global hton
storage/archive/ha_archive.cc:
  Removed global hton
storage/archive/ha_archive.h:
  Global hton removed
storage/blackhole/ha_blackhole.cc:
  Global removed hton
storage/blackhole/ha_blackhole.h:
  Global hton removal
storage/csv/ha_tina.cc:
  Global hton removal
storage/csv/ha_tina.h:
  Removed global removed
storage/example/ha_example.cc:
  Global removed hton
storage/example/ha_example.h:
  Global removed hton
storage/federated/ha_federated.cc:
  Global removed hton
storage/federated/ha_federated.h:
  Global removed hton
storage/heap/ha_heap.cc:
  Global removed hton
storage/heap/ha_heap.h:
  Global removed hton
storage/innobase/handler/ha_innodb.cc:
  Global removed hton
storage/innobase/handler/ha_innodb.h:
  Removed global hton
storage/myisam/ha_myisam.cc:
  Globally removed hton
storage/myisam/ha_myisam.h:
  Globally removed hton
storage/myisammrg/ha_myisammrg.cc:
  Globally removed hton
storage/myisammrg/ha_myisammrg.h:
  Globaly removed hton
parent 62c30cd5
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -82,10 +82,11 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables, COND *cond)

handlerton *ndbcluster_hton;

static handler *ndbcluster_create_handler(TABLE_SHARE *table,
static handler *ndbcluster_create_handler(handlerton *hton,
                                          TABLE_SHARE *table,
                                          MEM_ROOT *mem_root)
{
  return new (mem_root) ha_ndbcluster(table);
  return new (mem_root) ha_ndbcluster(hton, table);
}

static uint ndbcluster_partition_flags()
@@ -5552,8 +5553,8 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
                HA_HAS_OWN_BINLOGGING | \
                HA_HAS_RECORDS

ha_ndbcluster::ha_ndbcluster(TABLE_SHARE *table_arg):
  handler(ndbcluster_hton, table_arg),
ha_ndbcluster::ha_ndbcluster(handlerton *hton, TABLE_SHARE *table_arg):
  handler(hton, table_arg),
  m_active_trans(NULL),
  m_active_cursor(NULL),
  m_table(NULL),
@@ -6623,7 +6624,7 @@ void ndbcluster_print_error(int error, const NdbOperation *error_op)
  share.db.length= 0;
  share.table_name.str= (char *) tab_name;
  share.table_name.length= strlen(tab_name);
  ha_ndbcluster error_handler(&share);
  ha_ndbcluster error_handler(ndbcluster_hton, &share);
  error_handler.print_error(error, MYF(0));
  DBUG_VOID_RETURN;
}
+1 −1
Original line number Diff line number Diff line
@@ -627,7 +627,7 @@ class Thd_ndb
class ha_ndbcluster: public handler
{
 public:
  ha_ndbcluster(TABLE_SHARE *table);
  ha_ndbcluster(handlerton *hton, TABLE_SHARE *table);
  ~ha_ndbcluster();

  int ha_initialise();
+9 −7
Original line number Diff line number Diff line
@@ -69,7 +69,8 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE * table);
                MODULE create/delete handler object
****************************************************************************/

static handler *partition_create_handler(TABLE_SHARE *share,
static handler *partition_create_handler(handlerton *hton,
                                         TABLE_SHARE *share,
                                         MEM_ROOT *mem_root);
static uint partition_flags();
static uint alter_table_flags(uint flags);
@@ -102,10 +103,11 @@ static int partition_initialize(void *p)
    New partition object
*/

static handler *partition_create_handler(TABLE_SHARE *share,
static handler *partition_create_handler(handlerton *hton, 
                                         TABLE_SHARE *share,
                                         MEM_ROOT *mem_root)
{
  ha_partition *file= new (mem_root) ha_partition(share);
  ha_partition *file= new (mem_root) ha_partition(hton, share);
  if (file && file->initialise_partition(mem_root))
  {
    delete file;
@@ -155,8 +157,8 @@ static uint alter_table_flags(uint flags __attribute__((unused)))
    NONE
*/

ha_partition::ha_partition(TABLE_SHARE *share)
  :handler(partition_hton, share), m_part_info(NULL), m_create_handler(FALSE),
ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share)
  :handler(hton, share), m_part_info(NULL), m_create_handler(FALSE),
   m_is_sub_partitioned(0)
{
  DBUG_ENTER("ha_partition::ha_partition(table)");
@@ -176,8 +178,8 @@ ha_partition::ha_partition(TABLE_SHARE *share)
    NONE
*/

ha_partition::ha_partition(partition_info *part_info)
  :handler(partition_hton, NULL), m_part_info(part_info),
ha_partition::ha_partition(handlerton *hton, partition_info *part_info)
  :handler(hton, NULL), m_part_info(part_info),
   m_create_handler(TRUE),
   m_is_sub_partitioned(m_part_info->is_sub_partitioned())

+2 −2
Original line number Diff line number Diff line
@@ -149,8 +149,8 @@ class ha_partition :public handler
    partition handler.
    -------------------------------------------------------------------------
  */
    ha_partition(TABLE_SHARE * table);
    ha_partition(partition_info * part_info);
    ha_partition(handlerton *hton, TABLE_SHARE * table);
    ha_partition(handlerton *hton, partition_info * part_info);
   ~ha_partition();
  /*
    A partition handler has no characteristics in itself. It only inherits
+4 −4
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ const char *ha_get_storage_engine(enum legacy_db_type db_type)
static handler *create_default(TABLE_SHARE *table, MEM_ROOT *mem_root)
{
  handlerton *hton= ha_default_handlerton(current_thd);
  return (hton && hton->create) ? hton->create(table, mem_root) : NULL;
  return (hton && hton->create) ? hton->create(hton, table, mem_root) : NULL;
}


@@ -232,7 +232,7 @@ handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc,

  if (db_type && db_type->state == SHOW_OPTION_YES && db_type->create)
  {
    if ((file= db_type->create(share, alloc)))
    if ((file= db_type->create(db_type, share, alloc)))
      file->init();
    DBUG_RETURN(file);
  }
@@ -251,7 +251,7 @@ handler *get_ha_partition(partition_info *part_info)
{
  ha_partition *partition;
  DBUG_ENTER("get_ha_partition");
  if ((partition= new ha_partition(part_info)))
  if ((partition= new ha_partition(partition_hton, part_info)))
  {
    if (partition->initialise_partition(current_thd->mem_root))
    {
@@ -3296,7 +3296,7 @@ static my_bool exts_handlerton(THD *unused, st_plugin_int *plugin,
  handlerton *hton= (handlerton *)plugin->data;
  handler *file;
  if (hton->state == SHOW_OPTION_YES && hton->create &&
      (file= hton->create((TABLE_SHARE*) 0, current_thd->mem_root)))
      (file= hton->create(hton, (TABLE_SHARE*) 0, current_thd->mem_root)))
  {
    List_iterator_fast<char> it(*found_exts);
    const char **ext, *old_ext;
Loading