Repository navigation
Conversation
If an update stops in the middle of sql/updates/2.0.0.sql - converting a
large failed login table to utf8mb4 can take longer than a request may -
the schema version stays at 1.4.3 and the next attempt runs the file from
the start. Its first statement, ADD COLUMN attempts, then fails ("Duplicate
column name"), so every further attempt stopped there too and the site
could not be updated any more.
The ADD COLUMN and ADD INDEX statements, which MySQL can't make conditional,
are marked CAN FAIL (supported by Joomla's installer since 4.2); everything
else in the file already works on tables it changed before. A unit test
checks that every non-repeatable statement in the update files from 2.0.0
on is marked, and an integration test runs the update through Joomla's
installer on tables which already have all its changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFJFMMUpch4LGexEiXN8Nc
This was referenced Nov 4, 2026
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.
Stack 3/4 for the 2.0.0 release (#250), based on #252. Review only the top commit.
Problem
If an update stops in the middle of
sql/updates/2.0.0.sql, the schema version stays at 1.4.3. A likely cause is that converting a largefailedlogintable to utf8mb4 takes longer than the request is allowed to run; that table was never purged by default before 2.0. The next attempt then runs the file again from the start, and its first statement,ADD COLUMN attempts, fails with "Duplicate column name". Every further attempt stops at the same place, so the site can't be updated any more.Change
The
ADD COLUMNandADD INDEXstatements, which MySQL can't make conditional, are marked/** CAN FAIL **/. Joomla's installer has supported this marker since 4.2 (Installer::parseSchemaUpdates()) and carries on if such a statement fails. The other statements already work on tables they changed before:CONVERT TO,CREATE TABLE IF NOT EXISTS, andINSERT … ON DUPLICATE KEY. A comment at the top of the file explains the rule.Tests
tests/Unit/UpdateSqlTest.php: in every update file from 2.0.0 on, each statement that can't run twice (ADD/DROP/RENAME of columns, indexes or keys) carries the marker, placed where Joomla looks for it, and eachCREATE TABLEhasIF NOT EXISTS. This also guards later update files.tests/Integration/UpdateSqlTest.php: sets the plugin's schema version back to 1.4.3, runs the update through Joomla's ownInstaller::parseSchemaUpdates()on tables that already have every change, then checks that it succeeds and records the new version. It is skipped on PostgreSQL, which has no update SQL yet.Both fail without the markers and pass with them. The full suite passes locally on Joomla 5.4.10 with MySQL 8.4 and PostgreSQL 16. Still open: a real upgrade of a large 1.5.2 site with a timeout (H1/H2 in #250).
🤖 Generated with Claude Code
https://claude.ai/code/session_01AFJFMMUpch4LGexEiXN8Nc