code: func ValidateGetSystemVar(name string, isGlobal bool) error {
  	sysVar, exists := SysVars[name]
  	if !exists {
  		return UnknownSystemVar.GenWithStackByArgs(name)
  	}
  	switch sysVar.Scope {
  	case ScopeGlobal, ScopeNone:
  		if !isGlobal {
  			return ErrIncorrectScope.GenWithStackByArgs(name, "GLOBAL")
  		}
  	case ScopeSession:
  		if isGlobal {
  			return ErrIncorrectScope.GenWithStackByArgs(name, "SESSION")
  		}
  	}
  	return nil
  }
docs: // ValidateGetSystemVar checks if system variable exists and validates its scope when get system variable.