~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to sql/set_var.h

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
  sys_var(const char *name_arg, sys_after_update_func func= NULL,
75
75
          Binlog_status_enum binlog_status_arg= NOT_IN_BINLOG)
76
76
    :name(name_arg), after_update(func), no_support_one_shot(1),
77
 
    binlog_status(binlog_status_arg)
 
77
    binlog_status(binlog_status_arg),
 
78
    m_allow_empty_value(TRUE)
78
79
  {}
79
80
  virtual ~sys_var() {}
80
81
  void chain_sys_var(sys_var_chain *chain_arg)
109
110
  virtual bool is_readonly() const { return 0; }
110
111
  virtual sys_var_pluginvar *cast_pluginvar() { return 0; }
111
112
 
 
113
protected:
 
114
  void set_allow_empty_value(bool allow_empty_value)
 
115
  {
 
116
    m_allow_empty_value= allow_empty_value;
 
117
  }
 
118
 
112
119
private:
113
120
  const Binlog_status_enum binlog_status;
 
121
 
 
122
  bool m_allow_empty_value;
114
123
};
115
124
 
116
125
 
572
581
  uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
573
582
};
574
583
 
 
584
/**
 
585
  @@session.dbug and @@global.dbug variables.
 
586
 
 
587
  @@dbug variable differs from other variables in one aspect:
 
588
  if its value is not assigned in the session, it "points" to the global
 
589
  value, and so when the global value is changed, the change
 
590
  immediately takes effect in the session.
 
591
 
 
592
  This semantics is intentional, to be able to debug one session from
 
593
  another.
 
594
*/
575
595
class sys_var_thd_dbug :public sys_var_thd
576
596
{
577
597
public:
586
606
  uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *b);
587
607
};
588
608
 
 
609
#if defined(ENABLED_DEBUG_SYNC)
 
610
/* Debug Sync Facility. Implemented in debug_sync.cc. */
 
611
class sys_var_debug_sync :public sys_var_thd
 
612
{
 
613
public:
 
614
  sys_var_debug_sync(sys_var_chain *chain, const char *name_arg)
 
615
    :sys_var_thd(name_arg)
 
616
  { chain_sys_var(chain); }
 
617
  bool check(THD *thd, set_var *var);
 
618
  bool update(THD *thd, set_var *var);
 
619
  SHOW_TYPE show_type() { return SHOW_CHAR; }
 
620
  bool check_update_type(Item_result type) { return type != STRING_RESULT; }
 
621
  uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
 
622
};
 
623
#endif /* defined(ENABLED_DEBUG_SYNC) */
589
624
 
590
625
 
591
626
/* some variables that require special handling */
885
920
  sys_var_log_output(sys_var_chain *chain, const char *name_arg, ulong *value_arg,
886
921
                     TYPELIB *typelib, sys_after_update_func func)
887
922
    :sys_var(name_arg,func), value(value_arg), enum_names(typelib)
888
 
  { chain_sys_var(chain); }
889
 
  bool check(THD *thd, set_var *var)
 
923
  {
 
924
    chain_sys_var(chain);
 
925
    set_allow_empty_value(FALSE);
 
926
  }
 
927
  virtual bool check(THD *thd, set_var *var)
890
928
  {
891
929
    return check_set(thd, var, enum_names);
892
930
  }
1091
1129
  virtual void set_default(THD *thd, enum_var_type type);
1092
1130
};
1093
1131
 
1094
 
 
 
1132
#ifdef HAVE_EVENT_SCHEDULER
1095
1133
class sys_var_event_scheduler :public sys_var_long_ptr
1096
1134
{
1097
1135
  /* We need a derived class only to have a warn_deprecated() */
1107
1145
    return type != STRING_RESULT && type != INT_RESULT;
1108
1146
  }
1109
1147
};
 
1148
#endif
1110
1149
 
1111
1150
extern void fix_binlog_format_after_update(THD *thd, enum_var_type type);
1112
1151