Bugzilla – Attachment 74890 Details for
Bug 20665
OAI-PMH Provider should reset MySQL connection time zone
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20665: Reset MySQL connection time zone in the OAI-PMH Provider
Bug-20665-Reset-MySQL-connection-time-zone-in-the-.patch (text/plain), 1.58 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-04-26 17:28:27 UTC
(
hide
)
Description:
Bug 20665: Reset MySQL connection time zone in the OAI-PMH Provider
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-04-26 17:28:27 UTC
Size:
1.58 KB
patch
obsolete
>From 0f821ecb20fc95118014db12e06929558e562884 Mon Sep 17 00:00:00 2001 >From: Ere Maijala <ere.maijala@helsinki.fi> >Date: Thu, 26 Apr 2018 13:08:25 +0000 >Subject: [PATCH] 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> >--- > Koha/OAI/Server/Repository.pm | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/Koha/OAI/Server/Repository.pm b/Koha/OAI/Server/Repository.pm >index d677787cf8..30ace36f5e 100644 >--- a/Koha/OAI/Server/Repository.pm >+++ b/Koha/OAI/Server/Repository.pm >@@ -115,6 +115,10 @@ sub new { > > # OAI-PMH handles dates in UTC, so do that on the database level to avoid need for > # any conversions >+ my $sth = C4::Context->dbh->prepare('SELECT @@session.time_zone'); >+ $sth->execute(); >+ my ( $orig_tz ) = $sth->fetchrow(); >+ $self->{ mysql_orig_tz } = $orig_tz; > C4::Context->dbh->prepare("SET time_zone='+00:00'")->execute(); > > # Check for grammatical errors in the request >@@ -152,6 +156,15 @@ sub new { > } > > >+sub DESTROY { >+ my ( $self ) = @_; >+ >+ # Reset time zone to the original value >+ C4::Context->dbh->prepare("SET time_zone='" . $self->{ mysql_orig_tz } . "'")->execute() >+ if $self->{ mysql_orig_tz }; >+} >+ >+ > sub get_biblio_marcxml { > my ($self, $biblionumber, $format) = @_; > my $with_items = 0; >-- >2.17.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20665
:
74880
|
74882
|
74883
|
74889
| 74890