Skip to content

Commit

Permalink
'LogBin' still keep an independent case
Browse files Browse the repository at this point in the history
  • Loading branch information
aliiohs committed Feb 19, 2019
1 parent f862b4c commit 82e7be3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sessionctx/variable/varsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,15 @@ func ValidateSetSystemVar(vars *SessionVars, name string, value string) (string,
return "0", nil
}
return value, ErrWrongValueForVar.GenWithStackByArgs(name, value)
case LogBin:
if strings.EqualFold(value, "ON") || value == "1" {
return "ON", nil
}
if strings.EqualFold(value, "OFF") || value == "0" {
return "OFF", nil
}
return value, ErrWrongValueForVar.GenWithStackByArgs(name, value)

case AutocommitVar, TiDBSkipUTF8Check, TiDBOptAggPushDown,
TiDBOptInSubqToJoinAndAgg,
TiDBBatchInsert, TiDBDisableTxnAutoRetry, TiDBEnableStreaming,
Expand All @@ -348,7 +357,7 @@ func ValidateSetSystemVar(vars *SessionVars, name string, value string) (string,
return value, nil
}
return value, ErrWrongValueForVar.GenWithStackByArgs(name, value)
case TiDBEnableTablePartition, LogBin:
case TiDBEnableTablePartition:
switch {
case strings.EqualFold(value, "ON") || value == "1":
return "on", nil
Expand Down

0 comments on commit 82e7be3

Please sign in to comment.