From 3d4052fa0cfc4bd074426d6a76471a973ac9492d Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 2 Mar 2016 20:46:36 +0100 Subject: [PATCH] Db: fix checksum collisions for Postgres tests --- library/Director/Db.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Director/Db.php b/library/Director/Db.php index c512aeb1..0d9fccf9 100644 --- a/library/Director/Db.php +++ b/library/Director/Db.php @@ -240,11 +240,11 @@ class Db extends DbConnection { if ($this->isPgsql()) { $select = "SELECT checksum FROM (SELECT * FROM (SELECT 1 AS pos, LOWER(ENCODE(checksum, 'hex')) AS checksum" - . " FROM director_activity_log ORDER BY change_time DESC LIMIT 1) a" + . " FROM director_activity_log ORDER BY id DESC LIMIT 1) a" . " UNION SELECT 2 AS pos, '' AS checksum) u ORDER BY pos LIMIT 1"; } else { $select = "SELECT checksum FROM (SELECT * FROM (SELECT 1 AS pos, LOWER(HEX(checksum)) AS checksum" - . " FROM director_activity_log ORDER BY change_time DESC LIMIT 1) a" + . " FROM director_activity_log ORDER BY id DESC LIMIT 1) a" . " UNION SELECT 2 AS pos, '' AS checksum) u ORDER BY pos LIMIT 1"; }