~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cached_item.cc

  • Committer: Brian Aker
  • Date: 2010-12-24 21:27:54 UTC
  • mto: (2035.1.1 clean)
  • mto: This revision was merged to the branch mainline in revision 2037.
  • Revision ID: brian@tangent.org-20101224212754-85xvjullymvhibr9
Merge in cast() for BOOLEAN.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
  Buffers to save and compare item values
25
25
*/
26
26
 
27
 
#include <config.h>
 
27
#include "config.h"
28
28
#include <drizzled/cached_item.h>
29
29
#include <drizzled/sql_string.h>
30
30
#include <drizzled/session.h>
164
164
Cached_item_decimal::Cached_item_decimal(Item *it)
165
165
  :item(it)
166
166
{
167
 
  value.set_zero();
 
167
  my_decimal_set_zero(&value);
168
168
}
169
169
 
170
170
 
171
171
bool Cached_item_decimal::cmp()
172
172
{
173
 
  type::Decimal tmp;
174
 
  type::Decimal *ptmp= item->val_decimal(&tmp);
 
173
  my_decimal tmp;
 
174
  my_decimal *ptmp= item->val_decimal(&tmp);
175
175
  if (null_value != item->null_value ||
176
 
      (!item->null_value && class_decimal_cmp(&value, ptmp)))
 
176
      (!item->null_value && my_decimal_cmp(&value, ptmp)))
177
177
  {
178
178
    null_value= item->null_value;
179
179
    /* Save only not null values */
180
180
    if (!null_value)
181
181
    {
182
 
      class_decimal2decimal(ptmp, &value);
 
182
      my_decimal2decimal(ptmp, &value);
183
183
      return true;
184
184
    }
185
185
    return false;