[Bug 27573] New: Use of NOW() in SQL should be avoided
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 Bug ID: 27573 Summary: Use of NOW() in SQL should be avoided Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org A few uses of the SQL NOW() function have crept in.. if we want to have consistent dates using the timezone set in the config then we need to handle date parsing before we hit the database as the DB timezone may differ from the instance timezone. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27511 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27511 [Bug 27511] Don't use NOW() in saved sql last run update -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27574 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27574 [Bug 27574] Don't use NOW() in Koha::Accounts -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 Bug 27573 depends on bug 27574, which changed state. Bug 27574 Summary: Don't use NOW() in Koha::Accounts https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27574 What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |INVALID -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Better yet we should use UTC dates in the database :D -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WONTFIX --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- In conversation with Jonathan I discovered we actually set the timezone on the database connection handle.. so this isn't the problem I suspected it was. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- (In reply to Martin Renvoize from comment #2)
In conversation with Jonathan I discovered we actually set the timezone on the database connection handle.. so this isn't the problem I suspected it was.
I should've mentioned that before. It would still be a problem though if you had 2 different Koha websites pointed at the same database with different timezones, although I suppose these days we use the koha-conf.xml rather than the Apache config to set the timezone, so I suppose we are practically limiting Koha to only ever serving 1 timezone. Probably not an issue in most cases but certainly a shortcoming. For instance, my state (New South Wales) actually contains 2 different timezones. That means that Koha couldn't currently serve every school library in this state with the correct time. A quick Google suggests France has 12 timezones, so Koha wouldn't be able to handle all X libraries in France either. At some point, we really should consider converting from local time to UTC time in the database. That is, transforming from local time to UTC when storing data, and transforming from UTC to local time when retrieving data. (This also helps to avoid daylight savings time issues.) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- That's actually what allot of bug 24850 is about.. rather than converting to UTC however, it converts to 'local server' (as set in the config) time to whatever time (with offset or $timezone attached) timezone and back again. I'd love some input on that one.. it was a pain to write and thus far I don't think the reviewers have really got the point.. but you've just succinctly stated the exact point in your above comment. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Martin Renvoize from comment #4)
That's actually what allot of bug 24850 is about.. rather than converting to UTC however, it converts to 'local server' (as set in the config) time to whatever time (with offset or $timezone attached) timezone and back again.
Actually, Ere corrects my thinking about timestamps and UTC at https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27463#c10. I think my brain was stuck in PostgreSQL mode.
I'd love some input on that one.. it was a pain to write and thus far I don't think the reviewers have really got the point.. but you've just succinctly stated the exact point in your above comment.
I'll take another look. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Martin Renvoize from comment #4)
I'd love some input on that one.. it was a pain to write and thus far I don't think the reviewers have really got the point.. but you've just succinctly stated the exact point in your above comment.
I've added input and hopefully it's well-received. Know that I think you are awesome and my input is intended as being constructive. I also signed off so forgive me my remarks based on that at least ;). -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27573 Bug 27573 depends on bug 27511, which changed state. Bug 27511 Summary: Don't use NOW() in saved sql last run update https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27511 What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |RESOLVED Resolution|--- |INVALID -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org