~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sys_var.h

  • Committer: Lee Bieber
  • Date: 2010-11-23 05:05:31 UTC
  • mfrom: (1945.1.8 bug675670)
  • Revision ID: kalebral@gmail.com-20101123050531-sf6ma8he7s47yryd
Merge Monty - fix bug 675670: Drizzle falsely reporting conflicts with tmp/mysql.socket but starts normally

Show diffs side-by-side

added added

removed removed

Lines of Context:
519
519
  }
520
520
};
521
521
 
 
522
class sys_var_std_string :
 
523
  public sys_var
 
524
{
 
525
  std::string &value;
 
526
  sys_check_func check_func;
 
527
  sys_update_func update_func;
 
528
  sys_set_default_func set_default_func;
 
529
public:
 
530
  sys_var_std_string(const std::string &name_arg,
 
531
                     std::string &value_arg,
 
532
                     sys_check_func check_func_arg= NULL,
 
533
                     sys_update_func update_func_arg= NULL) :
 
534
    sys_var(name_arg),
 
535
    value(value_arg),
 
536
    check_func(check_func_arg),
 
537
    update_func(update_func_arg)
 
538
  {  }
 
539
 
 
540
  inline void set(char *val_in)
 
541
  {
 
542
    value= val_in; 
 
543
  }
 
544
 
 
545
  void set_check_func(sys_check_func check_func_arg= NULL)
 
546
  {
 
547
    check_func= check_func_arg;
 
548
  }
 
549
 
 
550
  void set_update_func(sys_update_func update_func_arg= NULL)
 
551
  {
 
552
    update_func= update_func_arg;
 
553
  }
 
554
 
 
555
  bool check(Session *session, set_var *var);
 
556
    
 
557
  bool update(Session *session, set_var *var)
 
558
  {
 
559
    if (update_func != NULL)
 
560
    {
 
561
      return (*update_func)(session, var);
 
562
    }
 
563
    return false;
 
564
  }
 
565
  SHOW_TYPE show_type() { return SHOW_CHAR; }
 
566
  unsigned char *value_ptr(Session *, sql_var_t, const LEX_STRING *)
 
567
  {
 
568
    return (unsigned char*)(value.c_str());
 
569
  }
 
570
  bool check_update_type(Item_result type)
 
571
  {
 
572
    return type != STRING_RESULT;               /* Only accept strings */
 
573
  }
 
574
  bool check_default(sql_var_t)
 
575
  { return true; }
 
576
  bool is_readonly() const { return false; }
 
577
};
 
578
 
522
579
class sys_var_const_string :
523
580
  public sys_var
524
581
{