Bug
Migration 13 (from #4456) fails on MySQL >= 8.0.2 because groups is a reserved word since that version.
failed to initialize storage: failed to perform migrations: migration 13 statement 2 failed:
Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'groups blob' at line 2
The column name needs backtick-quoting in the MySQL-flavored migration statements in storage/sql/migrate.go:
-- current (fails on MySQL >= 8.0.2)
alter table password add column groups bytea;
update password set groups = '[]' where groups is null;
alter table password modify column groups bytea not null;
-- fix
alter table password add column `groups` bytea;
update password set `groups` = '[]' where `groups` is null;
alter table password modify column `groups` bytea not null;
Additionally, since MySQL auto-commits DDL, statement 1 (preferred_username) gets persisted even when statement 2 fails and the transaction rolls back. This leaves the migration in an unrecoverable half-applied state on restart.
Happy to submit a PR for this if wanted.
Bug
Migration 13 (from #4456) fails on MySQL >= 8.0.2 because
groupsis a reserved word since that version.The column name needs backtick-quoting in the MySQL-flavored migration statements in
storage/sql/migrate.go:Additionally, since MySQL auto-commits DDL, statement 1 (
preferred_username) gets persisted even when statement 2 fails and the transaction rolls back. This leaves the migration in an unrecoverable half-applied state on restart.Happy to submit a PR for this if wanted.