~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/cache_row.cc

  • Committer: Olaf van der Spek
  • Date: 2011-07-05 09:52:28 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110705095228-y4aejvsuyeezloqe
Refactor Items

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include <drizzled/item/cache_row.h>
27
27
 
28
 
namespace drizzled
29
 
{
 
28
namespace drizzled {
30
29
 
31
30
void Item_cache_row::make_field(SendField *)
32
31
{
33
 
  illegal_method_call((const char*)"make_field");
 
32
  illegal_method_call("make_field");
34
33
}
35
34
 
36
 
 
37
35
double Item_cache_row::val_real()
38
36
{
39
 
  illegal_method_call((const char*)"val");
 
37
  illegal_method_call("val");
40
38
  return 0;
41
39
}
42
40
 
43
 
 
44
41
int64_t Item_cache_row::val_int()
45
42
{
46
 
  illegal_method_call((const char*)"val_int");
 
43
  illegal_method_call("val_int");
47
44
  return 0;
48
45
}
49
46
 
50
 
 
51
47
String *Item_cache_row::val_str(String *)
52
48
{
53
 
  illegal_method_call((const char*)"val_str");
 
49
  illegal_method_call("val_str");
54
50
  return 0;
55
51
}
56
52
 
57
 
 
58
53
type::Decimal *Item_cache_row::val_decimal(type::Decimal *)
59
54
{
60
 
  illegal_method_call((const char*)"val_decimal");
 
55
  illegal_method_call("val_decimal");
61
56
  return 0;
62
57
}
63
58
 
64
 
 
65
59
enum Item_result Item_cache_row::result_type() const
66
60
{
67
61
  return ROW_RESULT;
68
62
}
69
63
 
70
 
 
71
64
uint32_t Item_cache_row::cols()
72
65
{
73
66
  return item_count;
74
67
}
75
68
 
76
 
 
77
69
Item *Item_cache_row::element_index(uint32_t i)
78
70
{
79
71
  return values[i];
80
72
}
81
73
 
82
 
 
83
74
Item **Item_cache_row::addr(uint32_t i)
84
75
{
85
76
  return (Item **) (values + i);
86
77
}
87
78
 
88
 
 
89
79
void Item_cache_row::allocate(uint32_t num)
90
80
{
91
81
  item_count= num;
92
82
  values= (Item_cache **) getSession().mem.calloc(sizeof(Item_cache *)*item_count);
93
83
}
94
84
 
95
 
 
96
85
bool Item_cache_row::setup(Item * item)
97
86
{
98
87
  example= item;
109
98
  return 0;
110
99
}
111
100
 
112
 
 
113
101
void Item_cache_row::store(Item * item)
114
102
{
115
103
  null_value= 0;
121
109
  }
122
110
}
123
111
 
124
 
 
125
 
void Item_cache_row::illegal_method_call(const char *)
 
112
void Item_cache_row::illegal_method_call(const char*)
126
113
{
127
 
  assert(0);
 
114
  assert(false);
128
115
  my_error(ER_OPERAND_COLUMNS, MYF(0), 1);
129
 
  return;
130
116
}
131
117
 
132
 
 
133
118
bool Item_cache_row::check_cols(uint32_t c)
134
119
{
135
120
  if (c != item_count)
140
125
  return 0;
141
126
}
142
127
 
143
 
 
144
128
bool Item_cache_row::null_inside()
145
129
{
146
130
  for (uint32_t i= 0; i < item_count; i++)
160
144
  return 0;
161
145
}
162
146
 
163
 
 
164
147
void Item_cache_row::bring_value()
165
148
{
166
149
  for (uint32_t i= 0; i < item_count; i++)
168
151
  return;
169
152
}
170
153
 
171
 
 
172
154
void Item_cache_row::keep_array()
173
155
{
174
156
  save_array= 1;
175
157
}
176
158
 
177
 
 
178
159
void Item_cache_row::cleanup()
179
160
{
180
161
  Item_cache::cleanup();
185
166
  return;
186
167
}
187
168
 
188
 
 
189
169
} /* namespace drizzled */