~drizzle-trunk/drizzle/development

2148.7.6 by Brian Aker
Move out subclasses from session.
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2011 Brian Aker
5
 *  Copyright (C) 2008 Sun Microsystems, Inc.
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; version 2 of the License.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
20
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
21
#pragma once
2148.7.6 by Brian Aker
Move out subclasses from session.
22
2187.2.1 by Brian Aker
Additional fixes in headers.
23
#include <drizzled/base.h>
24
#include <drizzled/sql_list.h>
25
2148.7.6 by Brian Aker
Move out subclasses from session.
26
namespace drizzled
27
{
28
2187.2.1 by Brian Aker
Additional fixes in headers.
29
class Item;
30
2148.7.6 by Brian Aker
Move out subclasses from session.
31
/**
32
  The COPY_INFO structure is used by INSERT/REPLACE code.
33
  The schema of the row counting by the INSERT/INSERT ... ON DUPLICATE KEY
34
  UPDATE code:
35
    If a row is inserted then the copied variable is incremented.
36
    If a row is updated by the INSERT ... ON DUPLICATE KEY UPDATE and the
37
      new data differs from the old one then the copied and the updated
38
      variables are incremented.
39
    The touched variable is incremented if a row was touched by the update part
40
      of the INSERT ... ON DUPLICATE KEY UPDATE no matter whether the row
41
      was actually changed or not.
42
*/
43
class CopyInfo 
44
{
45
public:
46
  ha_rows records; /**< Number of processed records */
47
  ha_rows deleted; /**< Number of deleted records */
48
  ha_rows updated; /**< Number of updated records */
49
  ha_rows copied;  /**< Number of copied records */
50
  ha_rows error_count;
51
  ha_rows touched; /* Number of touched records */
52
  enum enum_duplicates handle_duplicates;
53
  int escape_char, last_errno;
54
  bool ignore;
55
  /* for INSERT ... UPDATE */
56
  List<Item> *update_fields;
57
  List<Item> *update_values;
58
  /* for VIEW ... WITH CHECK OPTION */
59
60
  CopyInfo() :
61
    records(0),
62
    deleted(0),
63
    updated(0),
64
    copied(0),
65
    error_count(0),
66
    touched(0),
67
    escape_char(0),
68
    last_errno(0),
69
    ignore(0),
70
    update_fields(0),
71
    update_values(0)
72
  { }
73
};
74
75
76
} /* namespace drizzled */
77