~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sys_var.cc

  • Committer: Monty Taylor
  • Date: 2010-11-25 01:53:19 UTC
  • mto: (1953.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1955.
  • Revision ID: mordred@inaugust.com-20101125015319-ia85msn25uemopgc
Re-enabled -Wformat and then cleaned up the carnage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
extern const CHARSET_INFO *character_set_filesystem;
89
89
extern size_t my_thread_stack_size;
90
90
 
 
91
class sys_var_pluginvar;
91
92
typedef map<string, sys_var *> SystemVariableMap;
92
93
static SystemVariableMap system_variable_map;
93
94
extern char *opt_drizzle_tmpdir;
320
321
/* Global read-only variable containing hostname */
321
322
static sys_var_const_str        sys_hostname("hostname", glob_hostname);
322
323
 
323
 
bool sys_var::check(Session *session, set_var *var)
 
324
bool sys_var::check(Session *, set_var *var)
324
325
{
325
 
  if (check_func)
326
 
  {
327
 
    int res;
328
 
    if ((res=(*check_func)(session, var)) < 0)
329
 
      my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), getName().c_str(), var->value->str_value.ptr());
330
 
    return res;
331
 
  }
332
326
  var->save_result.uint64_t_value= var->value->val_int();
333
327
  return 0;
334
328
}
335
329
 
336
330
bool sys_var_str::check(Session *session, set_var *var)
337
331
{
 
332
  int res;
338
333
  if (!check_func)
339
334
    return 0;
340
335
 
341
 
  int res;
342
336
  if ((res=(*check_func)(session, var)) < 0)
343
337
    my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), getName().c_str(), var->value->str_value.ptr());
344
338
  return res;
613
607
 
614
608
void sys_var_bool_ptr::set_default(Session *, sql_var_t)
615
609
{
616
 
  *value= default_value;
 
610
  *value= (bool) option_limits->def_value;
617
611
}
618
612
 
619
613
 
1663
1657
    add_sys_var_to_list(&sys_version_compile_vendor, my_long_options);
1664
1658
    add_sys_var_to_list(&sys_warning_count, my_long_options);
1665
1659
  }
1666
 
  catch (std::exception&)
 
1660
  catch (...)
1667
1661
  {
1668
1662
    errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize system variables"));
1669
1663
    return(1);