Details
Description
When Time machine is set to 6 months, PostgreSQL database reports an integer out of range:
STATEMENT: SELECT "t1"."id", "t1"."name", "t1"."repository_id", "t1"."manifest_id", "t1"."lifetime_start_ms", "t1"."lifetime_end_ms", "t1"."hidden", "t1"."reversion", "t1"."tag_kind_id", "t1"."linked_tag_id" FROM "tag" AS "t1" INNER JOIN "repository" AS "t2" ON ("t1"."repository_id" = "t2"."id") INNER JOIN "user" AS "t3" ON ("t2"."namespace_user_id" = "t3"."id") WHERE ((("t1"."repository_id" = 36) AND NOT ("t1"."lifetime_end_ms" IS NULL)) AND ("t1"."lifetime_end_ms" <= (1588710651757 - ("t3"."removed_tag_expiration_s" * 1000)))) LIMIT 10 ERROR: integer out of range
And zoom-in to the root cause :
"t1"."lifetime_end_ms" <= (1588710651757 - ("t3"."removed_tag_expiration_s" * 1000))
lifetime_end_ms is a bigint
removed_tag_expiration_s is a int
If users select 6 months, which is an available value in the Time Machine settings, this means 15724800 seconds. So, 15724800 * 1000 will go "out of range" of the integer.