Bug 26997: Fix upgrade process under MySQL 8
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Nov 2020 13:22:50 +0000 (14:22 +0100)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Thu, 18 Mar 2021 20:02:41 +0000 (21:02 +0100)
commit7e3bf82654d85e9bed1ff45a201dd2b9e54c2e4f
tree062672c2c5ddfb992e11b47253e58f5a10ebfca4
parent5bc7e65a04e4bbaff0fc17d57fc030e2dba9e695
Bug 26997: Fix upgrade process under MySQL 8

If you are coming from an old version of Koha, you may face an upgrade
error for the SQL query using 0000-00-00.
The idea was to fix it, but actually the DBMS will raise an error (not
blocking the upgrade process however).

We can hide them to not cause confusion

Errors are like:
DBD::mysql::db do failed: Incorrect date value: '0000-00-00' for column 'suggesteddate' at row 1 [for Statement "UPDATE suggestions SET suggesteddate = '1970-01-01' WHERE suggesteddate = '0000-00-00';"] at /kohadevbox/koha/installer/data/mysql/updatedatabase.pl line 23312.

Test plan:
Checkout an old version of Koha (3.20, not older)
Insert a dump, install Koha
Checkout a recent version of Koha, apply the patch (or use master)
Execute the upgrade process
You should not see the errors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3c087bc216eeab8fe0d68a2d33407b554bc57074)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit da58f3e2c541bb617ba3ec5ef58d5cf1792caeb7)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit c720acc3c915b5c493edd66a65e5519a40e5486b)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
installer/data/mysql/updatedatabase.pl