~drizzle-trunk/drizzle/development

851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
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_MULTI_DELETE_H
22
#define DRIZZLED_MULTI_DELETE_H
23
24
25
26
class multi_delete :public select_result_interceptor
27
{
28
  TableList *delete_tables, *table_being_deleted;
29
  Unique **tempfiles;
30
  ha_rows deleted, found;
31
  uint32_t num_of_tables;
32
  int error;
33
  bool do_delete;
34
  /* True if at least one table we delete from is transactional */
35
  bool transactional_tables;
36
  /* True if at least one table we delete from is not transactional */
37
  bool normal_tables;
38
  bool delete_while_scanning;
39
  /*
40
     error handling (rollback and binlogging) can happen in send_eof()
41
     so that afterward send_error() needs to find out that.
42
  */
43
  bool error_handled;
44
45
public:
46
  multi_delete(TableList *dt, uint32_t num_of_tables);
47
  ~multi_delete();
48
  int prepare(List<Item> &list, Select_Lex_Unit *u);
49
  bool send_data(List<Item> &items);
50
  bool initialize_tables (JOIN *join);
51
  void send_error(uint32_t errcode,const char *err);
52
  int  do_deletes();
53
  bool send_eof();
54
  virtual void abort();
55
};
56
57
#endif /* DRIZZLED_MULTI_DELETE_H */