466
by Monty Taylor
Fixed modelines... these files are c++. |
1 |
/* - mode: c++ c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
173.1.4
by Toru Maesaka
ripped out NULL and YEAR and moved to field/ |
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
3 |
*
|
|
4 |
* Copyright (C) 2008 MySQL
|
|
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; either version 2 of the License, or
|
|
9 |
* (at your option) any later version.
|
|
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
|
173.1.4
by Toru Maesaka
ripped out NULL and YEAR and moved to field/ |
22 |
|
584.5.1
by Monty Taylor
Removed field includes from field.h. |
23 |
#include <drizzled/field/str.h> |
24 |
||
2318.6.12
by Olaf van der Spek
Refactor |
25 |
namespace drizzled { |
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
26 |
|
584.5.1
by Monty Taylor
Removed field includes from field.h. |
27 |
/*
|
28 |
* Everything saved in this will disappear. It will always return NULL
|
|
173.1.4
by Toru Maesaka
ripped out NULL and YEAR and moved to field/ |
29 |
*/
|
30 |
||
2318.6.12
by Olaf van der Spek
Refactor |
31 |
class Field_null : public Field_str |
1119.9.14
by Jay Pipes
Style cleanups after review. Thanks Monty :) |
32 |
{
|
2318.6.13
by Olaf van der Spek
Refactor |
33 |
static unsigned char null; |
173.1.4
by Toru Maesaka
ripped out NULL and YEAR and moved to field/ |
34 |
public: |
779.3.18
by Monty Taylor
Cleaned up warnings up through innodb. |
35 |
|
36 |
using Field::store; |
|
37 |
using Field::val_str; |
|
38 |
using Field::cmp; |
|
892.1.2
by Monty Taylor
Fixed solaris warnings. |
39 |
using Field::val_int; |
779.3.18
by Monty Taylor
Cleaned up warnings up through innodb. |
40 |
|
2318.6.12
by Olaf van der Spek
Refactor |
41 |
Field_null(unsigned char *ptr_arg, uint32_t len_arg, const char *field_name_arg) : |
2318.6.13
by Olaf van der Spek
Refactor |
42 |
Field_str(ptr_arg, len_arg, &null, 1, field_name_arg, &my_charset_bin) |
1119.9.12
by Jay Pipes
First phase removal of MTYP_TYPENR() macro. This removes the unireg_check argument for all Field types where it is irrelevant (everything but numeric types and timestamp. |
43 |
{}
|
2167.3.1
by Brian Aker
Fix issues where int display length may be too small, and fix collation |
44 |
|
1119.9.14
by Jay Pipes
Style cleanups after review. Thanks Monty :) |
45 |
enum_field_types type() const |
46 |
{
|
|
47 |
return DRIZZLE_TYPE_NULL; |
|
48 |
}
|
|
2318.6.12
by Olaf van der Spek
Refactor |
49 |
int store(const char *, uint32_t, const charset_info_st * const) |
1119.9.14
by Jay Pipes
Style cleanups after review. Thanks Monty :) |
50 |
{
|
51 |
return 0; |
|
52 |
}
|
|
646
by Brian Aker
Next pass through attribute. |
53 |
int store(double) |
1119.9.14
by Jay Pipes
Style cleanups after review. Thanks Monty :) |
54 |
{
|
55 |
return 0; |
|
56 |
}
|
|
646
by Brian Aker
Next pass through attribute. |
57 |
int store(int64_t, bool) |
1119.9.14
by Jay Pipes
Style cleanups after review. Thanks Monty :) |
58 |
{
|
59 |
return 0; |
|
60 |
}
|
|
2030.1.4
by Brian Aker
Change my_decimal to Decimal |
61 |
int store_decimal(const type::Decimal *) |
1119.9.14
by Jay Pipes
Style cleanups after review. Thanks Monty :) |
62 |
{
|
63 |
return 0; |
|
64 |
}
|
|
2318.6.12
by Olaf van der Spek
Refactor |
65 |
int reset() |
1119.9.14
by Jay Pipes
Style cleanups after review. Thanks Monty :) |
66 |
{
|
67 |
return 0; |
|
68 |
}
|
|
2318.6.12
by Olaf van der Spek
Refactor |
69 |
double val_real() const |
1119.9.14
by Jay Pipes
Style cleanups after review. Thanks Monty :) |
70 |
{
|
71 |
return 0.0; |
|
72 |
}
|
|
2318.6.12
by Olaf van der Spek
Refactor |
73 |
int64_t val_int() const |
2181.2.1
by Brian Aker
Protect all of the val_* methods from modification. |
74 |
{
|
75 |
return 0; |
|
76 |
}
|
|
77 |
type::Decimal *val_decimal(type::Decimal *) const |
|
78 |
{
|
|
79 |
return 0; |
|
80 |
}
|
|
81 |
String *val_str(String *, String *value2) const |
|
1119.9.14
by Jay Pipes
Style cleanups after review. Thanks Monty :) |
82 |
{
|
83 |
value2->length(0); |
|
84 |
return value2; |
|
85 |
}
|
|
86 |
int cmp(const unsigned char *, const unsigned char *) |
|
87 |
{
|
|
88 |
return 0; |
|
89 |
}
|
|
90 |
void sort_string(unsigned char *, uint32_t) |
|
91 |
{}
|
|
92 |
uint32_t pack_length() const |
|
93 |
{
|
|
94 |
return 0; |
|
95 |
}
|
|
96 |
uint32_t size_of() const |
|
97 |
{
|
|
98 |
return sizeof(*this); |
|
99 |
}
|
|
100 |
uint32_t max_display_length() |
|
101 |
{
|
|
102 |
return 4; |
|
103 |
}
|
|
173.1.4
by Toru Maesaka
ripped out NULL and YEAR and moved to field/ |
104 |
};
|
105 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
106 |
} /* namespace drizzled */ |