Repository navigation
Conversation
CREATE INDEX IF NOT EXISTS is not supported by MySQL and breaks the installation (install-check-trunk-8.5). Use addUniqueConstraint() and check for an existing constraint via ilDBAnalyzer instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The nightly installation check on trunk fails since the Questions component has been merged (last green run on 2026-10-27, failing since 2026-10-28), e.g.: https://github.com/ILIAS-eLearning/ILIAS/actions/runs/41098473993/job/124210302027
CREATE INDEX IF NOT EXISTSis MariaDB-only syntax, MySQL does not support it (the workflow runs on MySQL).Why no plain SQL for schema changes: ILIAS officially supports both MySQL (8.4 - 9.7) and MariaDB (11.4 - 12.3), see
docs/configuration/install.md. The two have diverged in their DDL dialects, andCREATE INDEX IF NOT EXISTSis one of these differences. Schema changes in database update steps are therefore abstracted byilDBInterface; the Database README states that "only the following$ilDBmethods may be used, to create, modify and delete tables in the database update script" (createTable(),addPrimaryKey(),addIndex(),addUniqueConstraint(), ...). Besides keeping the statements portable, these methods quote identifiers (relevant here, sinceconditionis a reserved word in MySQL and MariaDB) and apply ILIAS' naming conventions and checks for indices and constraints (_idxsuffix,checkIndexName()).This PR replaces the raw statement in
OverarchingQuestionTables::step_7()withilDBInterface::addUniqueConstraint(), which creates the sameapc_idxwith quoted identifiers. To keep the step repeatable, it first checks for an existing unique constraint on these fields viailDBAnalyzer(passing the DB explicitly instead of relying on the global$DIC, whichuniqueConstraintExists()would do). Installations that already ran the step on MariaDB are not affected.The follow-up error in the same run (
Add new admin node to tree (type=qsts;title=Questions)... Identifier "logging.config" is not defined.) is most likely a consequence of the failed update steps; this has to be confirmed by the next run of the installation check.