Skip to content

Commit

Permalink
fix: insert statement
Browse files Browse the repository at this point in the history
  • Loading branch information
arrabito authored and fstagni committed Feb 26, 2024
1 parent 77978a6 commit 434c78e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DIRAC/AccountingSystem/DB/AccountingDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def __addKeyValue(self, typeName, keyName, keyValue):
return retVal
connection = retVal["Value"]
self.log.info(f"Value {keyValue} for key {keyName} didn't exist, inserting")
retVal = self.insertFields(keyTable, ["id", "value"], [0, keyValue], conn=connection)
retVal = self.insertFields(keyTable, ["value"], [keyValue], conn=connection)
if not retVal["OK"] and retVal["Message"].find("Duplicate key") == -1:
return retVal
result = self.__getIdForKeyValue(typeName, keyName, keyValue, conn=connection)
Expand Down Expand Up @@ -541,8 +541,8 @@ def calculateBuckets(self, typeName, startTime, endTime, nowEpoch=False):
return buckets

def __insertInQueueTable(self, typeName, startTime, endTime, valuesList):
sqlFields = ["id", "taken", "takenSince"] + self.dbCatalog[typeName]["typeFields"]
sqlValues = ["0", "0", "UTC_TIMESTAMP()"] + valuesList + [startTime, endTime]
sqlFields = ["taken", "takenSince"] + self.dbCatalog[typeName]["typeFields"]
sqlValues = ["0", "UTC_TIMESTAMP()"] + valuesList + [startTime, endTime]
if len(sqlFields) != len(sqlValues):
numRcv = len(valuesList) + 2
numExp = len(self.dbCatalog[typeName]["typeFields"])
Expand Down

0 comments on commit 434c78e

Please sign in to comment.