[Bug 44319] New: DB revisions using Koha::Reports fail with Unknown column me.run_type on upgrade
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44319 Bug ID: 44319 Summary: DB revisions using Koha::Reports fail with Unknown column me.run_type on upgrade Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Upgrading a database created before 26.06 fails in updatedatabase.pl with: ERROR: DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.run_type' in 'SELECT' The database revisions 240600054.pl (Bug 35570) and 250600011.pl (Bug 37901) use Koha::Reports->search to list saved reports that need manual attention. DBIC selects every column of the current schema, which includes saved_sql.run_type, added much later by 260600047.pl (Bug 42108). Atomic updates must not depend on the live DBIC schema. This breaks the DB upgrade CI job (Koha_Main_MariaDB_update, compare against v24.05.00). Test plan: 1. Load installer/data/mysql/kohastructure.sql from tag v24.05.00 into an empty database and set systempreferences.version to 24.0500000. Add a saved report whose SQL mentions FreeForm and pseudonymized_borrower_attributes (Reports > Create from SQL). 2. Run installer/data/mysql/updatedatabase.pl 3. Before the patch: it stops at 24.06.00.054 and then at 25.06.00.011 with "Unknown column 'me.run_type'". 4. After the patch: the upgrade completes, the ACTION REQUIRED warnings list the report, and the final version is the current one. -- 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=44319 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 212758 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212758&action=edit Bug 44319: Do not use Koha::Reports in old database revisions db_revs/240600054.pl (Bug 35570) and db_revs/250600011.pl (Bug 37901) use Koha::Reports->search to list saved reports needing manual attention. DBIC selects every column of the *current* schema, which now includes saved_sql.run_type (added by 260600047.pl, Bug 42108). When upgrading from a version older than that column, the query fails: ERROR: DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.run_type' in 'SELECT' and updatedatabase.pl aborts. This breaks the "compare against v24.05.00" DB upgrade CI job (Koha_Main_MariaDB_update). Atomic updates must not depend on the live DBIC schema. Use a plain SELECT id FROM saved_sql instead. Test plan: 1. Load installer/data/mysql/kohastructure.sql from tag v24.05.00 into an empty database and set systempreferences.version to 24.0500000. Add a saved_sql row whose SQL mentions FreeForm and pseudonymized_borrower_attributes. 2. Run installer/data/mysql/updatedatabase.pl 3. Without the patch: it stops at 24.06.00.054 (then 25.06.00.011) with "Unknown column 'me.run_type'". 4. With the patch: the upgrade completes, the ACTION REQUIRED warnings list the report, and the version ends at the current one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- 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=44319 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- 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=44319 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44319 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|Main |25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44319 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com, | |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44319 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44319 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212758|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=44319 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 212762 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212762&action=edit Bug 44319: Do not use Koha::Reports in old database revisions db_revs/240600054.pl (Bug 35570) and db_revs/250600011.pl (Bug 37901) use Koha::Reports->search to list saved reports needing manual attention. DBIC selects every column of the *current* schema, which now includes saved_sql.run_type (added by 260600047.pl, Bug 42108). When upgrading from a version older than that column, the query fails: ERROR: DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.run_type' in 'SELECT' and updatedatabase.pl aborts. This breaks the "compare against v24.05.00" DB upgrade CI job (Koha_Main_MariaDB_update). Atomic updates must not depend on the live DBIC schema. Use a plain SELECT id FROM saved_sql instead. Test plan: 1. Load installer/data/mysql/kohastructure.sql from tag v24.05.00 into an empty database and set systempreferences.version to 24.0500000. Add a saved_sql row whose SQL mentions FreeForm and pseudonymized_borrower_attributes. 2. Run installer/data/mysql/updatedatabase.pl 3. Without the patch: it stops at 24.06.00.054 (then 25.06.00.011) with "Unknown column 'me.run_type'". 4. With the patch: the upgrade completes, the ACTION REQUIRED warnings list the report, and the version ends at the current one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44319 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- db-compare is still failing though. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44319 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org