~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
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2009 Sun Microsystems, Inc.
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.
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
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
36
namespace drizzled
37
{
38
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.
39
/* Some forward declarations needed */
40
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.
41
class AlterDrop;
42
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.
43
44
enum enum_alter_info_flags
45
{
46
  ALTER_ADD_COLUMN= 0,
47
  ALTER_DROP_COLUMN,
48
  ALTER_CHANGE_COLUMN,
49
  ALTER_COLUMN_STORAGE,
50
  ALTER_COLUMN_FORMAT,
51
  ALTER_COLUMN_ORDER,
52
  ALTER_ADD_INDEX,
53
  ALTER_DROP_INDEX,
54
  ALTER_RENAME,
55
  ALTER_ORDER,
56
  ALTER_OPTIONS,
57
  ALTER_COLUMN_DEFAULT,
58
  ALTER_KEYS_ONOFF,
59
  ALTER_STORAGE,
60
  ALTER_ROW_FORMAT,
61
  ALTER_CONVERT,
62
  ALTER_FORCE,
63
  ALTER_RECREATE,
64
  ALTER_TABLE_REORG,
65
  ALTER_FOREIGN_KEY
66
};
67
68
enum tablespace_op_type
69
{
70
  NO_TABLESPACE_OP,
71
  DISCARD_TABLESPACE,
72
  IMPORT_TABLESPACE
73
};
74
75
/**
76
 * Contains information about the parsed CREATE or ALTER TABLE statement.
77
 *
78
 * This structure contains a list of columns or indexes to be created,
79
 * altered or dropped.
80
 */
81
class AlterInfo
82
{
83
public:
1126.3.4 by Jay Pipes
Changes Alter_drop and Alter_column to AlterDrop and AlterColumn. Next up: bye bye List<> in AlterInfo.
84
  List<AlterDrop> drop_list;
85
  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.
86
  List<Key> key_list;
87
  List<CreateField> create_list;
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
88
  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.
89
  std::bitset<32> flags;
90
  enum enum_enable_or_disable keys_onoff;
91
  enum tablespace_op_type tablespace_op;
92
  uint32_t no_parts;
93
  enum ha_build_method build_method;
94
  bool error_if_not_empty;
95
96
  AlterInfo();
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
97
  AlterInfo(const AlterInfo &rhs, 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.
98
private:
99
  AlterInfo &operator=(const AlterInfo &rhs); // not implemented
100
  AlterInfo(const AlterInfo &rhs);            // not implemented
101
};
102
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
103
} /* namespace drizzled */
104
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.
105
#endif /* DRIZZLED_ALTER_INFO_H */