~drizzle-trunk/drizzle/development

837 by Brian Aker
Reworked some classes out of session.h
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) 2008 Sun Microsystems, Inc.
837 by Brian Aker
Reworked some classes out of session.h
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
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
21
#pragma once
837 by Brian Aker
Reworked some classes out of session.h
22
2148.7.3 by Brian Aker
Remove/set a couple of headers.
23
#include <drizzled/current_session.h>
24
2252.1.16 by Olaf van der Spek
Common fwd
25
namespace drizzled {
1130.3.23 by Monty Taylor
Removed more server_includes.h from headers.
26
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
27
class select_result :public memory::SqlAlloc {
837 by Brian Aker
Reworked some classes out of session.h
28
protected:
29
  Session *session;
848 by Brian Aker
typdef class removal (just... use the name of the class).
30
  Select_Lex_Unit *unit;
2148.7.3 by Brian Aker
Remove/set a couple of headers.
31
837 by Brian Aker
Reworked some classes out of session.h
32
public:
33
  select_result()
34
  {
35
    session= current_session;
36
  }
1891.2.1 by Monty Taylor
Fixed things to make things compile with clang
37
  virtual ~select_result() {}
837 by Brian Aker
Reworked some classes out of session.h
38
  virtual int prepare(List<Item> &,
848 by Brian Aker
typdef class removal (just... use the name of the class).
39
                      Select_Lex_Unit *u)
837 by Brian Aker
Reworked some classes out of session.h
40
  {
41
    unit= u;
42
    return 0;
43
  }
44
  /*
45
    Because of peculiarities of prepared statements protocol
46
    we need to know number of columns in the result set (if
47
    there is a result set) apart from sending columns metadata.
48
  */
49
  virtual uint32_t field_count(List<Item> &fields) const
2183.2.17 by Olaf van der Spek
Use List::size()
50
  { return fields.size(); }
2318.3.10 by Olaf van der Spek
Return void
51
  virtual void send_fields(List<Item>&)=0;
52
  virtual bool send_data(List<Item>&)=0;
53
  virtual bool initialize_tables(Join*)
837 by Brian Aker
Reworked some classes out of session.h
54
  { return 0; }
55
  virtual bool send_eof()=0;
56
  virtual void abort() {}
57
  void set_session(Session *session_arg) { session= session_arg; }
58
  void begin_dataset() {}
59
60
  /*****************************************************************************
61
   ** Functions to provide a interface to select results
62
   *****************************************************************************/
63
2087.3.1 by Brian Aker
Entire convert over to time_t.
64
  virtual void send_error(drizzled::error_t errcode, const char *err);
837 by Brian Aker
Reworked some classes out of session.h
65
66
  /*
67
    Cleanup instance of this class for next execution of a prepared
68
    statement/stored procedure.
69
  */
70
  virtual void cleanup()
71
  {
72
    /* do nothing */
73
  }
74
75
};
76
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
77
} /* namespace drizzled */
78