Commit 977cd20a authored by unknown's avatar unknown
Browse files

This changest:

Plugins now when compiled or not compiled work correctly with status variables. 
Status variables from plugins now set their own names (removed bit where plugin name was pre-appended this broke Innodb and Cluster)
A few Makefile cleanups. 


sql/ha_innodb.cc:
  Cleanup to make status variables directly in engine
sql/ha_ndbcluster.cc:
  Engine interface now has variables for status
sql/handler.cc:
  handler now makes sure to init status variables
sql/mysqld.cc:
  Removed status variable hacks
sql/sql_delete.cc:
  Removed include file that was not required
storage/myisam/Makefile.am:
  Cleaned up line lengths and addded additional include to not install.
storage/myisam/ha_myisam.cc:
  Removed double plugin include
parent cfafd458
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -42,8 +42,6 @@ have disables the InnoDB inlining in this file. */

#define MAX_ULONG_BIT ((ulong) 1 << (sizeof(ulong)*8-1))

#ifdef WITH_INNOBASE_STORAGE_ENGINE

#include "ha_innodb.h"

pthread_mutex_t innobase_share_mutex,	/* to protect innobase_open_files */
@@ -311,7 +309,8 @@ SHOW_VAR innodb_status_variables[]= {
  (char*) &export_vars.innodb_rows_read,		  SHOW_LONG},
  {"rows_updated",
  (char*) &export_vars.innodb_rows_updated,		  SHOW_LONG},
  {NullS, NullS, SHOW_LONG}};
  {NullS, NullS, SHOW_LONG}
};

/* General functions */

@@ -7599,6 +7598,19 @@ bool ha_innobase::check_if_incompatible_data(
	return COMPATIBLE_DATA_YES;
}

static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
{
  innodb_export_status();
  var->type= SHOW_ARRAY;
  var->value= (char *) &innodb_status_variables;
  return 0;
}

SHOW_VAR innodb_status_variables_export[]= {
  {"Innodb",                   (char*) &show_innodb_vars, SHOW_FUNC},
  {NullS, NullS, SHOW_LONG}
};

struct st_mysql_storage_engine innobase_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION, &innobase_hton};

@@ -7612,9 +7624,7 @@ mysql_declare_plugin(innobase)
  innobase_init, /* Plugin Init */
  NULL, /* Plugin Deinit */
  0x0100 /* 1.0 */,
  0
  innodb_status_variables_export
}
mysql_declare_plugin_end;
#endif
+6 −1
Original line number Diff line number Diff line
@@ -10577,6 +10577,11 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
  DBUG_RETURN(0);
}

SHOW_VAR ndb_status_variables_export[]= {
  {"Ndb",                      (char*) &ndb_status_variables,   SHOW_ARRAY},
  {NullS, NullS, SHOW_LONG}
};

struct st_mysql_storage_engine ndbcluster_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION, &ndbcluster_hton };

@@ -10590,7 +10595,7 @@ mysql_declare_plugin(ndbcluster)
  ndbcluster_init, /* Plugin Init */
  NULL, /* Plugin Deinit */
  0x0100 /* 1.0 */,
  0
  ndb_status_variables_export
}
mysql_declare_plugin_end;

+6 −4
Original line number Diff line number Diff line
@@ -37,10 +37,6 @@
#include "ha_partition.h"
#endif

#ifdef WITH_INNOBASE_STORAGE_ENGINE
#include "ha_innodb.h"
#endif

/*
  While we have legacy_db_type, we have this array to
  check for dups and to find handlerton from legacy_db_type.
@@ -434,6 +430,12 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
      savepoint_alloc_size+= tmp;
      hton->slot= total_ha++;
      hton2plugin[hton->slot]=plugin;
      /* This is just a temp need until plugin/engine startup is fixed */
      if (plugin->plugin->status_vars)
      {
        add_status_vars(plugin->plugin->status_vars);
      }

      if (hton->prepare)
        total_ha_2pc++;
      break;
+0 −18
Original line number Diff line number Diff line
@@ -357,7 +357,6 @@ my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
my_bool opt_log_slave_updates= 0;
my_bool	opt_innodb;
#ifdef WITH_INNOBASE_STORAGE_ENGINE
extern SHOW_VAR innodb_status_variables[];
extern uint innobase_init_flags, innobase_lock_type;
extern uint innobase_flush_log_at_trx_commit;
extern ulong innobase_cache_size, innobase_fast_shutdown;
@@ -417,7 +416,6 @@ ulong ndb_report_thresh_binlog_epoch_slip;
ulong ndb_report_thresh_binlog_mem_usage;
#endif

extern SHOW_VAR ndb_status_variables[];
extern const char *ndb_distribution_names[];
extern TYPELIB ndb_distribution_typelib;
extern const char *opt_ndb_distribution;
@@ -6574,16 +6572,6 @@ static int show_ssl_get_cipher_list(THD *thd, SHOW_VAR *var, char *buff)

#endif /* HAVE_OPENSSL */

#ifdef WITH_INNOBASE_STORAGE_ENGINE
int innodb_export_status(void);
static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
{
  innodb_export_status();
  var->type= SHOW_ARRAY;
  var->value= (char *) &innodb_status_variables;
  return 0;
}
#endif

SHOW_VAR status_vars[]= {
  {"Aborted_clients",          (char*) &aborted_threads,        SHOW_LONG},
@@ -6723,9 +6711,6 @@ SHOW_VAR status_vars[]= {
  {"Handler_savepoint_rollback",(char*) offsetof(STATUS_VAR, ha_savepoint_rollback_count), SHOW_LONG_STATUS},
  {"Handler_update",           (char*) offsetof(STATUS_VAR, ha_update_count), SHOW_LONG_STATUS},
  {"Handler_write",            (char*) offsetof(STATUS_VAR, ha_write_count), SHOW_LONG_STATUS},
#ifdef WITH_INNOBASE_STORAGE_ENGINE
  {"Innodb",                   (char*) &show_innodb_vars, SHOW_FUNC},
#endif /* WITH_INNOBASE_STORAGE_ENGINE */
  {"Key_blocks_not_flushed",   (char*) offsetof(KEY_CACHE, global_blocks_changed), SHOW_KEY_CACHE_LONG},
  {"Key_blocks_unused",        (char*) offsetof(KEY_CACHE, blocks_unused), SHOW_KEY_CACHE_LONG},
  {"Key_blocks_used",          (char*) offsetof(KEY_CACHE, blocks_used), SHOW_KEY_CACHE_LONG},
@@ -6735,9 +6720,6 @@ SHOW_VAR status_vars[]= {
  {"Key_writes",               (char*) offsetof(KEY_CACHE, global_cache_write), SHOW_KEY_CACHE_LONGLONG},
  {"Last_query_cost",          (char*) offsetof(STATUS_VAR, last_query_cost), SHOW_DOUBLE_STATUS},
  {"Max_used_connections",     (char*) &max_used_connections,  SHOW_LONG},
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
  {"Ndb",                      (char*) &ndb_status_variables,   SHOW_ARRAY},
#endif /* WITH_NDBCLUSTER_STORAGE_ENGINE */
  {"Not_flushed_delayed_rows", (char*) &delayed_rows_in_use,    SHOW_LONG_NOFLUSH},
  {"Open_files",               (char*) &my_file_opened,         SHOW_LONG_NOFLUSH},
  {"Open_streams",             (char*) &my_stream_opened,       SHOW_LONG_NOFLUSH},
+0 −3
Original line number Diff line number Diff line
@@ -21,9 +21,6 @@
*/

#include "mysql_priv.h"
#ifdef WITH_INNOBASE_STORAGE_ENGINE
#include "ha_innodb.h"
#endif
#include "sql_select.h"
#include "sp_head.h"
#include "sql_trigger.h"
Loading