~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/set_user_var.cc

  • Committer: Brian Aker
  • Date: 2010-12-18 10:14:05 UTC
  • mfrom: (2008.1.3 clean)
  • Revision ID: brian@tangent.org-20101218101405-qjbse29shi9coklg
Merge of user identifier work

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
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <config.h>
 
20
#include "config.h"
21
21
 
22
22
#include <drizzled/function/set_user_var.h>
23
23
#include <drizzled/field/num.h>
24
24
#include <drizzled/session.h>
25
25
#include <drizzled/plugin/client.h>
26
 
#include <drizzled/user_var_entry.h>
27
26
 
28
27
namespace drizzled
29
28
{
232
231
                         DERIVATION_IMPLICIT, 0);
233
232
      else
234
233
        res= update_hash((void*) save_result.vdec,
235
 
                         sizeof(type::Decimal), DECIMAL_RESULT,
 
234
                         sizeof(my_decimal), DECIMAL_RESULT,
236
235
                         &my_charset_bin, DERIVATION_IMPLICIT, 0);
237
236
      break;
238
237
    }
271
270
}
272
271
 
273
272
 
274
 
type::Decimal *Item_func_set_user_var::val_decimal(type::Decimal *val)
 
273
my_decimal *Item_func_set_user_var::val_decimal(my_decimal *val)
275
274
{
276
275
  assert(fixed == 1);
277
276
  check(0);
304
303
}
305
304
 
306
305
 
307
 
type::Decimal *Item_func_set_user_var::val_decimal_result(type::Decimal *val)
 
306
my_decimal *Item_func_set_user_var::val_decimal_result(my_decimal *val)
308
307
{
309
308
  assert(fixed == 1);
310
309
  check(true);
342
341
      tmp_field->col_name=Item::name;               // Use user supplied name
343
342
  }
344
343
  else
345
 
  {
346
344
    Item::make_field(tmp_field);
347
 
  }
348
345
}
349
346
 
350
347
/*
427
424
  }
428
425
  else if (result_type() == DECIMAL_RESULT)
429
426
  {
430
 
    type::Decimal decimal_value;
431
 
    type::Decimal *val= entry->val_decimal(&null_value, &decimal_value);
 
427
    my_decimal decimal_value;
 
428
    my_decimal *val= entry->val_decimal(&null_value, &decimal_value);
432
429
    if (null_value)
433
430
      return set_field_to_null(field);
434
431
    field->set_notnull();