drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
cache_int.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
#include <drizzled/item/cache_int.h>
22
23
namespace
drizzled
{
24
25
void
Item_cache_int::store(
Item
*item)
26
{
27
value= item->val_int_result();
28
null_value
= item->null_value;
29
unsigned_flag= item->unsigned_flag;
30
}
31
32
void
Item_cache_int::store(
Item
*item, int64_t val_arg)
33
{
34
value= val_arg;
35
null_value
= item->null_value;
36
unsigned_flag= item->unsigned_flag;
37
}
38
39
String
*
Item_cache_int::val_str
(
String
*str)
40
{
41
assert(
fixed
== 1);
42
str->set(value, default_charset());
43
return
str;
44
}
45
46
type::Decimal
*
Item_cache_int::val_decimal
(
type::Decimal
*decimal_val)
47
{
48
assert(
fixed
== 1);
49
int2_class_decimal(E_DEC_FATAL_ERROR, value, unsigned_flag, decimal_val);
50
return
decimal_val;
51
}
52
53
}
/* namespace drizzled */
drizzled::Item_cache_int::val_decimal
type::Decimal * val_decimal(type::Decimal *)
Definition
cache_int.cc:46
drizzled::Item_cache_int::val_str
String * val_str(String *str)
Definition
cache_int.cc:39
drizzled::Item
Definition
item.h:59
drizzled::Item::fixed
bool fixed
Definition
item.h:122
drizzled::Item::null_value
bool null_value
Definition
item.h:124
drizzled::String
Definition
sql_string.h:58
drizzled::type::Decimal
Definition
type/decimal.h:184
drizzled
TODO: Rename this file - func.h is stupid.
Definition
abort_exception.h:27
← Back to Drizzle docs
drizzled
item
cache_int.cc
Generated by
1.15.0