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
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
class select_create: public select_insert {
25
TableList *create_table;
26
bool is_if_not_exists;
27
HA_CREATE_INFO *create_info;
28
drizzled::message::Table *table_proto;
29
TableList *select_tables;
30
AlterInfo *alter_info;
32
/* lock data for tmp table */
34
/* m_lock or session->extra_lock */
35
DRIZZLE_LOCK **m_plock;
37
select_create (TableList *table_arg,
38
bool is_if_not_exists_arg,
39
HA_CREATE_INFO *create_info_par,
40
drizzled::message::Table *proto,
41
AlterInfo *alter_info_arg,
42
List<Item> &select_fields,enum_duplicates duplic, bool ignore,
43
TableList *select_tables_arg)
44
:select_insert (NULL, NULL, &select_fields, 0, 0, duplic, ignore),
45
create_table(table_arg),
46
is_if_not_exists(is_if_not_exists_arg),
47
create_info(create_info_par),
49
select_tables(select_tables_arg),
50
alter_info(alter_info_arg),
53
int prepare(List<Item> &list, Select_Lex_Unit *u);
55
void store_values(List<Item> &values);
56
void send_error(uint32_t errcode,const char *err);
59
virtual bool can_rollback_data() { return 1; }
61
// Needed for access from local class MY_HOOKS in prepare(), since session is proteted.
62
const Session *get_session(void) { return session; }
63
const HA_CREATE_INFO *get_create_info() { return create_info; };
64
int prepare2(void) { return 0; }
67
#endif /* DRIZZLED_SELECT_CREATE_H */