Bug 24396

Summary: Suggestions.t is failing with MySQL 8
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.03
Circulation function:
Bug Depends on:    
Bug Blocks: 23996    
Attachments: Bug 24396: Fix Suggestions.t with MySQL 8
Bug 24396: Fix Suggestions.t with MySQL 8

Description Jonathan Druart 2020-01-10 10:30:02 UTC
#   Failed test 'DelSuggestion deletes the correct suggestion'
#   at t/db_dependent/Suggestions.t line 413.
#          got: 'my title 3'
#     expected: 'my deleted title'
t/db_dependent/Suggestions.t .. 112/113 # Looks like you failed 1 test of 113.
Comment 1 Jonathan Druart 2020-01-10 10:31:59 UTC
Created attachment 97176 [details] [review]
Bug 24396: Fix Suggestions.t with MySQL 8

#   Failed test 'DelSuggestion deletes the correct suggestion'
 #   at t/db_dependent/Suggestions.t line 413.
 #          got: 'my title 3'
 #     expected: 'my deleted title'
 t/db_dependent/Suggestions.t .. 112/113 # Looks like you failed 1 test of 113.

Suggestions were returned in the reverse order. Adding an ORDER BY clause fixes the problem.

Test plan:
 % prove t/db_dependent/Suggestions.t
must return green
Comment 2 Martin Renvoize (ashimema) 2020-01-10 10:41:27 UTC
Created attachment 97181 [details] [review]
Bug 24396: Fix Suggestions.t with MySQL 8

 #   Failed test 'DelSuggestion deletes the correct suggestion'
 #   at t/db_dependent/Suggestions.t line 413.
 #          got: 'my title 3'
 #     expected: 'my deleted title'
 t/db_dependent/Suggestions.t .. 112/113 # Looks like you failed 1 test of 113.

Suggestions were returned in the reverse order. Adding an ORDER BY clause fixes the problem.

Test plan:
 % prove t/db_dependent/Suggestions.t
must return green

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2020-01-10 10:42:03 UTC
Dang, that could be annoying if we have to add order by statements all over the place to appease mysql8!

Passing QA
Comment 4 Martin Renvoize (ashimema) 2020-01-10 10:57:45 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 5 Joy Nelson 2020-01-30 23:56:25 UTC
Pushed to 19.11.x branch for 19.11.03