~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/min_max.cc

  • Committer: Stewart Smith
  • Date: 2011-01-14 05:09:04 UTC
  • mto: (2086.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2087.
  • Revision ID: stewart@flamingspork.com-20110114050904-a98kswwpqnpl413s
add a bit of a note on how variables docs should be expanded

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
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
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
59
59
    }
60
60
  }
61
61
  else if ((cmp_type == DECIMAL_RESULT) || (cmp_type == INT_RESULT))
62
 
    max_length= my_decimal_precision_to_length(max_int_part+decimals, decimals,
 
62
    max_length= class_decimal_precision_to_length(max_int_part+decimals, decimals,
63
63
                                            unsigned_flag);
64
64
  cached_field_type= agg_field_type(args, arg_count);
65
65
}
151
151
 
152
152
  case DECIMAL_RESULT:
153
153
    {
154
 
      my_decimal dec_buf, *dec_val= val_decimal(&dec_buf);
 
154
      type::Decimal dec_buf, *dec_val= val_decimal(&dec_buf);
155
155
      if (null_value)
156
156
        return 0;
157
 
      my_decimal2string(E_DEC_FATAL_ERROR, dec_val, 0, 0, 0, str);
 
157
      class_decimal2string(E_DEC_FATAL_ERROR, dec_val, 0, 0, 0, str);
158
158
      return str;
159
159
    }
160
160
 
257
257
}
258
258
 
259
259
 
260
 
my_decimal *Item_func_min_max::val_decimal(my_decimal *dec)
 
260
type::Decimal *Item_func_min_max::val_decimal(type::Decimal *dec)
261
261
{
262
262
  assert(fixed == 1);
263
 
  my_decimal tmp_buf, *tmp, *res= NULL;
 
263
  type::Decimal tmp_buf, *tmp, *res= NULL;
264
264
 
265
265
  if (compare_as_dates)
266
266
  {
276
276
    else
277
277
    {
278
278
      tmp= args[i]->val_decimal(&tmp_buf);      // Zero if NULL
279
 
      if (tmp && (my_decimal_cmp(tmp, res) * cmp_sign) < 0)
 
279
      if (tmp && (class_decimal_cmp(tmp, res) * cmp_sign) < 0)
280
280
      {
281
281
        if (tmp == &tmp_buf)
282
282
        {
283
283
          /* Move value out of tmp_buf as this will be reused on next loop */
284
 
          my_decimal2decimal(tmp, dec);
 
284
          class_decimal2decimal(tmp, dec);
285
285
          res= dec;
286
286
        }
287
287
        else