Bug 34223: (follow-up) Ensure consistent ordering of statuses

This patch adds an order_by clause to ensure consistent ordering of the
returned status and status_alias statuses from the database between
MySQL 8 and other DB engines.

This fixes the failing tests introducd in bug 34223.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7f9ff906d9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9b1ff4d540)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2023-09-11 14:50:43 +01:00 committed by Matt Blenkinsop
parent 37f342822a
commit dddc3b83ea
1 changed files with 2 additions and 0 deletions

View File

@ -61,6 +61,7 @@ sub existing_statuses {
select => [ 'status', \'MAX(illrequest_id)', 'backend' ],
as => [qw/ status illrequest_id backend /],
group_by => [qw/status backend/],
order_by => [qw/status backend/],
}
);
while ( my $request = $ill_requests->next ) {
@ -83,6 +84,7 @@ sub existing_statuses {
select => [ 'status_alias', \'MAX(illrequest_id)', 'backend' ],
as => [qw/ status_alias illrequest_id backend /],
group_by => [qw/status_alias backend/],
order_by => [qw/status_alias backend/],
}
);
while ( my $request = $ill_requests->next ) {