~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/get_user_var.cc

  • Committer: Monty Taylor
  • Date: 2010-03-06 02:08:13 UTC
  • mto: This revision was merged to the branch mainline in revision 1381.
  • Revision ID: mordred@inaugust.com-20100306020813-c37d0b39004nl1zf
Remove plugin deinit.

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 <float.h>
23
23
 
25
25
#include <drizzled/item/null.h>
26
26
#include <drizzled/sql_parse.h>
27
27
#include <drizzled/session.h>
28
 
#include <drizzled/user_var_entry.h>
29
28
 
30
29
namespace drizzled
31
30
{
48
47
}
49
48
 
50
49
 
51
 
type::Decimal *Item_func_get_user_var::val_decimal(type::Decimal *dec)
 
50
my_decimal *Item_func_get_user_var::val_decimal(my_decimal *dec)
52
51
{
53
52
  assert(fixed == 1);
54
53
  if (!var_entry)
66
65
 
67
66
void Item_func_get_user_var::fix_length_and_dec()
68
67
{
 
68
  Session *session=current_session;
69
69
  maybe_null=1;
70
70
  decimals=NOT_FIXED_DEC;
71
71
  max_length=MAX_BLOB_WIDTH;
72
72
 
73
 
  var_entry= session.getVariable(name, false);
 
73
  var_entry= session->getVariable(name, false);
74
74
 
75
75
  /*
76
76
    If the variable didn't exist it has been created as a STRING-type.
89
89
    case REAL_RESULT:
90
90
      max_length= DBL_DIG + 8;
91
91
      break;
92
 
 
93
92
    case INT_RESULT:
94
93
      max_length= MAX_BIGINT_WIDTH;
95
94
      decimals=0;
97
96
    case STRING_RESULT:
98
97
      max_length= MAX_BLOB_WIDTH;
99
98
      break;
100
 
 
101
99
    case DECIMAL_RESULT:
102
100
      max_length= DECIMAL_MAX_STR_LENGTH;
103
101
      decimals= DECIMAL_MAX_SCALE;
104
102
      break;
105
 
 
106
103
    case ROW_RESULT:                            // Keep compiler happy
 
104
    default:
107
105
      assert(0);
108
106
      break;
109
107
    }
120
118
 
121
119
bool Item_func_get_user_var::const_item() const
122
120
{
123
 
  return (!var_entry || session.getQueryId() != var_entry->update_query_id);
 
121
  return (!var_entry || current_session->getQueryId() != var_entry->update_query_id);
124
122
}
125
123
 
126
124