1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems, Inc.
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; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_SELECT_CREATE_H
21
#define DRIZZLED_SELECT_CREATE_H
23
#include <drizzled/select_insert.h>
28
class select_create: public select_insert {
30
TableList *create_table;
31
bool is_if_not_exists;
32
HA_CREATE_INFO *create_info;
33
message::Table &table_proto;
34
TableList *select_tables;
35
AlterInfo *alter_info;
37
/* lock data for tmp table */
39
/* m_lock or session->extra_lock */
40
DrizzleLock **m_plock;
41
identifier::Table::const_reference identifier;
44
select_create (TableList *table_arg,
45
bool is_if_not_exists_arg,
46
HA_CREATE_INFO *create_info_par,
47
message::Table &proto,
48
AlterInfo *alter_info_arg,
49
List<Item> &select_fields,enum_duplicates duplic, bool ignore,
50
TableList *select_tables_arg,
51
identifier::Table::const_reference identifier_arg)
52
:select_insert (NULL, NULL, &select_fields, 0, 0, duplic, ignore),
53
create_table(table_arg),
54
is_if_not_exists(is_if_not_exists_arg),
55
create_info(create_info_par),
57
select_tables(select_tables_arg),
58
alter_info(alter_info_arg),
60
identifier(identifier_arg)
62
int prepare(List<Item> &list, Select_Lex_Unit *u);
64
void store_values(List<Item> &values);
65
void send_error(drizzled::error_t errcode,const char *err);
68
virtual bool can_rollback_data() { return true; }
70
// Needed for access from local class MY_HOOKS in prepare(), since session is proteted.
71
const Session *get_session(void) { return session; }
72
const HA_CREATE_INFO *get_create_info() { return create_info; }
73
int prepare2(void) { return 0; }
76
} /* namespace drizzled */
78
#endif /* DRIZZLED_SELECT_CREATE_H */