List:Internals« Previous MessageNext Message »
From:mikael Date:April 5 2005 1:08pm
Subject:bk commit into 5.1-ndb tree (mronstrom:1.1797)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1-ndb repository of mikron. When mikron 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.1797 05/04/05 15:08:04 mronstrom@stripped +9 -0
  TABLESPACE command support

  sql/sql_tablespace.cc
    1.1 05/04/05 15:06:27 mikron@stripped +25 -0

  sql/sql_tablespace.cc
    1.0 05/04/05 15:06:27 mikron@stripped +0 -0
    BitKeeper file /Users/mikron/wl2510/sql/sql_tablespace.cc

  sql/sql_yacc.yy
    1.354 05/04/05 15:05:45 mikron@stripped +268 -1
    New syntax for TABLESPACE commands

  sql/sql_parse.cc
    1.416 05/04/05 15:05:45 mikron@stripped +6 -0
    Check if ALTER access rights then allow TABLESPACE commands

  sql/sql_lex.h
    1.170 05/04/05 15:05:45 mikron@stripped +8 -0
    New SQL commands and reference to new struct in lex struct

  sql/share/errmsg.txt
    1.16 05/04/05 15:05:44 mikron@stripped +2 -0
    New error message for TABLESPACE commands

  sql/mysql_priv.h
    1.280 05/04/05 15:05:44 mikron@stripped +1 -0
    New method to alter tablespaces

  sql/lex.h
    1.137 05/04/05 15:05:44 mikron@stripped +12 -0
    New keywords for TABLESPACE commands

  sql/handler.h
    1.131 05/04/05 15:05:44 mikron@stripped +60 -0
    New structs for altering and creating tablespaces

  sql/Makefile.am
    1.104 05/04/05 15:05:44 mikron@stripped +1 -0
    Added new file to make file for tablespace stuff

# 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:	mronstrom
# Host:	mikael-ronstr-ms-dator.local
# Root:	/Users/mikron/wl2510

--- 1.103/sql/Makefile.am	Thu Mar 17 01:22:48 2005
+++ 1.104/sql/Makefile.am	Tue Apr  5 15:05:44 2005
@@ -100,6 +100,7 @@
 			sp_cache.cc parse_file.cc sql_trigger.cc \
 			examples/ha_example.cc examples/ha_archive.cc \
 			examples/ha_tina.cc \
+                        sql_tablespace.cc \
 			ha_federated.cc
 
 gen_lex_hash_SOURCES =	gen_lex_hash.cc

--- 1.130/sql/handler.h	Sun Mar 13 21:58:00 2005
+++ 1.131/sql/handler.h	Tue Apr  5 15:05:44 2005
@@ -405,6 +405,64 @@
   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,
+  CHANGE_FILE_LOGFILE_GROUP = 7,
+  ALTER_ACCESS_MODE_TABLESPACE = 8
+};
+
+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;
+  enum ts_command_type ts_cmd_type;
+  char *data_file_name;
+  uint extent_size;
+  ulonglong initial_size;
+  ulonglong autoextend_size;
+  ulonglong max_size;
+  uint nodegroup_id;
+  enum db_type storage_engine;
+  bool wait_until_completed;
+  char *ts_comment;
+  enum tablespace_access_mode ts_access_mode;
+  st_alter_tablespace()
+  {
+    tablespace_name= NULL;
+    ts_cmd_type= TS_CMD_NOT_DEFINED;
+    data_file_name= NULL;
+    extent_size= 0;
+    initial_size= 0;
+    autoextend_size= 0;
+    max_size= 0;
+    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
 {
@@ -634,6 +692,8 @@
   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.136/sql/lex.h	Fri Feb 25 19:19:00 2005
+++ 1.137/sql/lex.h	Tue Apr  5 15:05:44 2005
@@ -59,6 +59,7 @@
   { "<<",		SYM(SHIFT_LEFT)},
   { ">>",		SYM(SHIFT_RIGHT)},
   { "<=>",		SYM(EQUAL_SYM)},
+  { "ACCESSIBLE",	SYM(ACCESSIBLE_SYM)},
   { "ACTION",		SYM(ACTION)},
   { "ADD",		SYM(ADD)},
   { "AFTER",		SYM(AFTER_SYM)},
@@ -75,6 +76,7 @@
   { "ASCII",		SYM(ASCII_SYM)},
   { "ASENSITIVE",       SYM(ASENSITIVE_SYM)},
   { "AUTO_INCREMENT",	SYM(AUTO_INC)},
+  { "AUTOEXTEND_SIZE",	SYM(AUTOEXTEND_SIZE_SYM)},
   { "AVG",		SYM(AVG_SYM)},
   { "AVG_ROW_LENGTH",	SYM(AVG_ROW_LENGTH)},
   { "BACKUP",	        SYM(BACKUP_SYM)},
@@ -138,6 +140,7 @@
   { "DATA",		SYM(DATA_SYM)},
   { "DATABASE",		SYM(DATABASE)},
   { "DATABASES",	SYM(DATABASES)},
+  { "DATAFILE", 	SYM(DATAFILE_SYM)},
   { "DATE",		SYM(DATE_SYM)},
   { "DATETIME",		SYM(DATETIME)},
   { "DAY",		SYM(DAY_SYM)},
@@ -190,6 +193,7 @@
   { "EXPANSION",	SYM(EXPANSION_SYM)},
   { "EXPLAIN",		SYM(DESCRIBE)},
   { "EXTENDED",		SYM(EXTENDED_SYM)},
+  { "EXTENT_SIZE",	SYM(EXTENT_SIZE_SYM)},
   { "FALSE",		SYM(FALSE_SYM)},
   { "FAST",		SYM(FAST_SYM)},
   { "FETCH",            SYM(FETCH_SYM)},
@@ -236,6 +240,7 @@
   { "INDEX",		SYM(INDEX_SYM)},
   { "INDEXES",		SYM(INDEXES)},
   { "INFILE",		SYM(INFILE)},
+  { "INITIAL_SIZE",	SYM(INITIAL_SIZE_SYM)},
   { "INNER",		SYM(INNER_SYM)},
   { "INNOBASE",		SYM(INNOBASE_SYM)},
   { "INNODB",		SYM(INNOBASE_SYM)},
@@ -280,6 +285,7 @@
   { "LOCALTIMESTAMP",	SYM(NOW_SYM)},
   { "LOCK",		SYM(LOCK_SYM)},
   { "LOCKS",		SYM(LOCKS_SYM)},
+  { "LOGFILE",		SYM(LOGFILE_SYM)},
   { "LOGS",		SYM(LOGS_SYM)},
   { "LONG",		SYM(LONG_SYM)},
   { "LONGBLOB",		SYM(LONGBLOB)},
@@ -305,6 +311,7 @@
   { "MAX_CONNECTIONS_PER_HOUR", SYM(MAX_CONNECTIONS_PER_HOUR)},
   { "MAX_QUERIES_PER_HOUR", SYM(MAX_QUERIES_PER_HOUR)},
   { "MAX_ROWS",		SYM(MAX_ROWS)},
+  { "MAX_SIZE",		SYM(MAX_SIZE_SYM)},
   { "MAX_UPDATES_PER_HOUR", SYM(MAX_UPDATES_PER_HOUR)},
   { "MAX_USER_CONNECTIONS", SYM(MAX_USER_CONNECTIONS_SYM)},
   { "MEDIUM",		SYM(MEDIUM_SYM)},
@@ -338,6 +345,8 @@
   { "NEW",              SYM(NEW_SYM)},
   { "NEXT",		SYM(NEXT_SYM)},
   { "NO",		SYM(NO_SYM)},
+  { "NO_WAIT",		SYM(NO_WAIT_SYM)},
+  { "NODEGROUP",	SYM(NODEGROUP_SYM)},
   { "NONE",		SYM(NONE_SYM)},
   { "NOT",		SYM(NOT_SYM)},
   { "NO_WRITE_TO_BINLOG",  SYM(NO_WRITE_TO_BINLOG)},
@@ -381,6 +390,8 @@
   { "RAID_CHUNKSIZE",	SYM(RAID_CHUNKSIZE)},
   { "RAID_TYPE",	SYM(RAID_TYPE)},
   { "READ",		SYM(READ_SYM)},
+  { "READ_ONLY",	SYM(READ_ONLY_SYM)},
+  { "READ_WRITE",	SYM(READ_WRITE_SYM)},
   { "READS",		SYM(READS_SYM)},
   { "REAL",		SYM(REAL)},
   { "RECOVER",          SYM(RECOVER_SYM)},
@@ -523,6 +534,7 @@
   { "VARCHARACTER",	SYM(VARCHAR)},
   { "VARIABLES",	SYM(VARIABLES)},
   { "VARYING",		SYM(VARYING)},
+  { "WAIT",		SYM(WAIT_SYM)},
   { "WARNINGS",		SYM(WARNINGS)},
   { "WEEK",		SYM(WEEK_SYM)},
   { "WHEN",		SYM(WHEN_SYM)},

--- 1.279/sql/mysql_priv.h	Thu Mar 17 08:46:33 2005
+++ 1.280/sql/mysql_priv.h	Tue Apr  5 15:05:44 2005
@@ -602,6 +602,7 @@
 bool mysql_xa_recover(THD *thd);
 
 bool check_simple_select();
+int mysql_alter_tablespace(st_alter_tablespace *ts_info);
 
 SORT_FIELD * make_unireg_sortorder(ORDER *order, uint *length);
 int setup_order(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,

--- 1.169/sql/sql_lex.h	Wed Mar 16 02:32:42 2005
+++ 1.170/sql/sql_lex.h	Tue Apr  5 15:05:45 2005
@@ -25,6 +25,7 @@
 class sp_name;
 class sp_instr;
 class sp_pcontext;
+class st_alter_tablespace;
 
 /*
   The following hack is needed because mysql_yacc.cc does not define
@@ -89,6 +90,7 @@
   SQLCOM_CREATE_TRIGGER, SQLCOM_DROP_TRIGGER,
   SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE,
   SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER,
+  SQLCOM_ALTER_TABLESPACE,
   /* This should be the last !!! */
 
   SQLCOM_END
@@ -815,6 +817,12 @@
     during replication ("LOCAL 'filename' REPLACE INTO" part).
   */
   uchar *fname_start, *fname_end;
+
+  /*
+    Reference to a struct that contains information in various commands
+    to add/create/drop/change table spaces.
+  */
+  st_alter_tablespace *alter_tablespace_info;
 
   st_lex() :result(0), sql_command(SQLCOM_END), query_tables_own_last(0)
   {

--- 1.415/sql/sql_parse.cc	Sat Mar 19 13:49:16 2005
+++ 1.416/sql/sql_parse.cc	Tue Apr  5 15:05:45 2005
@@ -4476,6 +4476,12 @@
   case SQLCOM_XA_RECOVER:
     res= mysql_xa_recover(thd);
     break;
+  case SQLCOM_ALTER_TABLESPACE:
+    if (check_access(thd, ALTER_ACL, thd->db, 0, 1, 0))
+      break;
+    if (!(res= mysql_alter_tablespace(lex->alter_tablespace_info)))
+      send_ok(thd);
+    break;
   default:
     DBUG_ASSERT(0);                             /* Impossible */
     send_ok(thd);

--- 1.353/sql/sql_yacc.yy	Wed Mar 16 21:59:05 2005
+++ 1.354/sql/sql_yacc.yy	Tue Apr  5 15:05:45 2005
@@ -117,6 +117,7 @@
 %token  END_OF_INPUT
 
 %token  ABORT_SYM
+%token  ACCESSIBLE_SYM
 %token  ACTION
 %token  ADD
 %token  ADDDATE_SYM
@@ -136,6 +137,7 @@
 %token  ASENSITIVE_SYM
 %token  ATAN
 %token  AUTO_INC
+%token  AUTOEXTEND_SIZE_SYM
 %token  AVG_ROW_LENGTH
 %token  AVG_SYM
 %token  BACKUP_SYM
@@ -204,6 +206,7 @@
 %token  CURTIME
 %token  DATABASE
 %token  DATABASES
+%token  DATAFILE_SYM
 %token  DATA_SYM
 %token  DATETIME
 %token  DATE_ADD_INTERVAL
@@ -266,6 +269,7 @@
 %token  EXPANSION_SYM
 %token  EXPORT_SET
 %token  EXTENDED_SYM
+%token  EXTENT_SIZE_SYM
 %token  EXTRACT_SYM
 %token  FALSE_SYM
 %token  FAST_SYM
@@ -328,6 +332,7 @@
 %token  INDEXES
 %token  INDEX_SYM
 %token  INFILE
+%token  INITIAL_SIZE_SYM
 %token  INNER_SYM
 %token  INNOBASE_SYM
 %token  INOUT_SYM
@@ -370,6 +375,7 @@
 %token  LOCATOR_SYM
 %token  LOCKS_SYM
 %token  LOCK_SYM
+%token  LOGFILE_SYM
 %token  LOGS_SYM
 %token  LOG_SYM
 %token  LONGBLOB
@@ -400,6 +406,7 @@
 %token  MAX_CONNECTIONS_PER_HOUR
 %token  MAX_QUERIES_PER_HOUR
 %token  MAX_ROWS
+%token  MAX_SIZE_SYM
 %token  MAX_SYM
 %token  MAX_UPDATES_PER_HOUR
 %token  MAX_USER_CONNECTIONS_SYM
@@ -437,11 +444,13 @@
 %token  NE
 %token  NEW_SYM
 %token  NEXT_SYM
+%token  NODEGROUP_SYM
 %token  NONE_SYM
 %token  NOT2_SYM
 %token  NOT_SYM
 %token  NOW_SYM
 %token  NO_SYM
+%token  NO_WAIT_SYM
 %token  NO_WRITE_TO_BINLOG
 %token  NULL_SYM
 %token  NUM
@@ -491,7 +500,9 @@
 %token  RAID_TYPE
 %token  RAND
 %token  READS_SYM
+%token  READ_ONLY_SYM
 %token  READ_SYM
+%token  READ_WRITE_SYM
 %token  REAL
 %token  RECOVER_SYM
 %token  REDUNDANT_SYM
@@ -641,6 +652,7 @@
 %token  VARIANCE_SYM
 %token  VARYING
 %token  VIEW_SYM
+%token  WAIT_SYM
 %token  WARNINGS
 %token  WEEK_SYM
 %token  WHEN_SYM
@@ -705,7 +717,7 @@
 	ULONG_NUM raid_types merge_insert_types
 
 %type <ulonglong_number>
-	ulonglong_num
+	ulonglong_num size_number
 
 %type <lock_type>
 	replace_lock_option opt_low_priority insert_lock_option load_data_lock
@@ -1247,6 +1259,16 @@
 	  }
 	  opt_view_list AS select_init check_option
 	  {}
+        | CREATE LOGFILE_SYM GROUP tablespace_info
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_cmd_type= CREATE_LOGFILE_GROUP;
+          }
+        | CREATE TABLESPACE tablespace_info
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_cmd_type= CREATE_TABLESPACE;
+          }
         | CREATE TRIGGER_SYM ident trg_action_time trg_event 
           ON table_ident FOR_SYM EACH_SYM ROW_SYM
           {
@@ -2467,6 +2489,216 @@
           | DELETE_SYM
             { Lex->trg_chistics.event= TRG_EVENT_DELETE; }
           ;
+/*
+  This part of the parser contains common code for all TABLESPACE
+  commands.
+  CREATE TABLESPACE name ...
+  ALTER TABLESPACE name CHANGE DATAFILE ...
+  ALTER TABLESPACE name ADD DATAFILE ...
+  ALTER TABLESPACE name access_mode
+  CREATE LOGFILE GROUP name ...
+  ALTER LOGFILE GROUP name CHANGE DATAFILE ...
+  ALTER LOGFILE GROUP name ADD DATAFILE ..
+  DROP TABLESPACE name
+  DROP LOGFILE GROUP name
+*/
+change_tablespace_access:
+          tablespace_name {}
+          ts_access_mode
+          ;
+
+change_tablespace_info:
+          tablespace_name {}
+          CHANGE ts_datafile
+          change_ts_option_list
+          ;
+
+tablespace_info:
+          tablespace_name {}
+          ADD ts_datafile
+          tablespace_option_list
+          ;
+
+change_ts_option_list:
+          /* empty */ {}
+          change_ts_options
+          ;
+
+change_ts_options:
+          change_ts_option
+          | change_ts_options change_ts_option
+          | change_ts_options ',' change_ts_option
+          ;
+
+change_ts_option:
+          opt_ts_initial_size
+          | opt_ts_autoextend_size
+          | opt_ts_max_size
+          ;
+
+tablespace_option_list:
+          /* empty */ {}
+          tablespace_options
+          ;
+
+tablespace_options:
+          tablespace_option
+          | tablespace_options tablespace_option
+          | tablespace_options ',' tablespace_option
+          ;
+
+tablespace_option:
+          opt_ts_initial_size
+          | opt_ts_autoextend_size
+          | opt_ts_max_size
+          | opt_ts_extent_size
+          | opt_ts_nodegroup
+          | opt_ts_engine
+          | opt_ts_wait
+          | opt_ts_comment
+          ;
+
+ts_datafile:
+          DATAFILE_SYM ident_or_text
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->data_file_name= $2.str;
+          };
+
+tablespace_name:
+          ident_or_text
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info= new st_alter_tablespace();
+            lex->alter_tablespace_info->tablespace_name= $1.str;
+            lex->sql_command= SQLCOM_ALTER_TABLESPACE;
+          };
+
+ts_access_mode:
+          READ_ONLY_SYM
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_access_mode= TS_READ_ONLY;
+          }
+          | READ_WRITE_SYM
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_access_mode= TS_READ_WRITE;
+          }
+          | NOT_SYM ACCESSIBLE_SYM
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_access_mode= TS_NOT_ACCESSIBLE;
+          };
+
+opt_ts_initial_size:
+          INITIAL_SIZE_SYM opt_equal size_number
+          {
+            LEX *lex= Lex;
+            if (lex->alter_tablespace_info->initial_size != 0)
+            {
+              my_error(ER_TABLESPACE_OPTION_ONLY_ONCE, "INITIAL_SIZE", MYF(0));
+              YYABORT;
+            }
+            lex->alter_tablespace_info->initial_size= $3;
+          };
+
+opt_ts_autoextend_size:
+          AUTOEXTEND_SIZE_SYM opt_equal size_number
+          {
+            LEX *lex= Lex;
+            if (lex->alter_tablespace_info->autoextend_size != 0)
+            {
+              my_error(ER_TABLESPACE_OPTION_ONLY_ONCE, "AUTOEXTEND_SIZE", MYF(0));
+              YYABORT;
+            }
+            lex->alter_tablespace_info->autoextend_size= $3;
+          };
+
+opt_ts_max_size:
+          MAX_SIZE_SYM opt_equal size_number
+          {
+            LEX *lex= Lex;
+            if (lex->alter_tablespace_info->max_size != 0)
+            {
+              my_error(ER_TABLESPACE_OPTION_ONLY_ONCE, "MAX_SIZE", MYF(0));
+              YYABORT;
+            }
+            lex->alter_tablespace_info->max_size= $3;
+          };
+
+opt_ts_extent_size:
+          EXTENT_SIZE_SYM opt_equal size_number
+          {
+            LEX *lex= Lex;
+            if (lex->alter_tablespace_info->extent_size != 0)
+            {
+              my_error(ER_TABLESPACE_OPTION_ONLY_ONCE, "EXTENT_SIZE", MYF(0));
+              YYABORT;
+            }
+            lex->alter_tablespace_info->extent_size= $3;
+          };
+
+opt_ts_nodegroup:
+          NODEGROUP_SYM opt_equal ULONG_NUM
+          {
+            LEX *lex= Lex;
+            if (lex->alter_tablespace_info->nodegroup_id != UNDEF_NODEGROUP)
+            {
+              my_error(ER_TABLESPACE_OPTION_ONLY_ONCE, "NODEGROUP", MYF(0));
+              YYABORT;
+            }
+            lex->alter_tablespace_info->nodegroup_id= $3;
+          };
+
+opt_ts_comment:
+          COMMENT_SYM opt_equal ident_or_text 
+          {
+            LEX *lex= Lex;
+            if (lex->alter_tablespace_info->ts_comment != NULL)
+            {
+              my_error(ER_TABLESPACE_OPTION_ONLY_ONCE, "COMMENT", MYF(0));
+              YYABORT;
+            }
+            lex->alter_tablespace_info->ts_comment= $3.str;
+          };
+
+opt_ts_engine:
+          opt_storage ENGINE_SYM opt_equal storage_engines
+          {
+            LEX *lex= Lex;
+            if (lex->alter_tablespace_info->storage_engine != DB_TYPE_UNKNOWN)
+            {
+              my_error(ER_TABLESPACE_OPTION_ONLY_ONCE, "STORAGE ENGINE", MYF(0));
+              YYABORT;
+            }
+            lex->alter_tablespace_info->storage_engine= $4;
+          };
+
+opt_ts_wait:
+          WAIT_SYM
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->wait_until_completed= TRUE;
+          }
+          | NO_WAIT_SYM
+          {
+            LEX *lex= Lex;
+            if (!(lex->alter_tablespace_info->wait_until_completed))
+            {
+              my_error(ER_TABLESPACE_OPTION_ONLY_ONCE, "NO_WAIT", MYF(0));
+              YYABORT;
+            }
+            lex->alter_tablespace_info->wait_until_completed= FALSE;
+          };
+
+//TODO: Fix size number to handle 20M 20k and so forth
+size_number:
+          ulonglong_num {}; 
+
+/*
+  End tablespace part
+*/
 
 create2:
         '(' create2a {}
@@ -3316,6 +3548,31 @@
 	  }
 	  opt_view_list AS select_init check_option
 	  {}
+        | ALTER TABLESPACE tablespace_info
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_cmd_type= ALTER_TABLESPACE;
+          }
+        | ALTER LOGFILE_SYM GROUP tablespace_info
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_cmd_type= ALTER_LOGFILE_GROUP;
+          }
+        | ALTER TABLESPACE change_tablespace_info
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_cmd_type= CHANGE_FILE_TABLESPACE;
+          }
+        | ALTER LOGFILE_SYM GROUP change_tablespace_info
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_cmd_type= CHANGE_FILE_LOGFILE_GROUP;
+          }
+        | ALTER TABLESPACE change_tablespace_access 
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_cmd_type= ALTER_ACCESS_MODE_TABLESPACE;
+          }
 	;
 
 ident_or_empty:
@@ -5741,6 +5998,16 @@
                                                    TL_WRITE))
               YYABORT;
             lex->ident= $5;
+          }
+        | DROP TABLESPACE tablespace_name
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_cmd_type= DROP_TABLESPACE;
+          }
+        | DROP LOGFILE_SYM GROUP tablespace_name
+          {
+            LEX *lex= Lex;
+            lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP;
           }
 	;
 

--- 1.15/sql/share/errmsg.txt	Wed Mar 16 02:32:42 2005
+++ 1.16/sql/share/errmsg.txt	Tue Apr  5 15:05:44 2005
@@ -5332,3 +5332,5 @@
 	eng "%s: ready for connections.\nVersion: '%s'  socket: '%s'  port: %d  %s"
 ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR
         eng "Can't load value from file with fixed size rows to variable"
+ER_TABLESPACE_OPTION_ONLY_ONCE
+        eng "It is not allowed to specify %s more than once"
--- New file ---
+++ sql/sql_tablespace.cc	05/04/05 15:06:27
/* Copyright (C) 2000-2004 MySQL AB

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

/* drop and alter of tablespaces */

#include "mysql_priv.h"

int mysql_alter_tablespace(st_alter_tablespace *ts_info)
{
  DBUG_ENTER("mysql_alter_tablespace");
  DBUG_RETURN(FALSE);
}

Thread
bk commit into 5.1-ndb tree (mronstrom:1.1797)mikael5 Apr