New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zp_images table is too wide for InnoDB strict mode #1273
Comments
We heard about this issue before but rarely. Did you try to use the database backup tool included? It does not backup the database itself but the contents so may workaround this somehow. Note that these fields are optionally and (and not all might have contents even if) its usage can be disabled on the options. We could change the fields to text/blob probably but as far as I know this might cause performance issues with that many columns as these data types are a bit "outside" and their content needs to temporarily copied to a temp table internally. The long term plan is to move (image) item meta data to its own separate table. Since this is quite a change it will not be for 1.x. |
No, I used mysqldump, not the internal tool.
I think this is my workaround is fine, I don't have any videos so these columns are empty and don't hit the row limit.
This sounds fine 👍 |
Yes, your workaround was probably fine. Thanks for the feedback! |
Actually, I fiddled around with it a bit more, and I think it might be because I missed at least one of the point upgrades. I altered some of the database columns to be text to get rid of the error, and reran setup. Now my database looks like
I suddenly have a lot of mediumtext and varchar columns compared to the initial database, and the new lastchange, lastchangeuser, and IPTCKeywords columns. The I restored the database and files from my backup, and retried the setup. Then I altered the columns and reran setup. The successful setup has a lot more checkmarks. Looking at the upgrade code I can't figure out why it wouldn't raise a failure message. |
I don't remember offhand exactly when the lastchange column was added to all tables (articles and pages had it for longer already) but surely some 1.5.x release. I assume you looked in all error logs incl. the mysql one fro failed queries? From what version did you upgrade? And yes, we did raised the size of some columns because they were too small for usages quite some time back. |
Based on https://github.com/zenphoto/zenphoto/blob/master/zp-core/setup/index.php#L2418, I think it was added in v1.5.2 I upgraded from 1.5.0 to 1.5.7 |
Thanks for searching for it. No idea why it then was missing. Setup actually still goes through everything to not miss anything. |
I'm restoring a database export to a standard AWS RDS instance. The restore fails with
The actual error is in the database logs:
The maximum row size is determined by the innodb page size: https://dev.mysql.com/doc/mysql-reslimits-excerpt/8.0/en/column-count-limit.html#row-size-limits
There's a lot of columns in the table, this is the truncated output of
describe zp_images;
:MariaDB has a few fixes, mainly either make the columns 256 bytes or longer, or split the table into separate tables (eg shunt the video metadata off to another table).
The workaround I used was to prepend the mysqldump file with
SET SESSION innodb_strict_mode=OFF;
, which allowed the import to continue with warnings.This isn't exactly safe for everyone, since adding rows could fail in the future:
The text was updated successfully, but these errors were encountered: