Skip to content

Commit

Permalink
Fix Gorm Mysql Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ismail0234 committed Dec 4, 2024
1 parent d866f41 commit 218140b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions management/server/sql_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
storeSqliteFileName = "store.db"
idQueryCondition = "id = ?"
keyQueryCondition = "key = ?"
mysqlKeyQueryCondition = "`key` = ?"
mysqlKeyQueryCondition = "`key` = ?"
accountAndIDQueryCondition = "account_id = ? and id = ?"
accountAndIDsQueryCondition = "account_id = ? AND id IN ?"
accountIDCondition = "account_id = ?"
Expand Down Expand Up @@ -410,7 +410,7 @@ func (s *SqlStore) SavePeerLocation(accountID string, peerWithLocation *nbpeer.P
return result.Error
}

if result.RowsAffected == 0 {
if result.RowsAffected == 0 && s.storeEngine != MysqlStoreEngine {
return status.Errorf(status.NotFound, peerNotFoundFMT, peerWithLocation.ID)
}

Expand Down

0 comments on commit 218140b

Please sign in to comment.