[Bug 42301] New: updatedatabase fails on mysql when adding a unique key to a text column (introduced by 35380)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 Bug ID: 42301 Summary: updatedatabase fails on mysql when adding a unique key to a text column (introduced by 35380) Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Installation and upgrade (command-line installer) Assignee: koha-bugs@lists.koha-community.org Reporter: bibliothek@th-wildau.de QA Contact: testopia@bugs.koha-community.org CC: tomascohen@gmail.com The column 'name' is altered to be unique in bug 38530 When using mariadb this works fine but when using mysql as db engine this error is thrown; ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: BLOB/TEXT column 'name' used in key specification without a key length at /kohadevbox/koha/C4/Installer.pm line 818 to recreate: - run ktd with mysql f.e.: DB_IMAGE=mysql:8.0 ktd --proxy --name mysql8 up -d - enter ktd shell ktd --name mysql8 --shell - checkout a Koha version prior to 35380 - reset_all - checkout main - updatedatabase -- 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=42301 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35380 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35380 [Bug 35380] PUT /biblios/:biblio_id doesn't respect overlay rules -- 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=42301 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |major -- 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=42301 --- Comment #1 from Jan Kissig <bibliothek@th-wildau.de> --- easiest would be to fix the problem in installer/data/mysql/db_revs/251200037.pl or is that a bad practice? $dbh->do( + q{ + ALTER TABLE record_sources + ADD UNIQUE KEY name (`name`(191)) + } -- 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=42301 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- If I understand correctly it will throw an error so prevent update if you hit that dbrev? Then I think fixing the dbrev is definitely the right thing to do. -- 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=42301 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |bibliothek@th-wildau.de |ity.org | Patch complexity|--- |String patch -- 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=42301 --- Comment #3 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 197258 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197258&action=edit Bug 42301: Fix error occuring on updatedatabase when using MySQL This patch fixes an error when running updatedatabase on an instance using MySQL by defining a key length for an unique key. The unique key in table record_sources was introduced on 35380 but was lacking a key length which works in mariaDB but fails on MySQL. Test plan: a) run ktd with mysql f.e.: DB_IMAGE=mysql:8.0 ktd --proxy --name mysql8 up -d b) enter ktd shell ktd --name mysql8 --shell c) checkout a Koha version prior to 35380. f.e. "git checkout 67adbce6562fa352b143977747fa290f23c63fde" d) run 'reset_all' e) log in and check Koha version in http://mysql8-intra.localhost/cgi-bin/koha/about.pl which should show 25.12.00.036 f) git checkout main g) restart_all h) updatedatabase will throw the following error: Upgrade to 25.12.00.037 [08:29:14]: Bug 35380 - Add new unique name to record sources, add default record sources, add is_system column to default record sources. ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: BLOB/TEXT column 'name' used in key specification without a key length at /kohadevbox/koha/C4/Installer.pm line 817 i) apply patch j) 'updatedatabase' should run without errors now -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|String patch |Trivial patch Status|Needs Signoff |Signed Off QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197258|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197369 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197369&action=edit Bug 42301: Fix error occuring on updatedatabase when using MySQL This patch fixes an error when running updatedatabase on an instance using MySQL by defining a key length for an unique key. The unique key in table record_sources was introduced on 35380 but was lacking a key length which works in mariaDB but fails on MySQL. Test plan: a) run ktd with mysql f.e.: DB_IMAGE=mysql:8.0 ktd --proxy --name mysql8 up -d b) enter ktd shell ktd --name mysql8 --shell c) checkout a Koha version prior to 35380. f.e. "git checkout 67adbce6562fa352b143977747fa290f23c63fde" d) run 'reset_all' e) log in and check Koha version in http://mysql8-intra.localhost/cgi-bin/koha/about.pl which should show 25.12.00.036 f) git checkout main g) restart_all h) updatedatabase will throw the following error: Upgrade to 25.12.00.037 [08:29:14]: Bug 35380 - Add new unique name to record sources, add default record sources, add is_system column to default record sources. ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: BLOB/TEXT column 'name' used in key specification without a key length at /kohadevbox/koha/C4/Installer.pm line 817 i) apply patch j) 'updatedatabase' should run without errors now Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- This is a solid fix.. It does make me question why this is a 'text' field instead of a 'varchar(191)'.. if it were we wouldn't need the additional index length definition. I don't think it really matters here though to be honest. Anyway, I'm going to fast QA this as I think it's an important one to push ASAP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|35380 | CC| |lucas@bywatersolutions.com Depends on| |35380 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35380 [Bug 35380] PUT /biblios/:biblio_id doesn't respect overlay rules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 --- Comment #6 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|26.05.00 |26.05.00,25.11.05 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 --- Comment #7 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED CC| |fridolin.somers@biblibre.co | |m --- Comment #8 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 35380 not in 25.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42301 Bug 42301 depends on bug 35380, which changed state. Bug 35380 Summary: PUT /biblios/:biblio_id doesn't apply record overlay rules https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35380 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org