~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_table.h

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
33
33
 
34
34
class CreateTable : public Statement
35
35
{
36
 
  virtual bool check(const identifier::Table&);
37
 
 
38
36
public:
39
 
  CreateTable(Session *in_session, Table_ident *ident, bool is_temporary);
40
 
  CreateTable(Session *in_session);
41
 
 
42
 
  virtual bool is_alter() const
 
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
43
  {
44
 
    return false;
 
44
    memset(&create_info, 0, sizeof(create_info));
45
45
  }
46
46
 
47
47
  bool execute();
48
 
 
49
 
  virtual bool executeInner(identifier::Table::const_reference);
50
 
 
51
 
public:
 
48
  message::Table create_table_message;
52
49
  message::Table &createTableMessage()
53
50
  {
54
 
    return *getSession()->lex->table();
 
51
    return create_table_message;
55
52
  };
56
 
 
57
 
private:
58
 
  HA_CREATE_INFO _create_info;
59
 
 
60
 
public:
61
 
 
62
 
  HA_CREATE_INFO &create_info()
63
 
  {
64
 
    if (createTableMessage().options().auto_increment_value())
65
 
    {
66
 
      _create_info.auto_increment_value= createTableMessage().options().auto_increment_value();
67
 
      _create_info.used_fields|= HA_CREATE_USED_AUTO;
68
 
    }
69
 
 
70
 
    return _create_info;
71
 
  }
72
 
 
 
53
  message::Table::Field *current_proto_field;
 
54
  HA_CREATE_INFO create_info;
73
55
  AlterInfo alter_info;
74
56
  KEY_CREATE_INFO key_create_info;
75
57
  message::Table::ForeignKeyConstraint::ForeignKeyMatchOption fk_match_option;
90
72
  /* Poly-use */
91
73
  LEX_STRING comment;
92
74
 
 
75
  bool is_create_table_like;
 
76
  bool is_if_not_exists;
93
77
  bool is_engine_set;
94
 
  bool is_create_table_like;
95
 
  bool lex_identified_temp_table;
96
 
  bool link_to_local;
97
 
  TableList *create_table_list;
98
78
 
99
79
  bool validateCreateTableOption();
100
80
};