Summary: | koha-mysql does not honor Koha's timezone setting | ||
---|---|---|---|
Product: | Koha | Reporter: | Kyle M Hall (khall) <kyle> |
Component: | Architecture, internals, and plumbing | Assignee: | Kyle M Hall (khall) <kyle> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | dcook, jonathan.druart, lucas, michalurban177, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.11.00,22.05.06,21.11.12
|
|
Circulation function: | |||
Attachments: |
Bug 30468: koha-mysql does not honor Koha's timezone setting
Bug 30468: koha-mysql does not honor Koha's timezone setting Bug 30468: koha-mysql does not honor Koha's timezone setting Bug 30468: koha-mysql does not honor Koha's timezone setting Bug 30468: koha-mysql does not honor Koha's timezone setting Bug 30468: Restore 'set -e' and remove echos Bug 30468: Restore 'set -e' and remove echos |
Description
Kyle M Hall (khall)
2022-04-06 12:37:43 UTC
Created attachment 132996 [details] [review] 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! Created attachment 132998 [details] [review] 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! Created attachment 132999 [details] [review] 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! Created attachment 133000 [details] [review] 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! Created attachment 136746 [details] [review] 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> Ohhh good catch. Kyle, do we really want to keep the echos? Created attachment 138457 [details] [review] Bug 30468: Restore 'set -e' and remove echos What about this patch? Set to PQA if you agree with it. Created attachment 138458 [details] [review] Bug 30468: Restore 'set -e' and remove echos Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master for 22.11. Nice work everyone, thanks! Backported to 22.05.x for 22.05.06 Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved. Thanks! Pushed to 21.11 for 21.11.12 |