~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
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
25
#pragma once
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.
26
2179.7.7 by Olaf van der Spek
x
27
#include <drizzled/alter_column.h>
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
28
#include <drizzled/base.h>
29
#include <drizzled/enum.h>
30
#include <drizzled/key.h>
31
#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.
32
33
#include <bitset>
2179.7.1 by Olaf van der Spek
x
34
#include <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.
35
2179.7.7 by Olaf van der Spek
x
36
namespace drizzled {
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
37
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.
38
enum enum_alter_info_flags
39
{
40
  ALTER_ADD_COLUMN= 0,
41
  ALTER_DROP_COLUMN,
42
  ALTER_CHANGE_COLUMN,
43
  ALTER_COLUMN_STORAGE,
44
  ALTER_COLUMN_FORMAT,
45
  ALTER_COLUMN_ORDER,
46
  ALTER_ADD_INDEX,
47
  ALTER_DROP_INDEX,
48
  ALTER_RENAME,
49
  ALTER_ORDER,
50
  ALTER_OPTIONS,
51
  ALTER_COLUMN_DEFAULT,
52
  ALTER_KEYS_ONOFF,
53
  ALTER_STORAGE,
54
  ALTER_ROW_FORMAT,
55
  ALTER_CONVERT,
56
  ALTER_FORCE,
57
  ALTER_RECREATE,
58
  ALTER_TABLE_REORG,
59
  ALTER_FOREIGN_KEY
60
};
61
62
/**
63
 * Contains information about the parsed CREATE or ALTER TABLE statement.
64
 *
65
 * This structure contains a list of columns or indexes to be created,
66
 * altered or dropped.
67
 */
2318.6.90 by Olaf van der Spek
Refactor
68
class AlterInfo : boost::noncopyable
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.
69
{
70
public:
2179.7.2 by Olaf van der Spek
x
71
  typedef std::list<AlterColumn> alter_list_t;
2200.2.22 by Stewart Smith
merge trunk
72
2179.7.2 by Olaf van der Spek
x
73
  alter_list_t 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.
74
  List<Key> key_list;
75
  List<CreateField> create_list;
2200.2.1 by Stewart Smith
rename old alter table proto to AddedFields as it really has a dual purpose and isn't how we should structure Alter Table.
76
  message::AddedFields added_fields_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.
77
  std::bitset<32> flags;
78
  uint32_t no_parts;
79
  bool error_if_not_empty;
80
81
  AlterInfo();
2318.6.90 by Olaf van der Spek
Refactor
82
  AlterInfo(const AlterInfo&, memory::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.
83
};
84
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
85
} /* namespace drizzled */
86