code: func (s *session) rollbackOnError(ctx context.Context) {
  	if !s.sessionVars.InTxn() {
  		s.RollbackTxn(ctx)
  	}
  }
docs: // rollbackOnError makes sure the next statement starts a new transaction with the latest InfoSchema.