Skip to content

fix(mysql): quote groups reserved word in query replacer#4580

Merged
nabokihms merged 1 commit into
dexidp:masterfrom
backkem:fix/mysql-groups-reserved-word
Feb 24, 2026
Merged

fix(mysql): quote groups reserved word in query replacer#4580
nabokihms merged 1 commit into
dexidp:masterfrom
backkem:fix/mysql-groups-reserved-word

Conversation

@backkem
Copy link
Copy Markdown
Contributor

@backkem backkem commented Feb 24, 2026

Fixes #4579

groups is a reserved word in MySQL >= 8.0.2. Migration 13 (from #4456) fails with:

migration 13 statement 2 failed: Error 1064 (42000): ... right syntax to use near 'groups blob'

Additionally, since MySQL auto-commits DDL, statement 1 (preferred_username) is persisted
despite the transaction rollback, leaving the migration in an unrecoverable state on restart.

Fix

Add groups to the existing reserved word quoting regex in flavorMySQL.queryReplacers,
alongside keys which is already handled.

Recovery

Users stuck with a half-applied migration 13 need to drop the orphaned column before restarting:

ALTER TABLE password DROP COLUMN preferred_username;

`groups` is a reserved word in MySQL >= 8.0.2, causing migration 13
to fail with a syntax error on `ALTER TABLE password ADD COLUMN groups`.

Fixes dexidp#4579

Signed-off-by: Michiel De Backker <mail@backkem.me>
@backkem backkem force-pushed the fix/mysql-groups-reserved-word branch from 7580396 to 02d27c9 Compare February 24, 2026 12:24
@nabokihms nabokihms added the release-note/bug-fix Release note: Bug Fixes label Feb 24, 2026
@backkem
Copy link
Copy Markdown
Contributor Author

backkem commented Feb 24, 2026

cc @nabokihms . IDK if you're open to cutting a patch release for something like this?

@nabokihms nabokihms merged commit a6962a8 into dexidp:master Feb 24, 2026
9 of 10 checks passed
@backkem backkem deleted the fix/mysql-groups-reserved-word branch February 24, 2026 12:58
@nabokihms
Copy link
Copy Markdown
Member

Thanks, we will wait a little longer for the other bugs and then release a patch.

nabokihms pushed a commit to deckhouse/3p-dex that referenced this pull request Mar 3, 2026
`groups` is a reserved word in MySQL >= 8.0.2, causing migration 13
to fail with a syntax error on `ALTER TABLE password ADD COLUMN groups`.

Fixes dexidp#4579

Signed-off-by: Michiel De Backker <mail@backkem.me>
xtremerui pushed a commit to concourse/dex that referenced this pull request Mar 19, 2026
<!-- Release notes generated using configuration in .github/release.yml at v2.45.x -->

### Bug Fixes 🐛
- Quote `groups` reserved word in query replacer to fix MySQL 8.0+ storage migration (dexidp#4580)
- Update `authproxy` and `oauth` to match CallbackConnector interface (dexidp#4589)

**Full Changelog**: dexidp/dex@v2.45.0...v2.45.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/bug-fix Release note: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2.45.0: MySQL migration 13 fails - groups is a reserved word

2 participants