Fix type issues with the location ids
On one code path, they were handled as numbers, whereas elsewhere they were handled as strings. This led to the package-metadata code trying to insert duplicate entries. Instead, just handle them as strings everywhere.
This commit is contained in:
parent
721d21ed4d
commit
28c2d46081
3 changed files with 20 additions and 10 deletions
|
|
@ -42,13 +42,11 @@
|
||||||
(list file
|
(list file
|
||||||
(number->string line)
|
(number->string line)
|
||||||
(number->string column)))
|
(number->string column)))
|
||||||
(((id))
|
(((id)) id)
|
||||||
(string->number id))
|
|
||||||
(()
|
(()
|
||||||
(string->number
|
(caar
|
||||||
(caar
|
(exec-query conn
|
||||||
(exec-query conn
|
insert-location
|
||||||
insert-location
|
(list file
|
||||||
(list file
|
(number->string line)
|
||||||
(number->string line)
|
(number->string column)))))))))
|
||||||
(number->string column))))))))))
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ WHERE packages.id IN (
|
||||||
(value->quoted-string-or-null synopsis) ","
|
(value->quoted-string-or-null synopsis) ","
|
||||||
(value->quoted-string-or-null description) ","
|
(value->quoted-string-or-null description) ","
|
||||||
(value->quoted-string-or-null home_page) ","
|
(value->quoted-string-or-null home_page) ","
|
||||||
(number->string location_id)
|
location_id
|
||||||
")")))
|
")")))
|
||||||
metadata-rows)
|
metadata-rows)
|
||||||
",")
|
",")
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,18 @@
|
||||||
conn
|
conn
|
||||||
(list mock-inferior-package-foo))
|
(list mock-inferior-package-foo))
|
||||||
((x) (string? x))))
|
((x) (string? x))))
|
||||||
|
#:always-rollback? #t))
|
||||||
|
|
||||||
|
(with-postgresql-transaction
|
||||||
|
conn
|
||||||
|
(lambda (conn)
|
||||||
|
(test-equal "inferior-packages->package-metadata-ids"
|
||||||
|
(inferior-packages->package-metadata-ids
|
||||||
|
conn
|
||||||
|
(list mock-inferior-package-foo))
|
||||||
|
(inferior-packages->package-metadata-ids
|
||||||
|
conn
|
||||||
|
(list mock-inferior-package-foo)))
|
||||||
#:always-rollback? #t))))))
|
#:always-rollback? #t))))))
|
||||||
|
|
||||||
(test-end)
|
(test-end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue