From eb68dbad41d1ae68e2b53040c1bf02feedc4005b Mon Sep 17 00:00:00 2001 From: paul cannon Date: Thu, 21 Oct 2021 18:29:07 -0500 Subject: [PATCH] satellite/satellitedb: fix ordering in listPendingTransitionShim listPendingTransitionShim is a temporary transition shim intended to make existing API processes keep working when a future DB schema change is executed. For more explanation, see the message on commit c053bdbd70. However, the shim has a small bug: it is missing the ORDER BY clause that appears in the original ListPending method. This transition shim code won't ever run until we make the DB schema change, so this bug hasn't hurt anything yet; it's just important that we fix it before the DB schema change happens. Change-Id: I5953651583ee236500c2c07141dfc9d690a95118 --- satellite/satellitedb/coinpaymentstxs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/satellite/satellitedb/coinpaymentstxs.go b/satellite/satellitedb/coinpaymentstxs.go index 69e04b94d..6f9de6ba8 100644 --- a/satellite/satellitedb/coinpaymentstxs.go +++ b/satellite/satellitedb/coinpaymentstxs.go @@ -552,6 +552,7 @@ func (db *coinPaymentsTransactions) listPendingTransitionShim(ctx context.Contex FROM coinpayments_transactions WHERE status IN (?,?) AND created_at <= ? + ORDER BY created_at DESC LIMIT ? OFFSET ?`) rows, err := db.db.QueryContext(ctx, query, coinpayments.StatusPending, coinpayments.StatusReceived, before, limit+1, offset)