func (s *SessionVariables) Get(key string) (interface{}, bool) {
	v, ok := s.variables[key]
	return v, ok
}
Get return variable with specific key
package mysql
import (
	"fmt"
	"strconv"
	"strings"
	"github.com/nooncall/shazam/core/errors"
)
type verifyFunc func(interface{}) error
const (
	SQLModeStr     = "sql_mode"
	SQLSafeUpdates = "sql_safe_updates"
	TimeZone       = "time_zone"
)
const (
	MaxAllowedPacket = "max_allowed_packet"
)
var variableVerifyFuncMap = map[string]verifyFunc{
	SQLModeStr:     verifySQLMode,
	SQLSafeUpdates: verifyOnOffInteger,
	TimeZone:       verifyTimeZone,
}
type SessionVariables struct {
	variables map[string]*Variable
	unused    map[string]*Variable
}
func NewSessionVariables() *SessionVariables {
	return &SessionVariables{
		variables: make(map[string]*Variable),
		unused:    make(map[string]*Variable),
	}
}
func (s *SessionVariables) Equals(dst *SessionVariables) bool {
	if len(s.variables) != len(dst.variables) {
		return false
	}
	for _, v := range s.variables {
		if dstV, ok := dst.variables[v.Name()]; !ok {
			return false
		} else if dstV != v {
			return false
		}
	}
	return true
}
func (s *SessionVariables) SetEqualsWith(dst *SessionVariables) (   bool, error) {
	if len(s.variables) == 0 && len(dst.variables) != 0 {
		for _, v := range dst.variables {
			if err := s.Set(v.Name(), v.Get()); err != nil {
				return false, err
			}
		}
		return true, nil
	}
	if len(s.variables) != 0 && len(dst.variables) == 0 {
		for _, v := range s.variables {
			s.unused[v.Name()] = v
			delete(s.variables, v.Name())
		}
		return true, nil
	}
	changed := false
	for variableName := range variableVerifyFuncMap {
		srcVar, srcOK := s.variables[variableName]
		dstVar, dstOK := dst.variables[variableName]
		if srcOK && dstOK {
			if srcVar.Get() != dstVar.Get() {
				changed = true
				srcVar.Set(dstVar.Get())
			}
		} else if srcOK && !dstOK {
			changed = true
			s.unused[variableName] = srcVar
			delete(s.variables, variableName)
		} else if !srcOK && dstOK {
			changed = true
			s.Set(variableName, dstVar.Get())
		}
	}
	return changed, nil
}
func (s *SessionVariables) Delete(key string) {
	delete(s.variables, formatVariableName(key))
}
func (s *SessionVariables) Set(key string, value interface{}) error {
	formatKey := formatVariableName(key)
	verifyFunc, ok := variableVerifyFuncMap[formatKey]
	if !ok {
		return fmt.Errorf("variable not support")
	}
	if variable, ok := s.variables[formatKey]; ok {
		return variable.Set(value)
	}
	variable, err := NewVariable(formatKey, value, verifyFunc)
	if err != nil {
		return err
	}
	s.variables[formatKey] = variable
	return nil
}