code: func SetSessionSystemVar(vars *variable.SessionVars, name string, value types.Datum) error {
  	name = strings.ToLower(name)
  	sysVar := variable.SysVars[name]
  	if sysVar == nil {
  		return variable.UnknownSystemVar
  	}
  	if value.IsNull() {
  		if name != variable.CharacterSetResults {
  			return variable.ErrCantSetToNull
  		}
  		delete(vars.Systems, name)
  		return nil
  	}
  	sVal, err := value.ToString()
  	if err != nil {
  		return errors.Trace(err)
  	}
  	switch name {
  	case variable.TimeZone:
  		vars.TimeZone = parseTimeZone(sVal)
  	case variable.SQLModeVar:
  		sVal = strings.ToUpper(sVal)
  		if strings.Contains(sVal, "STRICT_TRANS_TABLES") || strings.Contains(sVal, "STRICT_ALL_TABLES") {
  			vars.StrictSQLMode = true
  		} else {
  			vars.StrictSQLMode = false
  		}
  	case variable.AutocommitVar:
  		isAutocommit := strings.EqualFold(sVal, "ON") || sVal == "1"
  		vars.SetStatusFlag(mysql.ServerStatusAutocommit, isAutocommit)
  		if isAutocommit {
  			vars.SetStatusFlag(mysql.ServerStatusInTrans, false)
  		}
  	}
  	vars.Systems[name] = sVal
  	return nil
  }
docs: // SetSessionSystemVar sets system variable and updates SessionVars states.