Bug 20665

Summary: OAI-PMH Provider should reset MySQL connection time zone
Product: Koha Reporter: Ere Maijala <ere.maijala>
Component: Web servicesAssignee: Ere Maijala <ere.maijala>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi (tcohen) <tomascohen>
Severity: major    
Priority: P5 - low CC: dcook, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 20665 - Reset MySQL connection time zone in the OAI-PMH Provider
Bug 20665: Units tests for testing MySQL connection time zone
Bug 20665: Reset MySQL connection time zone in the OAI-PMH Provider
Bug 20665: Units tests for testing MySQL connection time zone
Bug 20665: Reset MySQL connection time zone in the OAI-PMH Provider

Description Ere Maijala 2018-04-26 12:02:02 UTC
The OAI-PMH Provider currently sets the MySQL connection time zone to +00:00, but doesn't reset it back to the original value. If it's run under the same Plack as other services, the other services may use a connection that has the changed time zone, which results in wrong timestamps being recorded in the database.
Comment 1 Ere Maijala 2018-04-26 12:13:53 UTC
Created attachment 74880 [details] [review]
Bug 20665 - Reset MySQL connection time zone in the OAI-PMH Provider

Test plan:
1.) Run tests in t/db_dependent/Server.t
Comment 2 Mark Tompsett 2018-04-26 13:13:31 UTC
Created attachment 74882 [details] [review]
Bug 20665: Units tests for testing MySQL connection time zone

TEST PLAN
---------
apply this test patch
prove t/db_dependent/OAI/Server.t
-- should fail
apply the other patch
prove t/db_dependent/OAI/Server.t
-- should pass
run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 3 Mark Tompsett 2018-04-26 13:13:33 UTC
Created attachment 74883 [details] [review]
Bug 20665: Reset MySQL connection time zone in the OAI-PMH Provider

TEST PLAN
---------
apply unit test patch
prove t/db_dependent/OAI/Server.t
-- should fail
apply this patch
prove t/db_dependent/OAI/Server.t
-- should pass
run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 4 Tomás Cohen Arazi (tcohen) 2018-04-26 17:28:20 UTC
Created attachment 74889 [details] [review]
Bug 20665: Units tests for testing MySQL connection time zone

TEST PLAN
---------
apply this test patch
prove t/db_dependent/OAI/Server.t
-- should fail
apply the other patch
prove t/db_dependent/OAI/Server.t
-- should pass
run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Tomás Cohen Arazi (tcohen) 2018-04-26 17:28:27 UTC
Created attachment 74890 [details] [review]
Bug 20665: Reset MySQL connection time zone in the OAI-PMH Provider

TEST PLAN
---------
apply unit test patch
prove t/db_dependent/OAI/Server.t
-- should fail
apply this patch
prove t/db_dependent/OAI/Server.t
-- should pass
run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Tomás Cohen Arazi (tcohen) 2018-04-26 17:29:14 UTC
Raising priority.
Comment 7 Jonathan Druart 2018-05-03 16:41:35 UTC
Pushed to master for 18.05, thanks to everybody involved!