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 |
*
|
|
4 |
* Copyright (C) 2008 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; 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 |
||
21 |
#ifndef DRIZZLED_SELECT_RESULT_H
|
|
22 |
#define DRIZZLED_SELECT_RESULT_H
|
|
23 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
24 |
namespace drizzled |
25 |
{
|
|
26 |
||
1541.1.1
by Brian Aker
JOIN -> Join rename |
27 |
class Join; |
1130.3.23
by Monty Taylor
Removed more server_includes.h from headers. |
28 |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
29 |
class select_result :public memory::SqlAlloc { |
837
by Brian Aker
Reworked some classes out of session.h |
30 |
protected: |
31 |
Session *session; |
|
848
by Brian Aker
typdef class removal (just... use the name of the class). |
32 |
Select_Lex_Unit *unit; |
837
by Brian Aker
Reworked some classes out of session.h |
33 |
public: |
34 |
select_result() |
|
35 |
{
|
|
36 |
session= current_session; |
|
37 |
}
|
|
38 |
virtual ~select_result() {}; |
|
39 |
virtual int prepare(List<Item> &, |
|
848
by Brian Aker
typdef class removal (just... use the name of the class). |
40 |
Select_Lex_Unit *u) |
837
by Brian Aker
Reworked some classes out of session.h |
41 |
{
|
42 |
unit= u; |
|
43 |
return 0; |
|
44 |
}
|
|
45 |
/*
|
|
46 |
Because of peculiarities of prepared statements protocol
|
|
47 |
we need to know number of columns in the result set (if
|
|
48 |
there is a result set) apart from sending columns metadata.
|
|
49 |
*/
|
|
50 |
virtual uint32_t field_count(List<Item> &fields) const |
|
51 |
{ return fields.elements; } |
|
971.3.63
by Eric Day
Removed protocol field flags. |
52 |
virtual bool send_fields(List<Item> &list)=0; |
837
by Brian Aker
Reworked some classes out of session.h |
53 |
virtual bool send_data(List<Item> &items)=0; |
1541.1.1
by Brian Aker
JOIN -> Join rename |
54 |
virtual bool initialize_tables (Join *) |
837
by Brian Aker
Reworked some classes out of session.h |
55 |
{ return 0; } |
56 |
virtual bool send_eof()=0; |
|
57 |
virtual void abort() {} |
|
58 |
void set_session(Session *session_arg) { session= session_arg; } |
|
59 |
void begin_dataset() {} |
|
60 |
||
61 |
/*****************************************************************************
|
|
62 |
** Functions to provide a interface to select results
|
|
63 |
*****************************************************************************/
|
|
64 |
||
1241.9.57
by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined. |
65 |
virtual void send_error(uint32_t errcode, const char *err); |
837
by Brian Aker
Reworked some classes out of session.h |
66 |
|
67 |
/*
|
|
68 |
Cleanup instance of this class for next execution of a prepared
|
|
69 |
statement/stored procedure.
|
|
70 |
*/
|
|
71 |
virtual void cleanup() |
|
72 |
{
|
|
73 |
/* do nothing */
|
|
74 |
}
|
|
75 |
||
76 |
};
|
|
77 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
78 |
} /* namespace drizzled */ |
79 |
||
837
by Brian Aker
Reworked some classes out of session.h |
80 |
#endif /* DRIZZLED_SELECT_RESULT_H */ |