~drizzle-trunk/drizzle/development

1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2009 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; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
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.
15
 *
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
19
 */
20
1100.3.4 by Padraig O'Sullivan
Updates based on code review from Jay.
21
#ifndef DRIZZLED_COMMAND_H
22
#define DRIZZLED_COMMAND_H
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
23
24
#include <drizzled/server_includes.h>
25
#include <drizzled/definitions.h>
26
#include <drizzled/error.h>
27
#include <drizzled/sql_parse.h>
28
#include <drizzled/sql_base.h>
29
#include <drizzled/show.h>
30
31
class Session;
32
class TableList;
33
class Item;
34
35
namespace drizzled
36
{
1100.3.4 by Padraig O'Sullivan
Updates based on code review from Jay.
37
namespace command
38
{
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
39
40
/**
41
 * @class SqlCommand
42
 * @brief Represents a command to be executed
43
 */
44
class SqlCommand
45
{
46
public:
47
  SqlCommand(enum enum_sql_command in_comm_type,
48
             Session *in_session)
49
    :
50
      comm_type(in_comm_type),
1100.3.4 by Padraig O'Sullivan
Updates based on code review from Jay.
51
      session(in_session)
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
52
  {}
53
54
  virtual ~SqlCommand() {}
55
56
  /**
1100.3.2 by Padraig O'Sullivan
Adding doxygen comments to the sql_commands header file.
57
   * Execute the command.
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
58
   *
1100.3.2 by Padraig O'Sullivan
Adding doxygen comments to the sql_commands header file.
59
   * @return 1 on failure; 0 on success
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
60
   */
1100.3.4 by Padraig O'Sullivan
Updates based on code review from Jay.
61
  virtual int execute()= 0;
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
62
63
protected:
1100.3.2 by Padraig O'Sullivan
Adding doxygen comments to the sql_commands header file.
64
65
  /**
66
   * The type of this command.
67
   */
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
68
  enum enum_sql_command comm_type;
1100.3.2 by Padraig O'Sullivan
Adding doxygen comments to the sql_commands header file.
69
70
  /**
71
   * A session handler.
72
   */
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
73
  Session *session;
1100.3.4 by Padraig O'Sullivan
Updates based on code review from Jay.
74
};
75
76
} /* end namespace command */
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
77
78
} /* end namespace drizzled */
79
1100.3.4 by Padraig O'Sullivan
Updates based on code review from Jay.
80
#endif /* DRIZZLED_COMMAND_H */