Skip to content
  • Sven Sandberg's avatar
    c7463f7e
    WL#7083 step 6.2. GTID-violations: Make ENFORCE_GTID_CONSISTENCY backward compatible with bool. · c7463f7e
    Sven Sandberg authored
    Before WL#7083, ENFORCE_GTID_CONSISTENCY was a boolean.  Now it is a
    three-valued variable.  Normally a three-valued variable would be of
    type Sys_var_enum.  However, Sys_var_enum is incompatible with boolean
    in the following ways:
    
    - When the variable is SELECT'ed, boolean shows a numeric value (0 or
      1) whereas enum shows the textual alias.
    
    - Booleans have two textual aliases for each value (0=off=false,
      1=on=true), whereas enum only allows one.
    
    - The command-line option for a boolean can be used without an
      argument: '--command-line-option' without '=VALUE', which has the
      meaning 'TRUE'.  If an enum allows the argument to be optional, it
      takes the default value, which in our case is different from TRUE.
    
    In order to avoid breaking compatibility with this behavior, we
    introduce a new Sys_var class for enumeration-like variables that can
    have multiple aliases, are displayed as integers, and allow
    '--command-line-option' without '=VALUE' to have a different value
    than the default value.
    
    @sys_vars.h
    - Add new class Sys_var_int_with_aliases.
    - Make Sys_var_enforce_gtid_consistency derive from the new class.
    
    @sys_vars.cc
    - Make Sys_var_enforce_gtid_consistency derive from the new class.
    c7463f7e
    WL#7083 step 6.2. GTID-violations: Make ENFORCE_GTID_CONSISTENCY backward compatible with bool.
    Sven Sandberg authored
    Before WL#7083, ENFORCE_GTID_CONSISTENCY was a boolean.  Now it is a
    three-valued variable.  Normally a three-valued variable would be of
    type Sys_var_enum.  However, Sys_var_enum is incompatible with boolean
    in the following ways:
    
    - When the variable is SELECT'ed, boolean shows a numeric value (0 or
      1) whereas enum shows the textual alias.
    
    - Booleans have two textual aliases for each value (0=off=false,
      1=on=true), whereas enum only allows one.
    
    - The command-line option for a boolean can be used without an
      argument: '--command-line-option' without '=VALUE', which has the
      meaning 'TRUE'.  If an enum allows the argument to be optional, it
      takes the default value, which in our case is different from TRUE.
    
    In order to avoid breaking compatibility with this behavior, we
    introduce a new Sys_var class for enumeration-like variables that can
    have multiple aliases, are displayed as integers, and allow
    '--command-line-option' without '=VALUE' to have a different value
    than the default value.
    
    @sys_vars.h
    - Add new class Sys_var_int_with_aliases.
    - Make Sys_var_enforce_gtid_consistency derive from the new class.
    
    @sys_vars.cc
    - Make Sys_var_enforce_gtid_consistency derive from the new class.
Loading