Go to file
Jan Kissig f79d2a29eb
Bug 42412: Fix Incorrect date error in db-revs when using MySQL
In Bug 36466 db_revs/251200019.pl was introduced to update wrong date values (0000-00-00) with NULL.
This can fail on MySQL as it is running with sql_mode NO_ZERO_DATE activated which does not allow to select or update date fields with values='0000-00-00'.

This patch changes the update queries in db_revs/251200019.pl to use Installer::sanitize_zero_date on both columns.

Test plan:
As the test shall be done using MysQL and Mariadb start 2 ktds:
MySQL) DB_IMAGE=mysql:8.0 ktd --proxy --name mysql8 up -d
MariaDB) ktd --proxy --name maria up -d

a) checkout a version prior 36466: git checkout v24.11.14-1
b) reset_all
c) Connect to staff interface (mysql8-intra.localhost and maria-intra.localhost)
d) Go to Serials and create a new subscription
e) run the following to enter database client in each ktd shell: koha-mysql kohadev
f-mysql) run the following commands to be allowed to change planneddate and publisheddate to '0000-00-00':
 SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
 update serial set planneddate = '0000-00-00', publisheddate = '0000-00-00';
f-maria)
 update serial set planneddate = '0000-00-00', publisheddate = '0000-00-00';
g) verify via: select * from serial;
h) checkout main via: git checkout main
i-mysql) run  updatedatabase
 Upgrade to 25.12.00.019  [09:35:55]: Bug 36466 - Fix the incorrect 0000-00-00 date in planneddate and publisheddate field
        ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do Incorrect date error in db-revs when using MySQL

        In 36466 db_revs/251200019.pl
        for column 'planneddate' at row 1 at /kohadevbox/koha/C4/Installer.pm line 818
i-maria) do not run updatedatabase yet
j) apply patch
k-mysql) run  updatedatabase
Upgrade to 25.12.00.019  [09:37:02]: Bug 36466 - Fix the incorrect 0000-00-00 date in planneddate and publisheddate field
        Incorrect date planneddate and publisheddate fixed
...
-> is successful now
k-maria) run updatedatabase
l) verify via: select * from serial;

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2026-06-22 13:59:26 +12:00
.github/workflows Bug 40027: Use GitHub workflow to automatically close PRs opened on the Koha repo there 2025-10-23 23:06:52 +02:00
C4 Bug 39164: Add max_statement_time to SQL report queries 2026-06-19 12:47:37 +12:00
Koha Bug 39164: Add max_statement_time to SQL report queries 2026-06-19 12:47:37 +12:00
acqui Bug 41594: [25.05.x] Disable access to invoice-files.pl if AcqEnableFiles disabled 2026-04-21 12:02:52 -06:00
admin Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
api Bug 41594: [25.05.x] Add Cypress tests 2026-04-21 12:02:52 -06:00
authorities Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
basket Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
bin Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
bookings Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
catalogue Bug 34879: Remove unused file from Koha 2026-03-30 18:02:28 -04:00
cataloguing Bug 41989: Call getlanguage after get_template_and_user 2026-05-23 15:58:40 -04:00
circ Bug 41904: "Use of uninitialized value..." warning in del_message.pl 2026-05-23 15:58:43 -04:00
clubs Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
course_reserves Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
debian Bug 39164: (QA follow-up) Add setting to koha conf files 2026-06-19 12:47:43 +12:00
docs Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
erm Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
errors Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
etc Bug 39164: (QA follow-up) Add setting to koha conf files 2026-06-19 12:47:43 +12:00
ill Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
installer Bug 42412: Fix Incorrect date error in db-revs when using MySQL 2026-06-22 13:59:26 +12:00
koha-tmpl Bug 41646: Fix HTML display for self-checkin 2026-06-10 13:27:12 +12:00
labels Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
lib Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
members Bug 41040: Prevent form submission if no filters have been selected 2026-03-30 18:02:25 -04:00
misc Update release notes for the 25.05.11 release 2026-06-05 14:02:41 -06:00
offline_circ Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
opac Bug 41558: Fix and standardize links to tab on opac-user 2026-05-23 15:58:46 -04:00
patron_lists Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
patroncards Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
plugins Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
pos Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
preservation Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
recalls Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
reports Bug 42361: Fix SQL injection in catalogue_out.pl 2026-06-05 14:02:38 -06:00
reserve Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
reviews Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
rotating_collections Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
serials Bug 36466: (follow-up) Use NULL for blank planned and published dates instead of today 2026-03-30 18:02:28 -04:00
services Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
skel
…
suggestion Bug 42071: Add 'show' to options that load a single suggestion 2026-05-23 15:58:41 -04:00
svc Bug 41518: Only show autorenewal text if autorenewal allowed 2026-05-23 15:58:47 -04:00
t Bug 39164: Add max_statement_time to SQL report queries 2026-06-19 12:47:37 +12:00
tags Bug 42254: (QA follow-up) Remove unused var, fixing a FIXME 2026-04-28 15:57:07 -06:00
tools Bug 41614: available options template params also needed for op=list 2026-06-19 13:02:18 +12:00
virtualshelves Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
xt Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
.codespell-ignore Bug 39325: (QA follow-up) Adjust some issues 2025-04-28 18:51:30 +02:00
.editorconfig
…
.git-blame-ignore-revs Bug 39096: Add 'tidy all' commits to a git blame ignore file 2025-02-17 13:10:25 +01:00
.gitignore Bug 40838: Add generated bookings CSS assets to gitignore 2025-09-25 16:22:51 +02:00
.htaccess
…
.mailmap Bug 40041: Remove duplicated or unecessary entries 2025-10-29 10:02:28 +01:00
.perlcriticrc
…
.perltidyrc
…
.prettierrc.js Bug 38664: Treat .vue files like other JS files 2025-02-11 14:58:25 +01:00
.proverc.dist
…
.stylelintrc.json
…
INSTALL
…
Koha.pm Increment version for 25.05.11.000 release 2026-06-05 14:02:41 -06:00
LICENSE Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
MANIFEST.SKIP
…
Makefile.PL Bug 41076: [25.05.x] Adjust perl tidiness 2026-02-24 08:35:34 -07:00
README
…
README.md Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
README.robots
…
SECURITY.md Bug 40527: Initial draft of SECURITY.md 2026-01-05 17:42:04 +00:00
about.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
app.psgi Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
build-resources.PL Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
changelanguage.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
cpanfile Bug 40164: Add Template::Plugin::JSON dependency 2025-07-10 22:47:33 +02:00
cypress.config.ts Bug 40346: Use KOHA_INTRANET_URL for the baseUrl 2025-08-22 09:47:41 +02:00
eslint.config.mjs Bug 38524: Enable ESLint for .ts and .vue files 2025-01-16 15:56:17 +01:00
fix-perl-path.PL Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
gulpfile.js Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
help.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
kohaversion.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
mainpage.pl Bug 40163: Fix several http addresses in the code docs 2026-01-07 14:32:30 +00:00
package.json Bug 36674: (follow-up) Stop emitting Cypress API client source maps 2026-02-17 16:34:56 +00:00
rewrite-config.PL Bug 40163: (follow-up) Fix wrong GNU links and update test 2026-01-07 14:32:37 +00:00
rspack.config.js Bug 36674: (follow-up) Stop emitting Cypress API client source maps 2026-02-17 16:34:56 +00:00
tsconfig.json
…
yarn.lock Bug 40170: Update yarn.lock 2025-07-10 22:47:42 +02:00

README.md

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit https://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

https://koha-community.org/

Koha Logo