List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:December 29 2005 7:19am
Subject:bk commit into 5.1 tree (stewart:1.1983)
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.1983 05/12/29 18:19:41 stewart@stripped +12 -0
  Convert alter_tablespace into a handlerton call.

  storage/csv/ha_tina.cc
    1.28 05/12/29 18:19:37 stewart@stripped +1 -0
    Add alter tablespace handlerton call

  sql/sql_tablespace.cc
    1.2 05/12/29 18:19:37 stewart@stripped +3 -8
    Change alter tablespace into a handlerton call

  sql/log.cc
    1.181 05/12/29 18:19:37 stewart@stripped +1 -0
    Add alter tablespace handlerton call

  sql/handler.h
    1.170 05/12/29 18:19:37 stewart@stripped +77 -78
    Move alter_tablespace to a handlerton call.

  sql/ha_partition.cc
    1.16 05/12/29 18:19:37 stewart@stripped +1 -0
    Add alter tablespace handlerton call

  sql/ha_ndbcluster.cc
    1.219 05/12/29 18:19:36 stewart@stripped +8 -7
    Change handler alter_tablespace call into a handlerton call.

  sql/ha_myisammrg.cc
    1.76 05/12/29 18:19:36 stewart@stripped +1 -0
    Add alter tablespace handlerton call

  sql/ha_myisam.cc
    1.165 05/12/29 18:19:36 stewart@stripped +1 -0
    Add alter tablespace handlerton call

  sql/ha_heap.cc
    1.78 05/12/29 18:19:36 stewart@stripped +1 -0
    Add alter tablespace handlerton call

  sql/ha_federated.cc
    1.47 05/12/29 18:19:36 stewart@stripped +1 -0
    Add alter tablespace handlerton call

  sql/ha_blackhole.cc
    1.25 05/12/29 18:19:36 stewart@stripped +1 -0
    Add alter tablespace handlerton call

  sql/ha_berkeley.cc
    1.166 05/12/29 18:19:36 stewart@stripped +1 -0
    Add alter tablespace handlerton call

# 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/dd-new-merge

--- 1.165/sql/ha_berkeley.cc	2005-12-22 05:24:56 +11:00
+++ 1.166/sql/ha_berkeley.cc	2005-12-29 18:19:36 +11:00
@@ -149,6 +149,7 @@
   NULL, /* Start Consistent Snapshot */
   berkeley_flush_logs, /* Flush logs */
   berkeley_show_status, /* Show status */
+  NULL, /* Alter Tablespace */
   HTON_CLOSE_CURSORS_AT_COMMIT | HTON_FLUSH_AFTER_RENAME
 };
 

--- 1.77/sql/ha_heap.cc	2005-12-22 05:18:27 +11:00
+++ 1.78/sql/ha_heap.cc	2005-12-29 18:19:36 +11:00
@@ -54,6 +54,7 @@
   NULL,    /* Start Consistent Snapshot */
   NULL,    /* Flush logs */
   NULL,    /* Show status */
+  NULL,    /* Alter Tablespace */
   HTON_CAN_RECREATE
 };
 

--- 1.164/sql/ha_myisam.cc	2005-12-22 05:24:56 +11:00
+++ 1.165/sql/ha_myisam.cc	2005-12-29 18:19:36 +11:00
@@ -86,6 +86,7 @@
   NULL,    /* Start Consistent Snapshot */
   NULL,    /* Flush logs */
   NULL,    /* Show status */
+  NULL,    /* Alter Tablespace */
   HTON_CAN_RECREATE
 };
 

--- 1.75/sql/ha_myisammrg.cc	2005-12-22 05:18:27 +11:00
+++ 1.76/sql/ha_myisammrg.cc	2005-12-29 18:19:36 +11:00
@@ -64,6 +64,7 @@
   NULL,    /* Start Consistent Snapshot */
   NULL,    /* Flush logs */
   NULL,    /* Show status */
+  NULL,    /* Alter Tablespace */
   HTON_CAN_RECREATE
 };
 

--- 1.169/sql/handler.h	2005-12-23 15:32:39 +11:00
+++ 1.170/sql/handler.h	2005-12-29 18:19:37 +11:00
@@ -315,6 +315,82 @@
 #define MAX_XID_LIST_SIZE  (1024*128)
 #endif
 
+/*
+  These structures are used to pass information from a set of SQL commands
+  on add/drop/change tablespace definitions to the proper hton.
+*/
+#define UNDEF_NODEGROUP 65535
+enum ts_command_type
+{
+  TS_CMD_NOT_DEFINED = -1,
+  CREATE_TABLESPACE = 0,
+  ALTER_TABLESPACE = 1,
+  CREATE_LOGFILE_GROUP = 2,
+  ALTER_LOGFILE_GROUP = 3,
+  DROP_TABLESPACE = 4,
+  DROP_LOGFILE_GROUP = 5,
+  CHANGE_FILE_TABLESPACE = 6,
+  ALTER_ACCESS_MODE_TABLESPACE = 7
+};
+
+enum ts_alter_tablespace_type
+{
+  TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED = -1,
+  ALTER_TABLESPACE_ADD_FILE = 1,
+  ALTER_TABLESPACE_DROP_FILE = 2
+};
+
+enum tablespace_access_mode
+{
+  TS_NOT_DEFINED= -1,
+  TS_READ_ONLY = 0,
+  TS_READ_WRITE = 1,
+  TS_NOT_ACCESSIBLE = 2
+};
+
+class st_alter_tablespace : public Sql_alloc
+{
+  public:
+  char *tablespace_name;
+  char *logfile_group_name;
+  enum ts_command_type ts_cmd_type;
+  enum ts_alter_tablespace_type ts_alter_tablespace_type;
+  char *data_file_name;
+  char *undo_file_name;
+  char *redo_file_name;
+  ulonglong extent_size;
+  ulonglong undo_buffer_size;
+  ulonglong redo_buffer_size;
+  ulonglong initial_size;
+  ulonglong autoextend_size;
+  ulonglong max_size;
+  uint nodegroup_id;
+  enum legacy_db_type storage_engine;
+  bool wait_until_completed;
+  char *ts_comment;
+  enum tablespace_access_mode ts_access_mode;
+  st_alter_tablespace()
+  {
+    tablespace_name= NULL;
+    logfile_group_name= "DEFAULT_LG"; //Default log file group
+    ts_cmd_type= TS_CMD_NOT_DEFINED;
+    data_file_name= NULL;
+    undo_file_name= NULL;
+    redo_file_name= NULL;
+    extent_size= 1024*1024;        //Default 1 MByte
+    undo_buffer_size= 8*1024*1024; //Default 8 MByte
+    redo_buffer_size= 8*1024*1024; //Default 8 MByte
+    initial_size= 128*1024*1024;   //Default 128 MByte
+    autoextend_size= 0;            //No autoextension as default
+    max_size= 0;                   //Max size == initial size => no extension
+    storage_engine= DB_TYPE_UNKNOWN;
+    nodegroup_id= UNDEF_NODEGROUP;
+    wait_until_completed= TRUE;
+    ts_comment= NULL;
+    ts_access_mode= TS_NOT_DEFINED;
+  }
+};
+
 /* The handler for a table type.  Will be included in the TABLE structure */
 
 struct st_table;
@@ -434,6 +510,7 @@
    int (*start_consistent_snapshot)(THD *thd);
    bool (*flush_logs)();
    bool (*show_status)(THD *thd, stat_print_fn *print, enum ha_stat_type stat);
+   int (*alter_tablespace)(THD *thd, st_alter_tablespace *ts_info);
    uint32 flags;                                /* global handler flags */
 } handlerton;
 
@@ -778,82 +855,6 @@
   byte *end_of_used_area;     /* End of area that was used by handler */
 } HANDLER_BUFFER;
 
-/*
-  These structures are used to pass information from a set of SQL commands
-  on add/drop/change tablespace definitions to the proper storage engine.
-*/
-#define UNDEF_NODEGROUP 65535
-enum ts_command_type
-{
-  TS_CMD_NOT_DEFINED = -1,
-  CREATE_TABLESPACE = 0,
-  ALTER_TABLESPACE = 1,
-  CREATE_LOGFILE_GROUP = 2,
-  ALTER_LOGFILE_GROUP = 3,
-  DROP_TABLESPACE = 4,
-  DROP_LOGFILE_GROUP = 5,
-  CHANGE_FILE_TABLESPACE = 6,
-  ALTER_ACCESS_MODE_TABLESPACE = 7
-};
-
-enum ts_alter_tablespace_type
-{
-  TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED = -1,
-  ALTER_TABLESPACE_ADD_FILE = 1,
-  ALTER_TABLESPACE_DROP_FILE = 2
-};
-
-enum tablespace_access_mode
-{
-  TS_NOT_DEFINED= -1,
-  TS_READ_ONLY = 0,
-  TS_READ_WRITE = 1,
-  TS_NOT_ACCESSIBLE = 2
-};
-
-class st_alter_tablespace : public Sql_alloc
-{
-  public:
-  char *tablespace_name;
-  char *logfile_group_name;
-  enum ts_command_type ts_cmd_type;
-  enum ts_alter_tablespace_type ts_alter_tablespace_type;
-  char *data_file_name;
-  char *undo_file_name;
-  char *redo_file_name;
-  ulonglong extent_size;
-  ulonglong undo_buffer_size;
-  ulonglong redo_buffer_size;
-  ulonglong initial_size;
-  ulonglong autoextend_size;
-  ulonglong max_size;
-  uint nodegroup_id;
-  enum legacy_db_type storage_engine;
-  bool wait_until_completed;
-  char *ts_comment;
-  enum tablespace_access_mode ts_access_mode;
-  st_alter_tablespace()
-  {
-    tablespace_name= NULL;
-    logfile_group_name= "DEFAULT_LG"; //Default log file group
-    ts_cmd_type= TS_CMD_NOT_DEFINED;
-    data_file_name= NULL;
-    undo_file_name= NULL;
-    redo_file_name= NULL;
-    extent_size= 1024*1024;        //Default 1 MByte
-    undo_buffer_size= 8*1024*1024; //Default 8 MByte
-    redo_buffer_size= 8*1024*1024; //Default 8 MByte
-    initial_size= 128*1024*1024;   //Default 128 MByte
-    autoextend_size= 0;            //No autoextension as default
-    max_size= 0;                   //Max size == initial size => no extension
-    storage_engine= DB_TYPE_UNKNOWN;
-    nodegroup_id= UNDEF_NODEGROUP;
-    wait_until_completed= TRUE;
-    ts_comment= NULL;
-    ts_access_mode= TS_NOT_DEFINED;
-  }
-};
-
 class handler :public Sql_alloc
 {
 #ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -1334,8 +1335,6 @@
   virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt)
   { return HA_ADMIN_NOT_IMPLEMENTED; }
   virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt)
-  { return HA_ADMIN_NOT_IMPLEMENTED; }
-  virtual int alter_tablespace(st_alter_tablespace *alter_tablespace_info)
   { return HA_ADMIN_NOT_IMPLEMENTED; }
   /* end of the list of admin commands */
 

--- 1.180/sql/log.cc	2005-12-22 15:10:54 +11:00
+++ 1.181/sql/log.cc	2005-12-29 18:19:37 +11:00
@@ -88,6 +88,7 @@
   NULL,                         /* Start Consistent Snapshot */
   NULL,                         /* Flush logs */
   NULL,                         /* Show status */
+  NULL,                         /* Alter Tablespace */
   HTON_NOT_USER_SELECTABLE | HTON_HIDDEN
 };
 

--- 1.27/storage/csv/ha_tina.cc	2005-12-22 07:50:44 +11:00
+++ 1.28/storage/csv/ha_tina.cc	2005-12-29 18:19:37 +11:00
@@ -88,6 +88,7 @@
   NULL,    /* Start Consistent Snapshot */
   NULL,    /* Flush logs */
   NULL,    /* Show status */
+  NULL,    /* Alter Tablespace */
   HTON_CAN_RECREATE
 };
 

--- 1.24/sql/ha_blackhole.cc	2005-12-22 05:18:27 +11:00
+++ 1.25/sql/ha_blackhole.cc	2005-12-29 18:19:36 +11:00
@@ -57,6 +57,7 @@
   NULL,    /* Start Consistent Snapshot */
   NULL,    /* Flush logs */
   NULL,    /* Show status */
+  NULL,    /* Alter Tablespace */
   HTON_CAN_RECREATE
 };
 

--- 1.218/sql/ha_ndbcluster.cc	2005-12-22 11:29:11 +11:00
+++ 1.219/sql/ha_ndbcluster.cc	2005-12-29 18:19:36 +11:00
@@ -57,6 +57,7 @@
 static int ndbcluster_commit(THD *thd, bool all);
 static int ndbcluster_rollback(THD *thd, bool all);
 static handler* ndbcluster_create_handler(TABLE_SHARE *table);
+static int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info);
 
 handlerton ndbcluster_hton = {
   MYSQL_HANDLERTON_INTERFACE_VERSION,
@@ -86,6 +87,7 @@
   NULL, /* Start Consistent Snapshot */
   NULL, /* Flush logs */
   ndbcluster_show_status, /* Show status */
+  ndbcluster_alter_tablespace,
   HTON_NO_FLAGS
 };
 
@@ -8327,18 +8329,17 @@
   return false;
 }
 
-int ha_ndbcluster::alter_tablespace(st_alter_tablespace *info)
+int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
 {
-  Ndb *ndb;
+  Thd_ndb *thd_ndb= get_thd_ndb(thd);
+  Ndb *ndb= thd_ndb->ndb;
   NDBDICT *dict;
   int error;
+
   DBUG_ENTER("ha_ndbcluster::alter_tablespace");
-  if (check_ndb_connection())
-  {
-    DBUG_RETURN(my_errno= HA_ERR_NO_CONNECTION);
-  }
-  ndb= get_ndb();
+
   dict= ndb->getDictionary();
+
   switch (info->ts_cmd_type){
   case (CREATE_TABLESPACE):
   {

--- 1.15/sql/ha_partition.cc	2005-12-22 15:10:56 +11:00
+++ 1.16/sql/ha_partition.cc	2005-12-29 18:19:37 +11:00
@@ -96,6 +96,7 @@
   NULL, /* Start Consistent Snapshot */
   NULL, /* Flush logs */
   NULL, /* Show status */
+  NULL, /* Alter Tablespace */
   HTON_NOT_USER_SELECTABLE
 };
 

--- 1.46/sql/ha_federated.cc	2005-12-22 05:24:56 +11:00
+++ 1.47/sql/ha_federated.cc	2005-12-29 18:19:36 +11:00
@@ -394,6 +394,7 @@
   NULL,    /* Start Consistent Snapshot */
   NULL,    /* Flush logs */
   NULL,    /* Show status */
+  NULL,    /* Alter Tablespace */
   HTON_ALTER_NOT_SUPPORTED
 };
 

--- 1.1/sql/sql_tablespace.cc	2005-12-23 15:32:41 +11:00
+++ 1.2/sql/sql_tablespace.cc	2005-12-29 18:19:37 +11:00
@@ -20,8 +20,7 @@
 
 int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info)
 {
-  int error;
-  handler *file;
+  int error= HA_ADMIN_NOT_IMPLEMENTED;
   handlerton *hton;
 
   DBUG_ENTER("mysql_alter_tablespace");
@@ -30,12 +29,8 @@
     default storage engine.
   */
   hton= ha_resolve_by_legacy_type(thd, ts_info->storage_engine);
-  if (!(file= get_new_handler((TABLE_SHARE*)NULL, thd->mem_root, hton)))
-  {
-    my_error(ER_OUTOFMEMORY, MYF(0), 128);
-    DBUG_RETURN(1);
-  }
-  if ((error= file->alter_tablespace(ts_info)))
+
+  if (hton->alter_tablespace && (error= hton->alter_tablespace(thd, ts_info)))
   {
     if (error == HA_ADMIN_NOT_IMPLEMENTED)
     {
Thread
bk commit into 5.1 tree (stewart:1.1983)Stewart Smith29 Dec