code: func GetSessionSystemVar(s *variable.SessionVars, key string) (string, error) {
  	key = strings.ToLower(key)
  	sysVar := variable.SysVars[key]
  	if sysVar == nil {
  		return "", variable.UnknownSystemVar
  	}
  	sVal, ok := s.Systems[key]
  	if ok {
  		return sVal, nil
  	}
  	if sysVar.Scope&variable.ScopeGlobal == 0 {
  		// None-Global variable can use pre-defined default value.
  		return sysVar.Value, nil
  	}
  	gVal, err := s.GlobalVarsAccessor.GetGlobalSysVar(key)
  	if err != nil {
  		return "", errors.Trace(err)
  	}
  	s.Systems[key] = gVal
  	return gVal, nil
  }
docs: // GetSessionSystemVar gets a system variable.
  // If it is a session only variable, use the default value defined in code.
  // Returns error if there is no such variable.