Skip to content

Commit cfb9b01

Browse files
authored
Merge eda1501 into 3703e5a
2 parents 3703e5a + eda1501 commit cfb9b01

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP INDEX hydra_oauth2_refresh_requested_at_idx;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE INDEX hydra_oauth2_refresh_requested_at_idx ON hydra_oauth2_refresh (nid, requested_at);

persistence/sql/persister_oauth2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ func (p *Persister) flushInactiveTokens(ctx context.Context, notAfter time.Time,
452452
// The outer SELECT is necessary because our version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery
453453
deletedRecords, err = p.Connection(ctx).RawQuery(
454454
fmt.Sprintf(`DELETE FROM %s WHERE signature in (
455-
SELECT signature FROM (SELECT signature FROM %s hoa WHERE requested_at < ? and nid = ? ORDER BY signature LIMIT %d ) as s
455+
SELECT signature FROM (SELECT signature FROM %s hoa WHERE requested_at < ? and nid = ? ORDER BY requested_at LIMIT %d ) as s
456456
)`, OAuth2RequestSQL{Table: table}.TableName(), OAuth2RequestSQL{Table: table}.TableName(), d),
457457
notAfter,
458458
p.NetworkID(ctx),

0 commit comments

Comments
 (0)