List:Internals« Previous MessageNext Message »
From:Stewart Smith Date:October 6 2005 1:26pm
Subject:bk commit into 5.1 tree (stewart:1.2039)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of stewart. When stewart does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2039 05/10/06 23:26:05 stewart@stripped +11 -0
  WL#2076 Add extra ndbd statistics
  
  Add LOGFILE_GROUPS and LOGFILES to INFORMATION_SCHEMA and implement
  the calls for ndbcluster.

  sql/sql_show.cc
    1.275 05/10/06 23:26:02 stewart@stripped +52 -0
    Add LOGFILE_GROUPS and LOGFILES to INFORMATION_SCHEMA

  sql/handler.h
    1.148 05/10/06 23:26:01 stewart@stripped +12 -2
    Add fill_schema_logfile_groups and fill_schema_logfiles to handlerton

  sql/ha_partition.cc
    1.7 05/10/06 23:26:01 stewart@stripped +2 -0
    Add NULL implementation of fill_schema_logfile_groups
    Add NULL implementation of fill_schema_logfiles

  sql/ha_ndbcluster.cc
    1.156 05/10/06 23:26:01 stewart@stripped +67 -0
    Implement handlerton ndbcluster_fill_schema_logfiles and ndbcluster_fill_schema_logfile_groups

  sql/ha_myisammrg.cc
    1.70 05/10/06 23:26:01 stewart@stripped +2 -0
    Add NULL implementation of fill_schema_logfile_groups
    Add NULL implementation of fill_schema_logfiles

  sql/ha_myisam.cc
    1.156 05/10/06 23:26:01 stewart@stripped +2 -0
    Add NULL implementation of fill_schema_logfile_groups
    Add NULL implementation of fill_schema_logfiles

  sql/ha_innodb.cc
    1.220 05/10/06 23:26:01 stewart@stripped +2 -0
    Add NULL implementation of fill_schema_logfile_groups
    Add NULL implementation of fill_schema_logfiles

  sql/ha_heap.cc
    1.75 05/10/06 23:26:01 stewart@stripped +2 -0
    Add NULL implementation of fill_schema_logfile_groups
    Add NULL implementation of fill_schema_logfiles

  sql/ha_federated.cc
    1.34 05/10/06 23:26:01 stewart@stripped +2 -0
    Add NULL implementation of fill_schema_logfile_groups
    Add NULL implementation of fill_schema_logfiles

  sql/ha_blackhole.cc
    1.21 05/10/06 23:26:01 stewart@stripped +2 -0
    Add NULL implementation of fill_schema_logfile_groups
    Add NULL implementation of fill_schema_logfiles

  sql/ha_berkeley.cc
    1.159 05/10/06 23:26:01 stewart@stripped +2 -0
    Add NULL implementation of fill_schema_logfile_groups
    Add NULL implementation of fill_schema_logfiles

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	stewart
# Host:	willster.(none)
# Root:	/home/stewart/Documents/MySQL/5.1/ndb-dd

--- 1.158/sql/ha_berkeley.cc	2005-09-29 16:31:12 +10:00
+++ 1.159/sql/ha_berkeley.cc	2005-10-06 23:26:01 +10:00
@@ -126,6 +126,8 @@
   NULL, /* close_cursor_read_view */
   NULL, /* fill_schema_tablespaces */
   NULL, /* fill_schema_datafiles */
+  NULL, /* fill_schema_logfile_groups */
+  NULL, /* fill_schema_logfiles */
   HTON_CLOSE_CURSORS_AT_COMMIT
 };
 

--- 1.74/sql/ha_heap.cc	2005-09-29 16:31:12 +10:00
+++ 1.75/sql/ha_heap.cc	2005-10-06 23:26:01 +10:00
@@ -42,6 +42,8 @@
   NULL,    /* close_cursor_read_view */
   NULL,    /* fill_schema_tablespaces */
   NULL,    /* fill_schema_datafiles */
+  NULL,    /* fill_schema_logfile_groups */
+  NULL,    /* fill_schema_logfiles */
   HTON_NO_FLAGS
 };
 

--- 1.155/sql/ha_myisam.cc	2005-09-29 16:31:13 +10:00
+++ 1.156/sql/ha_myisam.cc	2005-10-06 23:26:01 +10:00
@@ -65,6 +65,8 @@
   NULL,    /* close_cursor_read_view */
   NULL,    /* fill_schema_tablespaces */
   NULL,    /* fill_schema_datafiles */
+  NULL,    /* fill_schema_logfile_groups */
+  NULL,    /* fill_schema_logfiles */
   /*
     MyISAM doesn't support transactions and doesn't have
     transaction-dependent context: cursors can survive a commit.

--- 1.69/sql/ha_myisammrg.cc	2005-09-29 16:31:13 +10:00
+++ 1.70/sql/ha_myisammrg.cc	2005-10-06 23:26:01 +10:00
@@ -53,6 +53,8 @@
   NULL,    /* close_cursor_read_view */
   NULL,    /* fill_schema_tablespaces */
   NULL,    /* fill_schema_datafiles */
+  NULL,    /* fill_schema_logfile_groups */
+  NULL,    /* fill_schema_logfiles */
   HTON_NO_FLAGS
 };
 

--- 1.147/sql/handler.h	2005-09-29 16:31:13 +10:00
+++ 1.148/sql/handler.h	2005-10-06 23:26:01 +10:00
@@ -373,8 +373,18 @@
    void *(*create_cursor_read_view)();
    void (*set_cursor_read_view)(void *);
    void (*close_cursor_read_view)(void *);
-   int (*fill_schema_tablespaces)(THD *thd, struct st_table_list *tables, class Item *cond);
-   int (*fill_schema_datafiles)(THD *thd, struct st_table_list *tables, class Item *cond);
+   int (*fill_schema_tablespaces)(THD *thd,
+				  struct st_table_list *tables,
+				  class Item *cond);
+   int (*fill_schema_datafiles)(THD *thd,
+				struct st_table_list *tables,
+				class Item *cond);
+   int (*fill_schema_logfile_groups)(THD *thd,
+				     struct st_table_list *tables,
+				     class Item *cond);
+   int (*fill_schema_logfiles)(THD *thd,
+			       struct st_table_list *tables,
+			       class Item *cond);
    uint32 flags;                                /* global handler flags */
 } handlerton;
 

--- 1.274/sql/sql_show.cc	2005-10-06 21:39:47 +10:00
+++ 1.275/sql/sql_show.cc	2005-10-06 23:26:02 +10:00
@@ -3825,6 +3825,32 @@
   DBUG_RETURN(0);
 }
 
+int fill_schema_logfile_groups(THD *thd, TABLE_LIST *tables, COND *cond)
+{
+  int i;
+  TABLE *table= tables->table;
+  DBUG_ENTER("fill_schema_logfile_groups");
+
+  for(i=0;i<total_ha;i++)
+    if(handlertons[i]->fill_schema_logfile_groups)
+      handlertons[i]->fill_schema_logfile_groups(thd,tables,cond);
+
+  DBUG_RETURN(0);
+}
+
+int fill_schema_logfiles(THD *thd, TABLE_LIST *tables, COND *cond)
+{
+  int i;
+  TABLE *table= tables->table;
+  DBUG_ENTER("fill_schema_logfiles");
+
+  for(i=0;i<total_ha;i++)
+    if(handlertons[i]->fill_schema_logfiles)
+      handlertons[i]->fill_schema_logfiles(thd,tables,cond);
+
+  DBUG_RETURN(0);
+}
+
 
 ST_FIELD_INFO schema_fields_info[]=
 {
@@ -4129,6 +4155,28 @@
   {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
 };
 
+ST_FIELD_INFO logfile_groups_fields_info[]=
+{
+  {"NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"ENGINE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"VERSION", 1, MYSQL_TYPE_LONG, 0, 0, 0},
+  {"UNDOBUFFER_SIZE", 1, MYSQL_TYPE_LONG, 0, 0, 0},
+  {"FREE_WORDS", 1, MYSQL_TYPE_LONG, 0, 0, 0},
+  {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+};
+
+ST_FIELD_INFO logfiles_fields_info[]=
+{
+  {"NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"ENGINE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"CLUSTER_NODE", 1, MYSQL_TYPE_LONG, 0, 0, 0},
+  {"TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"PATH", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"SIZE", 1, MYSQL_TYPE_LONG, 0, 0, 0},
+  {"LOGFILE_GROUP", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+  {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+};
+
 /*
   Description of ST_FIELD_INFO in table.h
 */
@@ -4179,6 +4227,10 @@
    fill_schema_tablespaces, 0, 0, -1, -1, 0},
   {"DATAFILES", datafiles_fields_info, create_schema_table,
    fill_schema_datafiles, 0, 0, -1, -1, 0},
+  {"LOGFILE_GROUPS", logfile_groups_fields_info, create_schema_table,
+   fill_schema_logfile_groups, 0, 0, -1, -1, 0},
+  {"LOGFILES", logfiles_fields_info, create_schema_table,
+   fill_schema_logfiles, 0, 0, -1, -1, 0},
   {0, 0, 0, 0, 0, 0, 0, 0, 0}
 };
 

--- 1.20/sql/ha_blackhole.cc	2005-09-29 16:31:12 +10:00
+++ 1.21/sql/ha_blackhole.cc	2005-10-06 23:26:01 +10:00
@@ -45,6 +45,8 @@
   NULL,    /* close_cursor_read_view */
   NULL,    /* fill_schema_tablespaces */
   NULL,    /* fill_schema_datafiles */
+  NULL,    /* fill_schema_logfile_groups */
+  NULL,    /* fill_schema_logfiles */
   HTON_NO_FLAGS
 };
 

--- 1.155/sql/ha_ndbcluster.cc	2005-10-06 21:39:46 +10:00
+++ 1.156/sql/ha_ndbcluster.cc	2005-10-06 23:26:01 +10:00
@@ -53,6 +53,8 @@
 static int ndbcluster_rollback(THD *thd, bool all);
 static int ndbcluster_fill_schema_tablespaces(THD *thd, TABLE_LIST *tables, COND *cond);
 static int ndbcluster_fill_schema_datafiles(THD *thd, TABLE_LIST *tables, COND *cond);
+static int ndbcluster_fill_schema_logfile_groups(THD *thd, TABLE_LIST *tables, COND *cond);
+static int ndbcluster_fill_schema_logfiles(THD *thd, TABLE_LIST *tables, COND *cond);
 
 static handlerton ndbcluster_hton = {
   "ndbcluster",
@@ -73,6 +75,8 @@
   NULL, /* close_cursor_read_view */
   ndbcluster_fill_schema_tablespaces,
   ndbcluster_fill_schema_datafiles,
+  ndbcluster_fill_schema_logfile_groups,
+  ndbcluster_fill_schema_logfiles,
   HTON_NO_FLAGS
 };
 
@@ -7947,6 +7951,69 @@
       table->field[4]->store(df.getSize());
       table->field[5]->store(df.getFree());
       table->field[6]->store(df.getTablespace(),strlen(df.getTablespace()),
+			     system_charset_info);
+      schema_table_store_record(thd, table);
+    }
+  }
+}
+
+static int ndbcluster_fill_schema_logfile_groups(THD *thd,
+						 TABLE_LIST *tables,
+						 COND *cond)
+{
+  TABLE* table= tables->table;
+  Thd_ndb *thd_ndb= get_thd_ndb(thd);
+  Ndb *ndb= thd_ndb->ndb;
+  NdbDictionary::Dictionary* dict= ndb->getDictionary();
+  NdbDictionary::Dictionary::List tslist;
+
+  dict->listObjects(tslist,NdbDictionary::Object::LogfileGroup);
+
+  for(unsigned i= 0;i < tslist.count;i++)
+  {
+    NdbDictionary::Dictionary::List::Element& elt = tslist.elements[i];
+    NdbDictionary::LogfileGroup lfg= dict->getLogfileGroup(elt.name);
+
+    table->field[0]->store(elt.name,strlen(elt.name),system_charset_info);
+    table->field[1]->store("NDB",3,system_charset_info);
+    table->field[2]->store(lfg.getObjectVersion());
+    table->field[3]->store(lfg.getUndoBufferSize());
+    table->field[4]->store(lfg.getUndoFreeWords());
+
+    schema_table_store_record(thd, table);
+  }
+}
+
+static int ndbcluster_fill_schema_logfiles(THD *thd, TABLE_LIST *tables, COND *cond)
+{
+  TABLE* table= tables->table;
+  Thd_ndb *thd_ndb= get_thd_ndb(thd);
+  Ndb *ndb= thd_ndb->ndb;
+  NdbDictionary::Dictionary* dict= ndb->getDictionary();
+  NdbDictionary::Dictionary::List tslist;
+
+  dict->listObjects(tslist,NdbDictionary::Object::Undofile);
+
+  for(unsigned i= 0;i < tslist.count;i++)
+  {
+    NdbDictionary::Dictionary::List::Element& elt = tslist.elements[i];
+    Ndb_cluster_connection_node_iter iter;
+    unsigned id;
+
+    g_ndb_cluster_connection->init_get_next_node(iter);
+
+    while(id= g_ndb_cluster_connection->get_next_node(iter))
+    {
+      NdbDictionary::Undofile uf= dict->getUndofile(id,elt.name);
+
+      table->field[0]->store(elt.name,strlen(elt.name),system_charset_info);
+      table->field[1]->store("NDB",3,system_charset_info);
+      table->field[2]->store(id);
+      table->field[3]->store("UNDO",4,system_charset_info);
+      table->field[4]->store(uf.getPath(),strlen(uf.getPath()),
+			     system_charset_info);
+      table->field[5]->store(uf.getSize());
+      table->field[6]->store(uf.getLogfileGroup(),strlen(uf.getLogfileGroup()),
 			     system_charset_info);
       schema_table_store_record(thd, table);
     }

--- 1.219/sql/ha_innodb.cc	2005-09-29 16:31:12 +10:00
+++ 1.220/sql/ha_innodb.cc	2005-10-06 23:26:01 +10:00
@@ -225,6 +225,8 @@
   innobase_close_cursor_view,
   NULL,                         /* fill_schema_tablespaces */
   NULL,                         /* fill_schema_datafiles */
+  NULL,                         /* fill_schema_logfile_groups */
+  NULL,                         /* fill_schema_logfiles */
   HTON_NO_FLAGS
 };
 

--- 1.6/sql/ha_partition.cc	2005-09-29 16:31:13 +10:00
+++ 1.7/sql/ha_partition.cc	2005-10-06 23:26:01 +10:00
@@ -86,6 +86,8 @@
   NULL,
   NULL,    /* fill_schema_tablespaces */
   NULL,    /* fill_schema_datafiles */
+  NULL,    /* fill_schema_logfile_groups */
+  NULL,    /* fill_schema_logfiles */
   HTON_NO_FLAGS
 };
 

--- 1.33/sql/ha_federated.cc	2005-09-29 16:31:12 +10:00
+++ 1.34/sql/ha_federated.cc	2005-10-06 23:26:01 +10:00
@@ -712,6 +712,8 @@
   NULL,    /* close_cursor_read_view */
   NULL,    /* fill_schema_tablespaces */
   NULL,    /* fill_schema_datafiles */
+  NULL,    /* fill_schema_logfile_groups */
+  NULL,    /* fill_schema_logfiles */
   HTON_NO_FLAGS
 };
 
Thread
bk commit into 5.1 tree (stewart:1.2039)Stewart Smith6 Oct