Bug 23579 - error during web install: 'changed_fields' can't have a default value
Summary: error during web install: 'changed_fields' can't have a default value
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: Main
Hardware: PC Linux
: P5 - low blocker (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 24005 (view as bug list)
Depends on: 23151
Blocks: 25086
  Show dependency treegraph
 
Reported: 2019-09-10 13:58 UTC by Alvaro Hernan Gomez Cardozo
Modified: 2021-06-14 21:31 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.05


Attachments
Bug 23579: Remove default value for MEDIUMTEXT borrower_modifications.changed_fields (1.46 KB, patch)
2019-10-25 08:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23579: Remove default value for MEDIUMTEXT borrower_modifications.changed_fields (1.52 KB, patch)
2019-10-25 08:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 23579: (RM follow-up) Fix failing tests (2.10 KB, patch)
2019-10-25 12:13 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alvaro Hernan Gomez Cardozo 2019-09-10 13:58:58 UTC
during web installing, I found this error:

install.pl: DBD::mysql::st execute failed: BLOB, TEXT, GEOMETRY or JSON column 'changed_fields' can't have a default value at /usr/local/share/perl5/DBIx/RunSQL.pm line 273.

I fixed it modifying kohastructure.sql, changing borrower_modifications structure (remove default value of changed_fields)
There is another solution?

I'm use xubuntu 18.04LTS and mysql (Ver 14.14 Distrib 5.7.27, for Linux (x86_64) using  EditLine wrapper)
Comment 1 Cindy Murdock Ames 2019-10-22 19:48:47 UTC
Just chiming in to say this affected me too, and seemed to prevent the database creation from being completed.  Fixed it by the same method, removing " DEFAULT ''" from line 3398 of kohastructure.sql.

This was a fresh package install of 19.05.04 on Ubuntu Server Edition 18.04.3, with mysql-server 5.7.27-0ubuntu0.18.04.1.
Comment 2 Katrin Fischer 2019-10-24 18:39:09 UTC
This prevents installation of oldstable (see IRC from around this time). Upping severity.
Comment 3 Ailton M. Duarte 2019-10-24 19:04:19 UTC
where i will find this kohastructure.sql
Comment 4 Jonathan Druart 2019-10-25 08:18:55 UTC
Created attachment 94716 [details] [review]
Bug 23579: Remove default value for MEDIUMTEXT borrower_modifications.changed_fields

Installation under Ubuntu 18.04 is blocked:
install.pl: DBD::mysql::st execute failed: BLOB, TEXT, GEOMETRY or JSON
column 'changed_fields' can't have a default value at
/usr/local/share/perl5/DBIx/RunSQL.pm line 273.

https://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html
"""
 The BLOB, TEXT, GEOMETRY, and JSON data types cannot be assigned a
 default value.
"""
Comment 5 Jonathan Druart 2019-10-25 08:21:51 UTC
I do not recreate using 10.3.17-MariaDB, and I would have expected our CI to catch it (maybe it does not impact MariaDB, yet).
Comment 6 Martin Renvoize 2019-10-25 08:53:36 UTC
Created attachment 94718 [details] [review]
Bug 23579: Remove default value for MEDIUMTEXT borrower_modifications.changed_fields

Installation under Ubuntu 18.04 is blocked:
install.pl: DBD::mysql::st execute failed: BLOB, TEXT, GEOMETRY or JSON
column 'changed_fields' can't have a default value at
/usr/local/share/perl5/DBIx/RunSQL.pm line 273.

https://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html
"""
 The BLOB, TEXT, GEOMETRY, and JSON data types cannot be assigned a
 default value.
"""

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2019-10-25 08:55:20 UTC
Trival patch to stop a blocker.. going straight for QA on this one.

Must admit, I've never understood why we have "DEFAULT ''" anyway.. surely if it's "NOT NULL" then an empty string is also a bad idea.. we are expecting real data in there and as such should throw db errors if were not putting proper valid data in.
Comment 8 Martin Renvoize 2019-10-25 09:46:59 UTC
Nice work!

Pushed to master for 19.11.00
Comment 9 Martin Renvoize 2019-10-25 12:13:55 UTC
Created attachment 94747 [details] [review]
Bug 23579: (RM follow-up) Fix failing tests

Removing the default on changed_fields leads to the requirement for
tests to specify data to add to said field when mocking data.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Fridolin Somers 2019-11-08 15:22:21 UTC
Pushed to 19.05.x for 19.05.05
Comment 11 Jonathan Druart 2019-11-19 09:59:48 UTC
*** Bug 24005 has been marked as a duplicate of this bug. ***