Repository navigation
[rc-1.6.0] Schema: repair lossless type drift, and gate a real 1.5 upgrade - #2008
Merged
Merged
Conversation
A 1.5 server's schema count lands on a different 1.6 step whenever 1.5 adds one, and the updater skips every 1.6 step below it. plan() puts back the tables and columns those steps created, but a step that changed an existing column's type was lost, and only shapeDrift() reported it. That is how users.uName kept 1.5's varchar(40) (GH-2000). repairShape() now applies the drift that cannot lose data: a longer varchar/char/varbinary/binary, a wider integer of the same signedness, and NOT NULL -> NULL. The MODIFY keeps the live column's charset, collation and AUTO_INCREMENT. Everything else stays report-only. It runs before the foreign keys, since a widened child is what lets one land. tests/upgrade-from-15-ci.test.sh installs the schema with 1.5's own updater (from origin/stable by default), upgrades with this tree's real updater, both served by Apache in a php:7.4 container, and fails on an update error, a short version, shape drift, or a lost AUTO_INCREMENT. Without a database it skips. It fails on each of the three defects found today: the pre-#2001 tree at step 290, this repair without AUTO_INCREMENT at step 419, and the tree without this repair on the two users columns. Refs #2000 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Port of #2007 to
rc-1.6.0, with its regenerated catalog commit. Both cherry-picks applied cleanly.On this branch,
tests/schema-reconciler-lossless-repair.test.phppasses 20 of 20.tests/upgrade-from-15-ci.test.shpasses fromstable(c97e205): schema 446, no drift, and everyAUTO_INCREMENTintact.Refs #2000
🤖 Generated with Claude Code