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
#include <drizzled/server_includes.h>
22
#include <drizzled/plugin/client.h>
23
#include <drizzled/item/null.h>
24
#include <drizzled/lex_string.h>
26
using namespace drizzled;
28
bool Item_null::eq(const Item *item, bool) const
29
{ return item->type() == type(); }
31
double Item_null::val_real()
33
// following assert is redundant, because fixed=1 assigned in constructor
38
int64_t Item_null::val_int()
40
// following assert is redundant, because fixed=1 assigned in constructor
46
String *Item_null::val_str(String *)
48
// following assert is redundant, because fixed=1 assigned in constructor
54
my_decimal *Item_null::val_decimal(my_decimal *)
60
void Item_null::print(String *str, enum_query_type)
62
str->append(STRING_WITH_LEN("NULL"));
66
Item *Item_null::safe_charset_converter(const CHARSET_INFO * const tocs)
75
This is used on INSERT.
76
Allow NULL to be inserted in timestamp and auto_increment values.
78
@param field Field where we want to store NULL
83
1 Field doesn't support NULL values and can't handle 'field = NULL'
86
int Item_null::save_in_field(Field *field, bool no_conversions)
88
return set_field_to_null_with_conversions(field, no_conversions);
94
@param field Field where we want to store NULL
99
1 Field doesn't support NULL values
102
int Item_null::save_safe_in_field(Field *field)
104
return set_field_to_null(field);
108
Pack data in buffer for sending.
111
bool Item_null::send(plugin::Client *client, String *)
113
return client->store();