850
by Brian Aker
More class creation. |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
4 |
* Copyright (C) 2008 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; version 2 of the License.
|
|
9 |
*
|
|
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.
|
|
14 |
*
|
|
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
|
|
18 |
*/
|
|
19 |
||
20 |
||
21 |
#ifndef DRIZZLED_SELECT_CREATE_H
|
|
22 |
#define DRIZZLED_SELECT_CREATE_H
|
|
23 |
||
24 |
class select_create: public select_insert { |
|
25 |
order_st *group; |
|
26 |
TableList *create_table; |
|
27 |
HA_CREATE_INFO *create_info; |
|
28 |
TableList *select_tables; |
|
29 |
Alter_info *alter_info; |
|
30 |
Field **field; |
|
31 |
/* lock data for tmp table */
|
|
32 |
DRIZZLE_LOCK *m_lock; |
|
33 |
/* m_lock or session->extra_lock */
|
|
34 |
DRIZZLE_LOCK **m_plock; |
|
35 |
public: |
|
36 |
select_create (TableList *table_arg, |
|
37 |
HA_CREATE_INFO *create_info_par, |
|
38 |
Alter_info *alter_info_arg, |
|
39 |
List<Item> &select_fields,enum_duplicates duplic, bool ignore, |
|
40 |
TableList *select_tables_arg) |
|
41 |
:select_insert (NULL, NULL, &select_fields, 0, 0, duplic, ignore), |
|
42 |
create_table(table_arg), |
|
43 |
create_info(create_info_par), |
|
44 |
select_tables(select_tables_arg), |
|
45 |
alter_info(alter_info_arg), |
|
46 |
m_plock(NULL) |
|
47 |
{}
|
|
48 |
int prepare(List<Item> &list, Select_Lex_Unit *u); |
|
49 |
||
50 |
void store_values(List<Item> &values); |
|
51 |
void send_error(uint32_t errcode,const char *err); |
|
52 |
bool send_eof(); |
|
53 |
void abort(); |
|
54 |
virtual bool can_rollback_data() { return 1; } |
|
55 |
||
56 |
// Needed for access from local class MY_HOOKS in prepare(), since session is proteted.
|
|
57 |
const Session *get_session(void) { return session; } |
|
58 |
const HA_CREATE_INFO *get_create_info() { return create_info; }; |
|
59 |
int prepare2(void) { return 0; } |
|
60 |
};
|
|
61 |
||
62 |
#endif /* DRIZZLED_SELECT_CREATE_H */ |