1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
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.
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.
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
21
#ifndef DRIZZLED_SELECT_RESULT_H
22
#define DRIZZLED_SELECT_RESULT_H
26
class select_result :public drizzled::memory::SqlAlloc {
29
Select_Lex_Unit *unit;
33
session= current_session;
35
virtual ~select_result() {};
36
virtual int prepare(List<Item> &,
43
Because of peculiarities of prepared statements protocol
44
we need to know number of columns in the result set (if
45
there is a result set) apart from sending columns metadata.
47
virtual uint32_t field_count(List<Item> &fields) const
48
{ return fields.elements; }
49
virtual bool send_fields(List<Item> &list)=0;
50
virtual bool send_data(List<Item> &items)=0;
51
virtual bool initialize_tables (JOIN *)
53
virtual bool send_eof()=0;
54
virtual void abort() {}
55
void set_session(Session *session_arg) { session= session_arg; }
56
void begin_dataset() {}
58
/*****************************************************************************
59
** Functions to provide a interface to select results
60
*****************************************************************************/
62
virtual void send_error(uint32_t errcode, const char *err);
65
Cleanup instance of this class for next execution of a prepared
66
statement/stored procedure.
68
virtual void cleanup()
75
#endif /* DRIZZLED_SELECT_RESULT_H */