drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
item/null.cc
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, Inc.
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#include <config.h>
21
22#include <drizzled/field.h>
23#include <drizzled/item/null.h>
24#include <drizzled/lex_string.h>
25#include <drizzled/plugin/client.h>
26
27namespace drizzled {
28
29bool Item_null::eq(const Item *item, bool) const
30{ return item->type() == type(); }
31
33{
34 // following assert is redundant, because fixed=1 assigned in constructor
35 assert(fixed == 1);
36 null_value=1;
37 return 0.0;
38}
40{
41 // following assert is redundant, because fixed=1 assigned in constructor
42 assert(fixed == 1);
43 null_value=1;
44 return 0;
45}
46/* ARGSUSED */
48{
49 // following assert is redundant, because fixed=1 assigned in constructor
50 assert(fixed == 1);
51 null_value=1;
52 return 0;
53}
54
59
60
62{
63 str->append(STRING_WITH_LEN("NULL"));
64}
65
66
67Item *Item_null::safe_charset_converter(const charset_info_st * const tocs)
68{
69 collation.set(tocs);
70 return this;
71}
72
86
87int Item_null::save_in_field(Field *field, bool no_conversions)
88{
89 return set_field_to_null_with_conversions(field, no_conversions);
90}
91
102
104{
105 return set_field_to_null(field);
106}
107
111
113{
114 client->store();
115}
116
117} /* namespace drizzled */
String * val_str(String *str)
Definition item/null.cc:47
bool eq(const Item *item, bool binary_cmp) const
Definition item/null.cc:29
int save_in_field(Field *field, bool no_conversions)
Definition item/null.cc:87
virtual void print(String *str)
Definition item/null.cc:61
void send(plugin::Client *client, String *str)
Definition item/null.cc:112
int save_safe_in_field(Field *field)
Definition item/null.cc:103
type::Decimal * val_decimal(type::Decimal *)
Definition item/null.cc:55
bool fixed
Definition item.h:122
bool null_value
Definition item.h:124
Convert from decimal to binary representation.
Definition common_fwd.h:215
TODO: Rename this file - func.h is stupid.
int set_field_to_null_with_conversions(Field *field, bool no_conversions)