Commit 798d1f2b authored by Andy Yates's avatar Andy Yates
Browse files

Ordering only by the session's created date failed to realise we could have...

Ordering only by the session's created date failed to realise we could have more than one entry for the same stable id. Ordering now by the score as a way of getting rid of this ambiguity. Issue was picked up by Rhoda running the code on an older MySQL version which consistently exhibited different behaviour to later MySQL versions
parent a25d9184
......@@ -350,7 +350,7 @@ sub _fetch_archive_id {
WHERE sie.mapping_session_id = ms.mapping_session_id
AND sie.new_stable_id = ?
$extra_sql2)
ORDER BY created DESC
ORDER BY created DESC, score DESC
LIMIT 1
);
......
......@@ -150,7 +150,7 @@ ok( ! $asi->is_latest, 'Not on the latest version so is_latest is false');
$asi = $asi->get_latest_incarnation;
ok($asi->is_latest(), 'Latest incarnation must be the latest version');
is($asi->version, 3, 'Latest version is 3');
is($asi->version, 4, 'Latest version is 4');
#
# 19 associated IDs in archive
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment