Db: fix checksum collisions for Postgres tests

This commit is contained in:
Thomas Gelf 2016-03-02 20:46:36 +01:00
parent 4e677dbc56
commit 3d4052fa0c
1 changed files with 2 additions and 2 deletions

View File

@ -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";
}