~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/get_user_var.cc

merged with up to date trunk

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
47
47
}
48
48
 
49
49
 
50
 
my_decimal *Item_func_get_user_var::val_decimal(my_decimal *dec)
 
50
type::Decimal *Item_func_get_user_var::val_decimal(type::Decimal *dec)
51
51
{
52
52
  assert(fixed == 1);
53
53
  if (!var_entry)
88
88
    case REAL_RESULT:
89
89
      max_length= DBL_DIG + 8;
90
90
      break;
 
91
 
91
92
    case INT_RESULT:
92
93
      max_length= MAX_BIGINT_WIDTH;
93
94
      decimals=0;
95
96
    case STRING_RESULT:
96
97
      max_length= MAX_BLOB_WIDTH;
97
98
      break;
 
99
 
98
100
    case DECIMAL_RESULT:
99
101
      max_length= DECIMAL_MAX_STR_LENGTH;
100
102
      decimals= DECIMAL_MAX_SCALE;
101
103
      break;
 
104
 
102
105
    case ROW_RESULT:                            // Keep compiler happy
103
 
    default:
104
106
      assert(0);
105
107
      break;
106
108
    }