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
20
#ifndef DRIZZLED_ITEM_INSERT_VALUE_H
21
#define DRIZZLED_ITEM_INSERT_VALUE_H
23
#include "drizzled/item/field.h"
29
Item_insert_value -- an implementation of VALUES() function.
30
You can use the VALUES(col_name) function in the UPDATE clause
31
to refer to column values from the INSERT portion of the INSERT
32
... UPDATE statement. In other words, VALUES(col_name) in the
33
UPDATE clause refers to the value of col_name that would be
34
inserted, had no duplicate-key conflict occurred.
35
In all other places this function returns NULL.
38
class Item_insert_value : public Item_field
42
Item_insert_value(Name_resolution_context *context_arg, Item *a)
43
:Item_field(context_arg, (const char *)NULL, (const char *)NULL,
46
bool eq(const Item *item, bool binary_cmp) const;
47
bool fix_fields(Session *, Item **);
48
virtual void print(String *str, enum_query_type query_type);
49
int save_in_field(Field *field_arg, bool no_conversions)
51
return Item_field::save_in_field(field_arg, no_conversions);
54
We use RAND_TABLE_BIT to prevent Item_insert_value from
55
being treated as a constant and precalculated before execution
57
table_map used_tables() const { return RAND_TABLE_BIT; }
59
bool walk(Item_processor processor, bool walk_subquery, unsigned char *args)
61
return arg->walk(processor, walk_subquery, args) ||
62
(this->*processor)(args);
66
} /* namespace drizzled */
68
#endif /* DRIZZLED_ITEM_INSERT_VALUE_H */