Closed over-engineer closed 1 month ago
Specified key was too long; max key length is 1000 bytes
I managed to reproduce this issue by using MariaDB 10.3.39
with the MyISAM
storage engine.
It appears that updating the CREATE TABLE
query to use more sensible values for its VARCHAR
columns has fixed the issue.
Column | Previous value | New value |
---|---|---|
id |
255 |
40 |
geo_location |
255 |
8 |
ip_address |
255 |
40 |
We’ve included this fix in the recent 1.5.1
release.
Closing as resolved.
Initially reported by @radovand on the WordPress.org support forum.
In a particular configuration, consent records were not being stored at all.
@radovand provided the following logs:
The key point is:
So, our custom
pressidium_cookie_consents
table was not created at all.MyISAM
tables have a maximum key length of 1000 bytes, which suggests that this configuration might be using theMyISAM
storage engine instead ofInnoDB
.We’ll most likely be able to fix that by adjusting our
VARCHAR
columns to use more sensible values, instead of blindly usingVARCHAR(255)
Adding database-specific information in the “Logs” tab could also be helpful.