1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2009 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; either version 2 of the License, or
9
* (at your option) any later version.
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.
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
21
#ifndef DRIZZLE_SERVER_SQL_COMMANDS_H
22
#define DRIZZLE_SERVER_SQL_COMMANDS_H
24
#include <drizzled/server_includes.h>
25
#include <drizzled/definitions.h>
26
#include <drizzled/logging.h>
27
#include <drizzled/db.h>
28
#include <drizzled/error.h>
29
#include <drizzled/query_id.h>
30
#include <drizzled/sql_parse.h>
31
#include <drizzled/sql_base.h>
32
#include <drizzled/show.h>
33
#include <drizzled/rename.h>
34
#include <drizzled/function/time/unix_timestamp.h>
35
#include <drizzled/function/get_system_var.h>
36
#include <drizzled/item/null.h>
37
#include <drizzled/sql_load.h>
38
#include <drizzled/connect.h>
39
#include <drizzled/lock.h>
50
* @brief Represents a command to be executed
55
SqlCommand(enum enum_sql_command in_comm_type,
58
comm_type(in_comm_type),
63
need_start_waiting(NULL)
66
SqlCommand(enum enum_sql_command in_comm_type,
68
TableList *in_all_tables)
70
comm_type(in_comm_type),
72
all_tables(in_all_tables),
75
need_start_waiting(NULL)
78
virtual ~SqlCommand() {}
83
virtual int execute();
85
void setTableList(TableList *in_all_tables)
87
all_tables= in_all_tables;
90
void setFirstTable(TableList *in_first_table)
92
first_table= in_first_table;
95
void setShowLock(pthread_mutex_t *in_lock)
100
void setNeedStartWaiting(bool *in_need_start_waiting)
102
need_start_waiting= in_need_start_waiting;
106
enum enum_sql_command comm_type;
108
TableList *all_tables;
109
TableList *first_table;
112
* A mutex that is only needed by the SHOW STATUS
113
* command but declare it in the base class since
114
* we will not know what command we are working with
117
pthread_mutex_t *show_lock;
118
bool *need_start_waiting;
122
* @class ShowStatusCommand
123
* @brief Represents the SHOW STATUS command
125
class ShowStatusCommand : public SqlCommand
128
ShowStatusCommand(enum enum_sql_command in_comm_type,
131
SqlCommand(in_comm_type, in_session)
137
} /* end namespace drizzled */
139
#endif /* DRIZZLE_SERVER_SQL_COMMANDS_H */