Skip to content

Schema: widen the user name columns on servers upgraded from 1.5 - #2005

Merged
fog-workflows[bot] merged 1 commit into
working-1.6from
fix/users-name-width-after-15
Oct 28, 2026
Merged

fog-workflows[bot] merged 1 commit into
working-1.6from
fix/users-name-width-after-15

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Problem

On a server upgraded from 1.5, users.uName and users.uCreateBy stay VARCHAR(40) NOT NULL. A fresh 1.6 install has VARCHAR(255) NULL. A user name longer than 40 characters, such as an LDAP or OIDC login that is a full email address, does not fit. Found in #2000.

Cause

Step 279 does the widening. A 1.5.x server carries a schema count past 279 (1.5.10.2518 is at 288), so the updater skips it. SchemaReconciler adds missing tables and columns, but it never retypes a column that exists.

Fix

Step 446 repeats step 279's ALTER, and FOG_SCHEMA goes to 446. On a server that already ran 279, the statement changes nothing.

Why no value is lost

The change only makes the limit larger. Every stored value already fits in 40 characters, so the server copies it unchanged. Removing NOT NULL changes no stored value either. The UNIQUE KEY name index stays, and at 255 characters in utf8mb3 it is 765 bytes, which is inside InnoDB's 767-byte limit.

Tests

  • A 1.5-shaped users table holding a 3-character name, a 40-character name and a non-ASCII name was widened on mariadb:10.5 and mysql:8.0. Every row's MD5(uName) is the same before and after. A 72-character name inserts under STRICT_TRANS_TABLES afterwards. The final columns match the manifest: varchar(255) DEFAULT NULL with the unique key.
  • tests/schema-gate.test.php: FOG_SCHEMA 446 covers the highest step (446).
  • No route change, so OpenAPI::document() is not affected.

Refs #2000

🤖 Generated with Claude Code

Step 279 widens users.uName and users.uCreateBy from 1.5's
VARCHAR(40) NOT NULL to VARCHAR(255) NULL. A 1.5.x server arrives with a
count past 279 and skips it, and SchemaReconciler never retypes an existing
column. So an upgraded server kept a 40-character user name, where a fresh
install allows 255.

Step 446 repeats the ALTER. Widening keeps every stored value, and on a
server that already ran 279 it changes nothing.

Refs #2000

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fog-workflows
fog-workflows Bot enabled auto-merge October 28, 2026 18:30
@fog-workflows
fog-workflows Bot added this pull request to the merge queue Oct 28, 2026
Merged via the queue into working-1.6 with commit 78905e3 Oct 28, 2026
11 checks passed
@fog-workflows
fog-workflows Bot deleted the fix/users-name-width-after-15 branch October 28, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant