~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/ref_null_helper.cc

  • Committer: Monty Taylor
  • Date: 2008-08-01 22:33:44 UTC
  • mto: (236.1.42 codestyle)
  • mto: This revision was merged to the branch mainline in revision 261.
  • Revision ID: monty@inaugust.com-20080801223344-vzhlflfmtijp1imv
First pass at gettexizing the error messages.

Show diffs side-by-side

added added

removed removed

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