From 8373ffaebaed0f422f10e1f12a1eeec62f1eb57e Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 2 Sep 2023 16:32:54 +0200 Subject: [PATCH] Checker: cast numeric to float in get_check_duration() Postgresql 14 changed the result type for extract() from float to numeric. --- src/ctf_gameserver/checker/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ctf_gameserver/checker/database.py b/src/ctf_gameserver/checker/database.py index a493a0e..8cb7926 100644 --- a/src/ctf_gameserver/checker/database.py +++ b/src/ctf_gameserver/checker/database.py @@ -67,8 +67,8 @@ def get_check_duration(db_conn, service_id, std_dev_count, prohibit_changes=Fals """ with transaction_cursor(db_conn, prohibit_changes) as cursor: - cursor.execute('SELECT avg(extract(epoch from (placement_end - placement_start))) + %s *' - ' stddev_pop(extract(epoch from (placement_end - placement_start)))' + cursor.execute('SELECT (avg(extract(epoch from (placement_end - placement_start))) + %s *' + ' stddev_pop(extract(epoch from (placement_end - placement_start))))::float' ' FROM scoring_flag, scoring_gamecontrol' ' WHERE service_id = %s AND tick < current_tick', (std_dev_count, service_id)) result = cursor.fetchone()