Bug 38759

Summary: koha-mysql doesn't work with timezone set in koha-conf.xml
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: Command-line UtilitiesAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: clemens.tubach, cornelius.amzar, dcook, lukasz.koszyk, markus.john, michaela.sieber, robin
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38760
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Katrin Fischer 2024-12-20 10:26:46 UTC
When a timezone is set in the koha-conf.xml file, the koha-mysql command doesn't work. This seems to be due to missing quotes around the timezone value.

For the timezone configuration see:
https://wiki.koha-community.org/wiki/Time_Zone_Configuration

If you dump the created connection command, you will see something like:

mysql --host=<host> --user=XXX --password=XXX --init-command=SET time_zone='America/Sao_Paulo' koha_XXX

This will result in an error. Quoting the value for the init-command parameter appears to fix the issue:

mysql --host=<host> --user=XXX --password=XXX --init-command="SET time_zone='America/Sao_Paulo'" koha_XXX
Comment 1 Lukas Koszyk 2025-03-26 13:24:23 UTC
I rewrote the koha-mysql script in Bug 38760.
Could you check if it works with time zones?
Comment 2 David Cook 2025-03-27 03:09:23 UTC
I'm also curious what version this started in, since it works in older stable versions like 23.11.
Comment 3 Michaela Sieber 2025-04-09 10:29:43 UTC
Please see Bug 38760
Comment 4 Katrin Fischer 2025-04-09 10:49:59 UTC
(In reply to David Cook from comment #2)
> I'm also curious what version this started in, since it works in older
> stable versions like 23.11.

It can't have worked unless someone deleted lines - the timezone was not used at all (see the changes Lukasz made)
Comment 5 Katrin Fischer 2025-04-09 10:50:14 UTC

*** This bug has been marked as a duplicate of bug 38760 ***
Comment 6 Katrin Fischer 2025-04-09 10:51:09 UTC
(In reply to Katrin Fischer from comment #4)
> (In reply to David Cook from comment #2)
> > I'm also curious what version this started in, since it works in older
> > stable versions like 23.11.
> 
> It can't have worked unless someone deleted lines - the timezone was not
> used at all (see the changes Lukasz made)

Hm ok, the lines were only moved, but it did not work when we tested.