processwire-issues icon indicating copy to clipboard operation
processwire-issues copied to clipboard

Prevent long field names that clash with MySQL maximum length of table names?

Open jlahijani opened this issue 1 year ago • 0 comments

MySQL has a limit of 64 characters for table names.

Not sure if this is necessarily a bug, but something I experienced that I think ProcessWire should handle.

If I make a new field with this name it's valid:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

But if rename that field and add one more x, like this:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

... then I get the following error when saving the field because it's over 64 characters:

ProcessField: SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name 'tmp_field_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

jlahijani avatar Sep 04 '24 15:09 jlahijani