~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement.h

  • Committer: Lee Bieber
  • Date: 2011-03-29 22:31:41 UTC
  • mfrom: (2257.1.3 build)
  • Revision ID: kalebral@gmail.com-20110329223141-yxc22h3l2he58sk0
Merge Andrew - 743842: Build failure using GCC 4.6
Merge Stewart - 738022: CachedDirectory silently fails to add entries if stat() fails
Merge Olaf - Common fwd: add copyright, add more declaration

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_STATEMENT_H
22
 
#define DRIZZLED_STATEMENT_H
 
21
#pragma once
23
22
 
24
23
#include <drizzled/definitions.h>
25
24
#include <drizzled/error.h>
27
26
#include <drizzled/sql_base.h>
28
27
#include <drizzled/show.h>
29
28
 
30
 
namespace drizzled
31
 
{
32
 
 
33
 
class Session;
34
 
class TableList;
35
 
class Item;
36
 
 
37
 
namespace statement
38
 
{
 
29
namespace drizzled {
 
30
namespace statement {
39
31
 
40
32
/**
41
33
 * @class Statement
44
36
class Statement
45
37
{
46
38
public:
47
 
  Statement(Session *in_session)
48
 
    : 
49
 
      session(in_session)
 
39
  Statement(Session *in_session) :
 
40
    _session(*in_session)
50
41
  {}
51
42
 
52
43
  virtual ~Statement() {}
53
44
 
 
45
  void set_command(enum_sql_command);
 
46
  LEX& lex();
 
47
  session::Transactions& transaction();
 
48
 
54
49
  /**
55
50
   * Execute the statement.
56
51
   *
58
53
   */
59
54
  virtual bool execute()= 0;
60
55
 
61
 
  Session *getSession()
62
 
  {
63
 
    return session;
64
 
  }
65
 
 
66
 
protected:
67
 
 
68
 
  /**
69
 
   * A session handler.
70
 
   */
71
 
  Session *session;
 
56
  /* True if can be in transaction. Currently only DDL is not.
 
57
     This should go away when DDL commands are within transactions. */
 
58
  virtual bool isTransactional()
 
59
  {
 
60
    return false;
 
61
  }
 
62
 
 
63
  Session& session() const
 
64
  {
 
65
    return _session;
 
66
  }
 
67
 
 
68
  virtual bool isShow() { return false; }
 
69
 
 
70
private:
 
71
  Session& _session;
72
72
};
73
73
 
74
74
} /* namespace statement */
75
 
 
76
75
} /* namespace drizzled */
77
76
 
78
 
#endif /* DRIZZLED_STATEMENT_H */