code: func (e *DDLExec) toErr(err error) error {
  	if e.ctx.GetSessionVars().StmtCtx.IsDDLJobInQueue {
  		return err
  	}
  
  	// Before the DDL job is ready, it encouters an error that may be due to the outdated schema information.
  	// After the DDL job is ready, the ErrInfoSchemaChanged error won't happen because we are getting the schema directly from storage.
  	// So we needn't to consider this condition.
  	// Here we distinguish the ErrInfoSchemaChanged error from other errors.
  	dom := domain.GetDomain(e.ctx)
  	checker := domain.NewSchemaChecker(dom, e.is.SchemaMetaVersion(), nil)
  	txn, err1 := e.ctx.Txn(true)
  	if err1 != nil {
  		logutil.Logger(context.Background()).Error("active txn failed", zap.Error(err))
  		return err1
  	}
  	schemaInfoErr := checker.Check(txn.StartTS())
  	if schemaInfoErr != nil {
  		return errors.Trace(schemaInfoErr)
  	}
  	return err
  }
docs: // toErr converts the error to the ErrInfoSchemaChanged when the schema is outdated.