Drizzled Public API Documentation

alter_info.h

00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2009 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00025 #pragma once
00026 
00027 #include <drizzled/alter_column.h>
00028 #include <drizzled/alter_drop.h>
00029 #include <drizzled/base.h>
00030 #include <drizzled/enum.h>
00031 #include <drizzled/key.h>
00032 #include <drizzled/message/table.pb.h>
00033 
00034 #include <bitset>
00035 #include <list>
00036 
00037 namespace drizzled {
00038 
00039 class CreateField;
00040 
00041 enum enum_alter_info_flags
00042 {
00043   ALTER_ADD_COLUMN= 0,
00044   ALTER_DROP_COLUMN,
00045   ALTER_CHANGE_COLUMN,
00046   ALTER_COLUMN_STORAGE,
00047   ALTER_COLUMN_FORMAT,
00048   ALTER_COLUMN_ORDER,
00049   ALTER_ADD_INDEX,
00050   ALTER_DROP_INDEX,
00051   ALTER_RENAME,
00052   ALTER_ORDER,
00053   ALTER_OPTIONS,
00054   ALTER_COLUMN_DEFAULT,
00055   ALTER_KEYS_ONOFF,
00056   ALTER_STORAGE,
00057   ALTER_ROW_FORMAT,
00058   ALTER_CONVERT,
00059   ALTER_FORCE,
00060   ALTER_RECREATE,
00061   ALTER_TABLE_REORG,
00062   ALTER_FOREIGN_KEY
00063 };
00064 
00065 enum tablespace_op_type
00066 {
00067   NO_TABLESPACE_OP,
00068   DISCARD_TABLESPACE,
00069   IMPORT_TABLESPACE
00070 };
00071 
00078 class AlterInfo
00079 {
00080 public:
00081   typedef std::list<AlterDrop> drop_list_t;
00082   typedef std::list<AlterColumn> alter_list_t;
00083   
00084   drop_list_t drop_list;
00085   alter_list_t alter_list;
00086   List<Key> key_list;
00087   List<CreateField> create_list;
00088   message::AlterTable alter_proto;
00089   std::bitset<32> flags;
00090   enum enum_enable_or_disable keys_onoff;
00091   enum tablespace_op_type tablespace_op;
00092   uint32_t no_parts;
00093   enum ha_build_method build_method;
00094   bool error_if_not_empty;
00095 
00096   AlterInfo();
00097   AlterInfo(const AlterInfo &rhs, memory::Root *mem_root);
00098 private:
00099   AlterInfo &operator=(const AlterInfo &rhs); // not implemented
00100   AlterInfo(const AlterInfo &rhs);            // not implemented
00101 };
00102 
00103 } /* namespace drizzled */
00104