Bug 30468: koha-mysql does not honor Koha's timezone setting
authorKyle Hall <kyle@bywatersolutions.com>
Wed, 6 Apr 2022 12:38:00 +0000 (08:38 -0400)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Wed, 12 Oct 2022 11:11:20 +0000 (13:11 +0200)
commit809133e78f1e36ba1205b094b5b7ce9a799c1143
treeabdc2dfa71f2b07e37e886cb092868687cc2136e
parent7601e6048564bd570fb9495fc2c60b452e63dffa
Bug 30468: koha-mysql does not honor Koha's timezone setting

If I run a query like "SELECT NOW()" from a koha report, I will get a different answer than if I had run it from koha-mysql.
In Koha, we set the timezone for each database connection.
However, koha-mysql does not do this, so instead we are left using the default timezone of the database.

Test Plan:
1) Set your time zone to something other than the database time zone
2) run "SELECT NOW()" using debian/scripts/koha-mysql
   *not* /usr/sbin/koha-mysql
3) Note you get the database timezone's current time
4) Apply this patch
5) Repeat step 2
6) Now you get the correct time!

Signed-off-by: Michal Urban <michalurban177@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e97b099d58e73be44354d2343c0f45077871b398)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5e14e2c693e2382780f25c5fe8dc32b78d011d1f)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
debian/scripts/koha-mysql