642.1.10
by Lee
move functions from item.cc/item.h to item directory |
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
|
|
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 |
||
1241.9.36
by Monty Taylor
ZOMG. I deleted drizzled/server_includes.h. |
20 |
#include "config.h" |
642.1.24
by Lee
more header file cleanup |
21 |
#include <drizzled/item/ref.h> |
642.1.10
by Lee
move functions from item.cc/item.h to item directory |
22 |
#include <drizzled/item/ref_null_helper.h> |
23 |
#include <drizzled/item/subselect.h> |
|
24 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
25 |
namespace drizzled |
26 |
{
|
|
27 |
||
642.1.10
by Lee
move functions from item.cc/item.h to item directory |
28 |
double Item_ref_null_helper::val_real() |
29 |
{
|
|
30 |
assert(fixed == 1); |
|
31 |
double tmp= (*ref)->val_result(); |
|
32 |
owner->was_null|= null_value= (*ref)->null_value; |
|
33 |
return tmp; |
|
34 |
}
|
|
35 |
||
36 |
||
37 |
int64_t Item_ref_null_helper::val_int() |
|
38 |
{
|
|
39 |
assert(fixed == 1); |
|
40 |
int64_t tmp= (*ref)->val_int_result(); |
|
41 |
owner->was_null|= null_value= (*ref)->null_value; |
|
42 |
return tmp; |
|
43 |
}
|
|
44 |
||
45 |
||
46 |
my_decimal *Item_ref_null_helper::val_decimal(my_decimal *decimal_value) |
|
47 |
{
|
|
48 |
assert(fixed == 1); |
|
49 |
my_decimal *val= (*ref)->val_decimal_result(decimal_value); |
|
50 |
owner->was_null|= null_value= (*ref)->null_value; |
|
51 |
return val; |
|
52 |
}
|
|
53 |
||
54 |
bool Item_ref_null_helper::val_bool() |
|
55 |
{
|
|
56 |
assert(fixed == 1); |
|
57 |
bool val= (*ref)->val_bool_result(); |
|
58 |
owner->was_null|= null_value= (*ref)->null_value; |
|
59 |
return val; |
|
60 |
}
|
|
61 |
||
62 |
||
63 |
String* Item_ref_null_helper::val_str(String* s) |
|
64 |
{
|
|
65 |
assert(fixed == 1); |
|
66 |
String* tmp= (*ref)->str_result(s); |
|
67 |
owner->was_null|= null_value= (*ref)->null_value; |
|
68 |
return tmp; |
|
69 |
}
|
|
70 |
||
71 |
bool Item_ref_null_helper::get_date(DRIZZLE_TIME *ltime, uint32_t fuzzydate) |
|
72 |
{
|
|
73 |
return (owner->was_null|= null_value= (*ref)->get_date(ltime, fuzzydate)); |
|
74 |
}
|
|
75 |
||
76 |
void Item_ref_null_helper::print(String *str, enum_query_type query_type) |
|
77 |
{
|
|
78 |
str->append(STRING_WITH_LEN("<ref_null_helper>(")); |
|
79 |
if (ref) |
|
80 |
(*ref)->print(str, query_type); |
|
81 |
else
|
|
82 |
str->append('?'); |
|
83 |
str->append(')'); |
|
84 |
}
|
|
85 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
86 |
} /* namespace drizzled */ |