1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 MySQL
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; either version 2 of the License, or
9
* (at your option) any later version.
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.
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
21
#ifndef DRIZZLE_SERVER_FIELD_NULL
22
#define DRIZZLE_SERVER_FIELD_NULL
24
#include "mysql_priv.h"
27
Everything saved in this will disappear. It will always return NULL
30
class Field_null :public Field_str {
33
Field_null(uchar *ptr_arg, uint32 len_arg,
34
enum utype unireg_check_arg, const char *field_name_arg,
36
:Field_str(ptr_arg, len_arg, null, 1,
37
unireg_check_arg, field_name_arg, cs)
39
enum_field_types type() const { return MYSQL_TYPE_NULL;}
40
int store(const char *to __attribute__((__unused__)),
41
uint length __attribute__((__unused__)),
42
CHARSET_INFO *cs __attribute__((__unused__)))
43
{ null[0]=1; return 0; }
44
int store(double nr __attribute__((__unused__)))
45
{ null[0]=1; return 0; }
46
int store(int64_t nr __attribute__((__unused__)),
47
bool unsigned_val __attribute__((__unused__)))
48
{ null[0]=1; return 0; }
49
int store_decimal(const my_decimal *d __attribute__((__unused__)))
50
{ null[0]=1; return 0; }
57
my_decimal *val_decimal(my_decimal *) { return 0; }
58
String *val_str(String *value __attribute__((__unused__)),
60
{ value2->length(0); return value2;}
61
int cmp(const uchar *a __attribute__((__unused__)),
62
const uchar *b __attribute__((__unused__))) { return 0;}
63
void sort_string(uchar *buff __attribute__((__unused__)),
64
uint length __attribute__((__unused__))) {}
65
uint32 pack_length() const { return 0; }
66
void sql_type(String &str) const;
67
uint size_of() const { return sizeof(*this); }
68
uint32 max_display_length() { return 4; }