~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
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2009 Sun Microsystems, Inc.
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
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.30 by Padraig O'Sullivan
Renamed the Command class to be Statement. Renamed the command directory to
21
#ifndef DRIZZLED_STATEMENT_H
22
#define DRIZZLED_STATEMENT_H
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
23
24
#include <drizzled/definitions.h>
25
#include <drizzled/error.h>
26
#include <drizzled/sql_parse.h>
27
#include <drizzled/sql_base.h>
28
#include <drizzled/show.h>
29
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
30
namespace drizzled
31
{
32
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
33
class Session;
34
class TableList;
35
class Item;
36
1100.3.28 by Padraig O'Sullivan
Renamed the command namespace where I was declaring all of these commands to
37
namespace statement
1100.3.4 by Padraig O'Sullivan
Updates based on code review from Jay.
38
{
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
39
40
/**
1100.3.30 by Padraig O'Sullivan
Renamed the Command class to be Statement. Renamed the command directory to
41
 * @class Statement
1100.3.28 by Padraig O'Sullivan
Renamed the command namespace where I was declaring all of these commands to
42
 * @brief Represents a statement to be executed
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
43
 */
1100.3.30 by Padraig O'Sullivan
Renamed the Command class to be Statement. Renamed the command directory to
44
class Statement
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
45
{
46
public:
2073.1.2 by Brian Aker
Basic DDL for catalog.
47
  Statement(Session *in_session) : 
2098.4.1 by Brian Aker
Make session encapsulated.
48
    _session(in_session)
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
49
  {}
50
1100.3.30 by Padraig O'Sullivan
Renamed the Command class to be Statement. Renamed the command directory to
51
  virtual ~Statement() {}
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
52
53
  /**
1100.3.28 by Padraig O'Sullivan
Renamed the command namespace where I was declaring all of these commands to
54
   * Execute the statement.
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
55
   *
1100.3.25 by Padraig O'Sullivan
Changed return type of the execute() function in Command classes to be bool
56
   * @return true on failure; false on success
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
57
   */
1100.3.25 by Padraig O'Sullivan
Changed return type of the execute() function in Command classes to be bool
58
  virtual bool execute()= 0;
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
59
1835.1.6 by Brian Aker
This patch returns dynamic SQL into the core (through SQL-Server syntax).
60
  Session *getSession()
61
  {
2098.4.1 by Brian Aker
Make session encapsulated.
62
    return _session;
1835.1.6 by Brian Aker
This patch returns dynamic SQL into the core (through SQL-Server syntax).
63
  }
64
2104.1.1 by Brian Aker
Merge in update to use console for catalog DDL.
65
  Session *getSession() const
66
  {
67
    return _session;
68
  }
69
2059.1.1 by Andrew Hutchings
Refix show_dictionary plugin crash when not using 'SHOW' to access.
70
  virtual bool isShow() { return false; }
71
2098.4.1 by Brian Aker
Make session encapsulated.
72
private:
1100.3.2 by Padraig O'Sullivan
Adding doxygen comments to the sql_commands header file.
73
  /**
74
   * A session handler.
75
   */
2098.4.1 by Brian Aker
Make session encapsulated.
76
  Session *_session;
1100.3.4 by Padraig O'Sullivan
Updates based on code review from Jay.
77
};
78
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
79
} /* namespace statement */
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
80
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
81
} /* namespace drizzled */
1100.3.1 by Padraig O'Sullivan
Beginnings of reworking the mysql_execute_command() method.
82
1100.3.30 by Padraig O'Sullivan
Renamed the Command class to be Statement. Renamed the command directory to
83
#endif /* DRIZZLED_STATEMENT_H */