Mysql – Table column length is fine in MySQL 5.5 and 5.6, but upgrading to 5.7 results in too many columns

myisamMySQLmysql-5.5mysql-5.7upgrade

So I have a CMS that is being upgraded from MySQL 5.5 -> 5.7. One table has a 1000+ columns, but it works fine in 5.5 and 5.6. When reaching 5.7, queries involving this table result in a 1117 error. (all tables in DB are MyISAM).

It works fine in MySQL 5.5 (the related CMS works fine). I upgrade to MySQL 5.6 and everything continues to work fine.

Then when I upgrade to MySQL 5.7(.23), I get an error about too many columns, and even after removing 20+ columns, I still get the error.

What could have changed? I upgraded in order (5.5 -> 5.6 first, tested, then 5.6 -> 5.7)

Is there possibly a setting I'm missing? Does the mysql_upgrade for 5.7 change columns somehow and screws up their limit by adding extra meta data that causes each column to take up more data? I know that column limit is theoretical but I don't know why it works in the previous two versions and not in 5.7.

Any thoughts?

Edit

After removing ~300 columns, the error stops. But this is a show stopper, and I'd really like to know why 5.7 can't handle what 5.5 and 5.6 can, and if it is a configuration issue or something. Thanks for any help.

Best Answer

A guess... See what you get for

SHOW VARIABLES LIKE '%engine%';

This may indicate that you are not really using MyISAM everywhere.

In the future, MyISAM is likely to go away. So, start thinking about how to deal with InnoDB.

TINYTEXT is perhaps always worse than a suitable VARCHAR.

More than a hundred columns in a single table is usually a bad schema design. Think about how your table can be logically broken up.

Don't splay an array across columns.