func BoolToInt32(b bool) int32 {
	if b {
		return 1
	}
	return 0
}
BoolToInt32 converts bool to int32
package variable
import (
	"strconv"
	"strings"
	"sync/atomic"
	"github.com/pingcap/parser/mysql"
	"github.com/pingcap/parser/terror"
	"github.com/pingcap/tidb/config"
	"github.com/pingcap/tidb/kv"
	"github.com/pingcap/tidb/util/logutil"
)
type ScopeFlag uint8
const (
	ScopeNone ScopeFlag = 0
	ScopeGlobal ScopeFlag = 1 << 0
	ScopeSession ScopeFlag = 1 << 1
)
type SysVar struct {
	Scope ScopeFlag
	Name string
	Value string
}
var SysVars map[string]*SysVar
func GetSysVar(name string) *SysVar {
	name = strings.ToLower(name)
	return SysVars[name]
}
var PluginVarNames []string
const (
	CodeUnknownStatusVar            terror.ErrCode = 1
	CodeUnknownSystemVar            terror.ErrCode = mysql.ErrUnknownSystemVariable
	CodeIncorrectScope              terror.ErrCode = mysql.ErrIncorrectGlobalLocalVar
	CodeUnknownTimeZone             terror.ErrCode = mysql.ErrUnknownTimeZone
	CodeReadOnly                    terror.ErrCode = mysql.ErrVariableIsReadonly
	CodeWrongValueForVar            terror.ErrCode = mysql.ErrWrongValueForVar
	CodeWrongTypeForVar             terror.ErrCode = mysql.ErrWrongTypeForVar
	CodeTruncatedWrongValue         terror.ErrCode = mysql.ErrTruncatedWrongValue
	CodeMaxPreparedStmtCountReached terror.ErrCode = mysql.ErrMaxPreparedStmtCountReached
)
var (
	UnknownStatusVar               = terror.ClassVariable.New(CodeUnknownStatusVar, "unknown status variable")
	UnknownSystemVar               = terror.ClassVariable.New(CodeUnknownSystemVar, mysql.MySQLErrName[mysql.ErrUnknownSystemVariable])
	ErrIncorrectScope              = terror.ClassVariable.New(CodeIncorrectScope, mysql.MySQLErrName[mysql.ErrIncorrectGlobalLocalVar])
	ErrUnknownTimeZone             = terror.ClassVariable.New(CodeUnknownTimeZone, mysql.MySQLErrName[mysql.ErrUnknownTimeZone])
	ErrReadOnly                    = terror.ClassVariable.New(CodeReadOnly, "variable is read only")
	ErrWrongValueForVar            = terror.ClassVariable.New(CodeWrongValueForVar, mysql.MySQLErrName[mysql.ErrWrongValueForVar])
	ErrWrongTypeForVar             = terror.ClassVariable.New(CodeWrongTypeForVar, mysql.MySQLErrName[mysql.ErrWrongTypeForVar])
	ErrTruncatedWrongValue         = terror.ClassVariable.New(CodeTruncatedWrongValue, mysql.MySQLErrName[mysql.ErrTruncatedWrongValue])
	ErrMaxPreparedStmtCountReached = terror.ClassVariable.New(CodeMaxPreparedStmtCountReached, mysql.MySQLErrName[mysql.ErrMaxPreparedStmtCountReached])
	ErrUnsupportedValueForVar      = terror.ClassVariable.New(CodeUnknownStatusVar, "variable '%s' does not yet support value: %s")
	ErrUnsupportedIsolationLevel   = terror.ClassVariable.New(CodeUnknownStatusVar, "The isolation level '%s' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error")
)
func init() {
	SysVars = make(map[string]*SysVar)
	for _, v := range defaultSysVars {
		SysVars[v.Name] = v
	}
	initSynonymsSysVariables()
}
func BoolToIntStr(b bool) string {
	if b {
		return "1"
	}
	return "0"
}