~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.cc

  • Committer: Monty Taylor
  • Date: 2011-01-11 06:07:55 UTC
  • mto: This revision was merged to the branch mainline in revision 2074.
  • Revision ID: mordred@inaugust.com-20110111060755-jf6l99lf1i51w8dm
Removed some guts from set_var.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
*****************************************************************************/
86
86
set_var::set_var(sql_var_t type_arg, sys_var *var_arg,
87
87
                 const LEX_STRING *base_name_arg, Item *value_arg) :
88
 
  var(var_arg), type(type_arg), base(*base_name_arg)
 
88
  uint64_t_value(0),
 
89
  str_value(""),
 
90
  var(var_arg),
 
91
  type(type_arg),
 
92
  base(*base_name_arg)
89
93
{
90
94
  /*
91
95
    If the set value is a field, change it to a string to allow things like
100
104
      value=value_arg;                  /* Give error message later */
101
105
  }
102
106
  else
103
 
    value=value_arg;
 
107
  {
 
108
    value= value_arg;
 
109
  }
104
110
}
105
111
 
106
112
int set_var::check(Session *session)
164
170
  catch (invalid_option_value &ex)
165
171
  {
166
172
    /* TODO: Fix this to be typesafe once we have properly typed set_var */
167
 
    string new_val= boost::lexical_cast<string>(save_result.uint32_t_value);
 
173
    string new_val= boost::lexical_cast<string>(uint64_t_value);
168
174
    if (boost::get_error_info<invalid_max_info>(ex) != NULL)
169
175
    { 
170
176
      const uint64_t max_val= *(boost::get_error_info<invalid_max_info>(ex));
250
256
 
251
257
void set_var::setValue(uint64_t new_value)
252
258
{
253
 
  save_result.uint64_t_value= new_value;
 
259
  uint64_t_value= new_value;
254
260
}
255
261
 
256
262
void set_var::updateValue()
257
263
{
258
 
  save_result.uint64_t_value= value->val_int();
 
264
  if (var->show_type() != SHOW_CHAR)
 
265
  {
 
266
    uint64_t_value= value->val_int();
 
267
  }
259
268
}
260
269
 
261
270