Skip to content

Commit

Permalink
Try single subquery again, ISSUE-952
Browse files Browse the repository at this point in the history
  • Loading branch information
abador committed Jun 10, 2022
1 parent c011208 commit d910a1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion persistence/sql/persister_continuity.go
Expand Up @@ -55,7 +55,7 @@ func (p *Persister) DeleteContinuitySession(ctx context.Context, id uuid.UUID) e
func (p *Persister) DeleteExpiredContinuitySessions(ctx context.Context, expiresAt time.Time, limit int) error {
// #nosec G201
err := p.GetConnection(ctx).RawQuery(fmt.Sprintf(
"DELETE FROM %s WHERE id in (SELECT id FROM (SELECT id FROM %s c WHERE expires_at <= ? and nid = ? ORDER BY expires_at ASC LIMIT %d ) AS s )",
"DELETE FROM %s WHERE id IN (SELECT id FROM %s WHERE expires_at <= ? and nid = ? ORDER BY expires_at ASC LIMIT %d )",
new(continuity.Container).TableName(ctx),
new(continuity.Container).TableName(ctx),
limit,
Expand Down

0 comments on commit d910a1e

Please sign in to comment.