~drizzle-trunk/drizzle/development

1126.3.3 by Jay Pipes
Moves Alter_info out into its own header and source file, cleans up some related include mess in sql_lex.h, and renames Alter_info to AlterInfo.
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2009 Sun Microsystems
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
20
21
/**
22
 * @file Declaration of the AlterInfo class
23
 */
24
25
#ifndef DRIZZLED_ALTER_INFO_H
26
#define DRIZZLED_ALTER_INFO_H
27
28
#include "drizzled/base.h"
29
#include "drizzled/enum.h"
30
#include "drizzled/sql_list.h" /** @TODO use STL vectors! */
1237.9.4 by Padraig O'Sullivan
Removed the inclusion of drizzled/field.h in the server_includes header file.
31
#include "drizzled/key.h"
1237.9.3 by Padraig O'Sullivan
Removed one the includes I put in server_includes.h for the last commit to get rid of the inclusion
32
#include "drizzled/message/table.pb.h"
1126.3.3 by Jay Pipes
Moves Alter_info out into its own header and source file, cleans up some related include mess in sql_lex.h, and renames Alter_info to AlterInfo.
33
34
#include <bitset>
35
36
/* Some forward declarations needed */
37
class CreateField;
1126.3.4 by Jay Pipes
Changes Alter_drop and Alter_column to AlterDrop and AlterColumn. Next up: bye bye List<> in AlterInfo.
38
class AlterDrop;
39
class AlterColumn;
1126.3.3 by Jay Pipes
Moves Alter_info out into its own header and source file, cleans up some related include mess in sql_lex.h, and renames Alter_info to AlterInfo.
40
41
enum enum_alter_info_flags
42
{
43
  ALTER_ADD_COLUMN= 0,
44
  ALTER_DROP_COLUMN,
45
  ALTER_CHANGE_COLUMN,
46
  ALTER_COLUMN_STORAGE,
47
  ALTER_COLUMN_FORMAT,
48
  ALTER_COLUMN_ORDER,
49
  ALTER_ADD_INDEX,
50
  ALTER_DROP_INDEX,
51
  ALTER_RENAME,
52
  ALTER_ORDER,
53
  ALTER_OPTIONS,
54
  ALTER_COLUMN_DEFAULT,
55
  ALTER_KEYS_ONOFF,
56
  ALTER_STORAGE,
57
  ALTER_ROW_FORMAT,
58
  ALTER_CONVERT,
59
  ALTER_FORCE,
60
  ALTER_RECREATE,
61
  ALTER_TABLE_REORG,
62
  ALTER_FOREIGN_KEY
63
};
64
65
enum tablespace_op_type
66
{
67
  NO_TABLESPACE_OP,
68
  DISCARD_TABLESPACE,
69
  IMPORT_TABLESPACE
70
};
71
72
/**
73
 * Contains information about the parsed CREATE or ALTER TABLE statement.
74
 *
75
 * This structure contains a list of columns or indexes to be created,
76
 * altered or dropped.
77
 */
78
class AlterInfo
79
{
80
public:
1126.3.4 by Jay Pipes
Changes Alter_drop and Alter_column to AlterDrop and AlterColumn. Next up: bye bye List<> in AlterInfo.
81
  List<AlterDrop> drop_list;
82
  List<AlterColumn> alter_list;
1126.3.3 by Jay Pipes
Moves Alter_info out into its own header and source file, cleans up some related include mess in sql_lex.h, and renames Alter_info to AlterInfo.
83
  List<Key> key_list;
84
  List<CreateField> create_list;
1215.1.1 by stewart at flamingspork
[patch 01/17] horrible hack to have one lonely codepath produce Fields in the table proto
85
  drizzled::message::AlterTable alter_proto;
1126.3.3 by Jay Pipes
Moves Alter_info out into its own header and source file, cleans up some related include mess in sql_lex.h, and renames Alter_info to AlterInfo.
86
  std::bitset<32> flags;
87
  enum enum_enable_or_disable keys_onoff;
88
  enum tablespace_op_type tablespace_op;
89
  uint32_t no_parts;
90
  enum ha_build_method build_method;
91
  CreateField *datetime_field;
92
  bool error_if_not_empty;
93
94
  AlterInfo();
1253.1.3 by Monty Taylor
MEM_ROOT == memory::Root
95
  AlterInfo(const AlterInfo &rhs, drizzled::memory::Root *mem_root);
1126.3.3 by Jay Pipes
Moves Alter_info out into its own header and source file, cleans up some related include mess in sql_lex.h, and renames Alter_info to AlterInfo.
96
private:
97
  AlterInfo &operator=(const AlterInfo &rhs); // not implemented
98
  AlterInfo(const AlterInfo &rhs);            // not implemented
99
};
100
101
#endif /* DRIZZLED_ALTER_INFO_H */