code: func (s *schemaValidator) Check(txnTS uint64, schemaVer int64, relatedTableIDs []int64) checkResult {
  	s.mux.RLock()
  	defer s.mux.RUnlock()
  	if !s.isStarted {
  		logutil.Logger(context.Background()).Info("the schema validator stopped before checking")
  		return ResultUnknown
  	}
  	if s.lease == 0 {
  		return ResultSucc
  	}
  
  	// Schema changed, result decided by whether related tables change.
  	if schemaVer < s.latestSchemaVer {
  		// The DDL relatedTableIDs is empty.
  		if len(relatedTableIDs) == 0 {
  			logutil.Logger(context.Background()).Info("the related table ID is empty", zap.Int64("schemaVer", schemaVer),
  				zap.Int64("latestSchemaVer", s.latestSchemaVer))
  			return ResultFail
  		}
  
  		if s.isRelatedTablesChanged(schemaVer, relatedTableIDs) {
  			return ResultFail
  		}
  		return ResultSucc
  	}
  
  	// Schema unchanged, maybe success or the schema validator is unavailable.
  	t := oracle.GetTimeFromTS(txnTS)
  	if t.After(s.latestSchemaExpire) {
  		return ResultUnknown
  	}
  	return ResultSucc
  }
docs: // Check checks schema validity, returns true if use schemaVer and related tables at txnTS is legal.