Skip to content

Fix: table rename aborts when GenericObject migration exceeds MySQL's…#1185

Open
Rom1-B wants to merge 2 commits intomainfrom
support_43610
Open

Fix: table rename aborts when GenericObject migration exceeds MySQL's…#1185
Rom1-B wants to merge 2 commits intomainfrom
support_43610

Conversation

@Rom1-B
Copy link
Copy Markdown
Contributor

@Rom1-B Rom1-B commented Apr 22, 2026

… 64-char limit

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes !43610

When migrating containers from GenericObject to GlpiCustomAsset, the plugin renames the underlying DB table. For certain object names, the new name exceeds MySQL's 64-character identifier limit, aborting the
migration with error 1059.

A naive table name truncation would not suffice: GLPI derives table names from class names at runtime, so the stored container name and the DB table must stay in sync. The fix truncates the container name until
the generated table fits within 64 chars, then persists the shortened name to the DB — mirroring an identical safeguard already present in installUserData.

Screenshots (if appropriate):

@Rom1-B Rom1-B requested a review from stonebuzz April 22, 2026 14:22
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