~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/get_user_var.cc

  • Committer: Brian Aker
  • Date: 2010-02-03 21:54:38 UTC
  • mto: This revision was merged to the branch mainline in revision 1281.
  • Revision ID: brian@gaz-20100203215438-9ixkp214vio85mub
Fixing test cases/removed dead optimizer switches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <drizzled/sql_parse.h>
27
27
#include <drizzled/session.h>
28
28
 
29
 
namespace drizzled
30
 
{
31
 
 
32
 
String *Item_func_get_user_var::val_str(String *str)
 
29
String *
 
30
Item_func_get_user_var::val_str(String *str)
33
31
{
34
32
  assert(fixed == 1);
35
33
  if (!var_entry)
65
63
 
66
64
void Item_func_get_user_var::fix_length_and_dec()
67
65
{
 
66
  Session *session=current_session;
68
67
  maybe_null=1;
69
68
  decimals=NOT_FIXED_DEC;
70
69
  max_length=MAX_BLOB_WIDTH;
71
70
 
72
 
  var_entry= session.getVariable(name, false);
 
71
  var_entry= session->getVariable(name, false);
73
72
 
74
73
  /*
75
74
    If the variable didn't exist it has been created as a STRING-type.
88
87
    case REAL_RESULT:
89
88
      max_length= DBL_DIG + 8;
90
89
      break;
91
 
 
92
90
    case INT_RESULT:
93
91
      max_length= MAX_BIGINT_WIDTH;
94
92
      decimals=0;
96
94
    case STRING_RESULT:
97
95
      max_length= MAX_BLOB_WIDTH;
98
96
      break;
99
 
 
100
97
    case DECIMAL_RESULT:
101
98
      max_length= DECIMAL_MAX_STR_LENGTH;
102
99
      decimals= DECIMAL_MAX_SCALE;
103
100
      break;
104
 
 
105
101
    case ROW_RESULT:                            // Keep compiler happy
 
102
    default:
106
103
      assert(0);
107
104
      break;
108
105
    }
119
116
 
120
117
bool Item_func_get_user_var::const_item() const
121
118
{
122
 
  return (!var_entry || session.getQueryId() != var_entry->update_query_id);
 
119
  return (!var_entry || current_session->getQueryId() != var_entry->update_query_id);
123
120
}
124
121
 
125
122
 
152
149
  return (name.length == other->name.length &&
153
150
          !memcmp(name.str, other->name.str, name.length));
154
151
}
155
 
 
156
 
} /* namespace drizzled */