[Bug 35338] New: Error in SQL syntax when upgrading to 22.06.00.084
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35338 Bug ID: 35338 Summary: Error in SQL syntax when upgrading to 22.06.00.084 Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org I have done a few upgrades to 22.11.x and 23.05.x now, but I have not seen this error before: Upgrade to 22.06.00.084 [21:21:43]: Bug 31162 - Add primary key to erm_eholdings_packages_agreements ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CONSTRAINT erm_eholdings_packages_agreements_uniq, ADD PRIMARY K' at line 3 at /usr/share/koha/lib/C4/Installer.pm line 741 I can find that constraint in two places: * 220600079.pl: unless ( TableExists('erm_eholdings_packages_agreements') ) { $dbh->do(q{ CREATE TABLE `erm_eholdings_packages_agreements` ( `package_id` INT(11) NOT NULL COMMENT 'link to the package', `agreement_id` INT(11) NOT NULL COMMENT 'link to the agreement', UNIQUE KEY `erm_eholdings_packages_agreements_uniq` (`package_id`, `agreement_id`), CONSTRAINT `erm_eholdings_packages_agreements_ibfk_1` FOREIGN KEY (`package_id`) REFERENCES `erm_eholdings_packages` (`package_id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `erm_eholdings_packages_agreements_ibfk_2` FOREIGN KEY (`agreement_id`) REFERENCES `erm_agreements` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; }); say $out "Added new table 'erm_eholdings_packages_agreements'"; } * 220600084.pl: unless ( primary_key_exists('erm_eholdings_packages_agreements') ){ $dbh->do(q{ ALTER TABLE erm_eholdings_packages_agreements DROP FOREIGN KEY erm_eholdings_packages_agreements_ibfk_1, DROP FOREIGN KEY erm_eholdings_packages_agreements_ibfk_2, DROP CONSTRAINT erm_eholdings_packages_agreements_uniq, ADD PRIMARY KEY(`package_id`, `agreement_id`) }); $dbh->do(q{ ALTER TABLE erm_eholdings_packages_agreements ADD CONSTRAINT `erm_eholdings_packages_agreements_ibfk_1` FOREIGN KEY (`package_id`) REFERENCES `erm_eholdings_packages` (`package_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `erm_eholdings_packages_agreements_ibfk_2` FOREIGN KEY (`agreement_id`) REFERENCES `erm_agreements` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE }); } Database version: MariaDB 5.7.34-0ubuntu0.18.04.1-log OS: Distributor ID: Ubuntu Description: Ubuntu 20.04.6 LTS Release: 20.04 Codename: focal -- 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=35338 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |RM_priority -- 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=35338 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |32162 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32162 [Bug 32162] erm_eholdings_packages_agreements does not have a primary key -- 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=35338 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> ---
From bug 32162
(In reply to Nick Clemens from comment #9)
(In reply to Jonathan Druart from comment #8)
What's the version of the DBMS, Nick?
Server version: 5.7.12 MySQL Community Server (GPL)
If this is a MySQL 5.7 thing, are we still supporting it? See also bug 29805. -- 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=35338 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #1)
From bug 32162
(In reply to Nick Clemens from comment #9)
(In reply to Jonathan Druart from comment #8)
What's the version of the DBMS, Nick?
Server version: 5.7.12 MySQL Community Server (GPL)
If this is a MySQL 5.7 thing, are we still supporting it?
See also bug 29805.
22.06... is an update to 22.11. 22.11 as the LTS is still maintained and will be for a while. We list these OS as supported on the requirements page in the wiki: * Debian 12 * Debian 11 * Debian 10 * Ubuntu 22.04 * Ubuntu 20.04 So if 5.7 is in 20.04... we are still supporting it I guess? -- 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=35338 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu --- Comment #3 from Michaela Sieber <michaela.sieber@kit.edu> --- @Magnus: is this still valid? Do we need the keyword RM_priority here? -- 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=35338 --- Comment #4 from Magnus Enger <magnus@libriotech.no> --- Since it seems no one else had this problem, I am tempted to think it was a local thing and just close it? -- 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=35338 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Keywords|RM_priority | Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org