Skip to content

fix: incorrect index declaration - #35

Closed
suyuan32 wants to merge 1 commit into
apache:masterfrom
suyuan32:master
Closed

fix: incorrect index declaration#35
suyuan32 wants to merge 1 commit into
apache:masterfrom
suyuan32:master

Conversation

@suyuan32

@suyuan32 suyuan32 commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@hsluoyz hsluoyz closed this Aug 6, 2026
@hsluoyz hsluoyz reopened this Aug 6, 2026
@hsluoyz

hsluoyz commented Aug 6, 2026

Copy link
Copy Markdown
Member

Thanks for catching this — the declaration really was dead code, and the
generated schema confirmed the index had never existed.

I've landed the fix in ec45d2b rather than merging
this PR, because the rename alone doesn't hold up on MySQL: seven utf8mb4
varchar(255) columns need 7140 bytes of index key against InnoDB's 3072-byte
limit, which is the Error 1071 the CI run here hit. That commit narrows the
policy columns to varchar(100) (matching casbin's canonical schema and
gorm-adapter), and makes inserts ignore conflicts so that re-adding an
already-stored rule stays a no-op instead of becoming an error for replicas
whose in-memory model has fallen behind. The README now documents the
duplicate-row and over-long-value checks needed before upgrading an existing
database.

Closing in favour of that commit — but the diagnosis was yours, and it was a
good catch.

@hsluoyz hsluoyz closed this Aug 6, 2026
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.

2 participants