From 8fc4fed3a0206872b85594815ffc72f6497e0a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Wed, 12 Nov 2025 13:20:08 +0100 Subject: [PATCH] Fix SQL query syntax --- management/server/store/sql_store.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/management/server/store/sql_store.go b/management/server/store/sql_store.go index c5778af60..a36ab1c3d 100644 --- a/management/server/store/sql_store.go +++ b/management/server/store/sql_store.go @@ -41,15 +41,15 @@ import ( ) const ( - storeSqliteFileName = "store.db" - idQueryCondition = "id = ?" - keyQueryCondition = "key = ?" - mysqlKeyQueryCondition = "`key` = ?" - accountAndIDQueryCondition = "account_id = ? and id = ?" + storeSqliteFileName = "store.db" + idQueryCondition = "id = ?" + keyQueryCondition = "key = ?" + mysqlKeyQueryCondition = "`key` = ?" + accountAndIDQueryCondition = "account_id = ? and id = ?" accountAndPeerIDQueryCondition = "account_id = ? and peer_id = ?" - accountAndIDsQueryCondition = "account_id = ? AND id IN ?" - accountIDCondition = "account_id = ?" - peerNotFoundFMT = "peer %s not found" + accountAndIDsQueryCondition = "account_id = ? AND id IN ?" + accountIDCondition = "account_id = ?" + peerNotFoundFMT = "peer %s not found" pgMaxConnections = 30 pgMinConnections = 1 @@ -161,7 +161,7 @@ func (s *SqlStore) MarkPendingJobsAsFailed(ctx context.Context, accountID, peerI now := time.Now().UTC() result := s.db. Model(&types.Job{}). - Where(accountAndPeerIDQueryCondition+"AND status = ?", accountID, peerID, types.JobStatusPending). + Where(accountAndPeerIDQueryCondition+" AND status = ?", accountID, peerID, types.JobStatusPending). Updates(types.Job{ Status: types.JobStatusFailed, FailedReason: reason,