Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
fix invalid input syntax for bigint
Browse files Browse the repository at this point in the history
invalid input syntax for type bigint: \"SHA256\"
  • Loading branch information
blankdots committed Oct 16, 2023
1 parent 37674cd commit d4abf30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/database/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ func (dbs *SQLdb) markCompleted(file FileInfo, fileID, corrID string) error {
corrID,
fmt.Sprintf("%x", file.Checksum.Sum(nil)),
hashType(file.Checksum),
file.DecryptedSize,
fmt.Sprintf("%x", file.DecryptedChecksum.Sum(nil)),
hashType(file.DecryptedChecksum),
file.DecryptedSize,
)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions internal/database/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ func TestMarkCompleted(t *testing.T) {
"71bb2f05-2061-41ac-9f62-32322fde7e7d",
"96fa8f226d3801741e807533552bc4b177ac4544d834073b6a5298934d34b40b",
"SHA256",
file.DecryptedSize,
"b353d3058b350466bb75a4e5e2263c73a7b900e2c48804780c6dd820b8b151ba",
"SHA256",
file.DecryptedSize,
).WillReturnResult(r)

return testDb.MarkCompleted(file, "fb140b10-1354-4266-879e-b34ad3e64c57", "71bb2f05-2061-41ac-9f62-32322fde7e7d")
Expand All @@ -225,9 +225,9 @@ func TestMarkCompleted(t *testing.T) {
"71bb2f05-2061-41ac-9f62-32322fde7e7d",
"96fa8f226d3801741e807533552bc4b177ac4544d834073b6a5298934d34b40b",
"SHA256",
file.DecryptedSize,
"b353d3058b350466bb75a4e5e2263c73a7b900e2c48804780c6dd820b8b151ba",
"SHA256",
file.DecryptedSize,
).WillReturnError(fmt.Errorf("error for testing"))

return testDb.MarkCompleted(file, "fb140b10-1354-4266-879e-b34ad3e64c57", "71bb2f05-2061-41ac-9f62-32322fde7e7d")
Expand Down

0 comments on commit d4abf30

Please sign in to comment.