Fix resolve_group() if the version number is greater than 65535

Signed-off-by: Graham <gpe@openrs2.org>
Graham 4 years ago
parent bc907d5309
commit 01b50e33f7
  1. 5
      archive/src/main/resources/org/openrs2/archive/migrations/V1__init.sql

@ -179,7 +179,10 @@ CREATE FUNCTION resolve_group(_archive_id uint1, _group_id INTEGER, _crc32 INTEG
SELECT c.* SELECT c.*
FROM groups g FROM groups g
JOIN containers c ON c.id = g.container_id JOIN containers c ON c.id = g.container_id
WHERE g.archive_id = _archive_id AND g.group_id = _group_id AND c.crc32 = _crc32 AND g.version = _version & 65535 WHERE g.archive_id = _archive_id AND g.group_id = _group_id AND c.crc32 = _crc32 AND (
(g.version = _version AND NOT g.version_truncated) OR
(g.version = _version & 65535 AND g.version_truncated)
)
ORDER BY g.version_truncated ASC, c.id ASC ORDER BY g.version_truncated ASC, c.id ASC
LIMIT 1; LIMIT 1;
$$ LANGUAGE SQL STABLE PARALLEL SAFE ROWS 1; $$ LANGUAGE SQL STABLE PARALLEL SAFE ROWS 1;

Loading…
Cancel
Save