~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_table.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-08-08 04:22:33 UTC
  • mto: (1115.3.4 captain)
  • mto: This revision was merged to the branch mainline in revision 1117.
  • Revision ID: osullivan.padraig@gmail.com-20090808042233-q0z88zc490z3f3r7
Renamed the Command class to be Statement. Renamed the command directory to
statement and also the command header file to statement. Updated various
source files to reflect this renaming.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
#ifndef DRIZZLED_STATEMENT_CREATE_TABLE_H
22
 
#define DRIZZLED_STATEMENT_CREATE_TABLE_H
23
 
 
24
 
#include "drizzled/statement.h"
25
 
#include "drizzled/foreign_key.h"
26
 
 
27
 
namespace drizzled
28
 
{
29
 
class Session;
30
 
 
31
 
namespace statement
32
 
{
33
 
 
34
 
class CreateTable : public Statement
35
 
{
36
 
public:
37
 
  CreateTable(Session *in_session)
38
 
    :
39
 
      Statement(in_session),
40
 
      is_create_table_like(false),
41
 
      is_if_not_exists(false),
42
 
      is_engine_set(false)
43
 
  {
44
 
    memset(&create_info, 0, sizeof(create_info));
45
 
 
46
 
    create_table_message.set_creation_timestamp(time(NULL));
47
 
    create_table_message.set_update_timestamp(time(NULL));
48
 
  }
49
 
 
50
 
  bool execute();
51
 
  message::Table create_table_message;
52
 
  message::Table &createTableMessage()
53
 
  {
54
 
    return create_table_message;
55
 
  };
56
 
  message::Table::Field *current_proto_field;
57
 
  HA_CREATE_INFO create_info;
58
 
  AlterInfo alter_info;
59
 
  KEY_CREATE_INFO key_create_info;
60
 
  enum Foreign_key::fk_match_opt fk_match_option;
61
 
  enum Foreign_key::fk_option fk_update_opt;
62
 
  enum Foreign_key::fk_option fk_delete_opt;
63
 
 
64
 
  /* The text in a CHANGE COLUMN clause in ALTER TABLE */
65
 
  char *change;
66
 
 
67
 
  /* An item representing the DEFAULT clause in CREATE/ALTER TABLE */
68
 
  Item *default_value;
69
 
 
70
 
  /* An item representing the ON UPDATE clause in CREATE/ALTER TABLE */
71
 
  Item *on_update_value;
72
 
 
73
 
  enum column_format_type column_format;
74
 
 
75
 
  /* Poly-use */
76
 
  LEX_STRING comment;
77
 
 
78
 
  bool is_create_table_like;
79
 
  bool is_if_not_exists;
80
 
  bool is_engine_set;
81
 
};
82
 
 
83
 
} /* namespace statement */
84
 
 
85
 
} /* namespace drizzled */
86
 
 
87
 
#endif /* DRIZZLED_STATEMENT_CREATE_TABLE_H */