~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/ref.h

Cleaned up a few global tests which aren't happy now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
20
20
#ifndef DRIZZLED_ITEM_REF_H
21
21
#define DRIZZLED_ITEM_REF_H
22
22
 
23
 
#include "drizzled/item/ident.h"
24
 
 
25
 
namespace drizzled
26
 
{
27
 
 
28
23
class Item_ref :public Item_ident
29
24
{
30
25
protected:
62
57
  enum Type type() const                { return REF_ITEM; }
63
58
  bool eq(const Item *item, bool binary_cmp) const
64
59
  {
65
 
    const Item *it= item->real_item();
 
60
    Item *it= ((Item *) item)->real_item();
66
61
    return ref && (*ref)->eq(it, binary_cmp);
67
62
  }
68
63
  double val_real();
69
64
  int64_t val_int();
70
 
  type::Decimal *val_decimal(type::Decimal *);
 
65
  my_decimal *val_decimal(my_decimal *);
71
66
  bool val_bool();
72
67
  String *val_str(String* tmp);
73
68
  bool is_null();
74
 
  bool get_date(type::Time &ltime,uint32_t fuzzydate);
 
69
  bool get_date(DRIZZLE_TIME *ltime,uint32_t fuzzydate);
75
70
  double val_result();
76
71
  int64_t val_int_result();
77
72
  String *str_result(String* tmp);
78
 
  type::Decimal *val_decimal_result(type::Decimal *);
 
73
  my_decimal *val_decimal_result(my_decimal *);
79
74
  bool val_bool_result();
80
 
  bool send(plugin::Client *client, String *tmp);
 
75
  bool send(drizzled::plugin::Client *client, String *tmp);
81
76
  void make_field(SendField *field);
82
77
  bool fix_fields(Session *, Item **);
83
78
  void fix_after_pullout(Select_Lex *new_parent, Item **ref);
120
115
    return (*ref)->result_as_int64_t();
121
116
  }
122
117
  void cleanup();
 
118
  Item_field *filed_for_view_update()
 
119
    { return (*ref)->filed_for_view_update(); }
123
120
  virtual Ref_Type ref_type() { return REF; }
124
121
 
125
122
  // Row emulation: forwarding of ROW-related calls to ref
149
146
    if (ref && result_type() == ROW_RESULT)
150
147
      (*ref)->bring_value();
151
148
  }
152
 
  bool basic_const_item() const
153
 
  {
154
 
    return (*ref)->basic_const_item();
155
 
  }
 
149
 
156
150
};
157
151
 
158
 
} /* namespace drizzled */
159
 
 
160
152
#endif /* DRIZZLED_ITEM_REF_H */