• Resolved bigheadzach

    (@bigheadzach)


    I know there’s mention of resolving a key alteration on the _ewwwio_images table awhile back related to MariaDB, but I’m getting this error on the _ewwwio_queue table after an update:

    WordPress database error Incorrect table definition; there can be only one auto column and it must be defined as a key for query ALTER TABLE wp_ewwwio_queue ADD COLUMN id int unsigned NOT NULL AUTO_INCREMENT made by require_once(‘wp-admin/admin.php’), do_action(‘admin_init’), WP_Hook->do_action, WP_Hook->apply_filters, ewww_image_optimizer_admin_init, ewww_image_optimizer_upgrade, ewww_image_optimizer_install_table, dbDelta\

    I can definitely see that on a new installation this table is created according to this schema, but I’m also miffed that the ewww_image_optimizer_install_table() function isn’t calling ALTER TABLE on the queue table here (though it is calling CREATE TABLE, so I’m guessing this gets converted automatically into an ALTER somehow by some DB servers).

    Since I can’t the above field in actual use by any query, is the error safe to ignore? Or can I rectify the table manually by removing the existing index, adding the field, and correcting the primary key?

    • This topic was modified 3 years, 10 months ago by bigheadzach.
    • This topic was modified 3 years, 10 months ago by bigheadzach.
    • This topic was modified 3 years, 10 months ago by bigheadzach.
Viewing 1 replies (of 1 total)
  • Plugin Author Shane Bishop

    (@nosilver4u)

    Hmm, that’s certainly strange that it should be attempting to “add” the id column, since it’s been around quite a while. The main things to ensure would be that the (id) column is set as a PRIMARY index, and that the auto-increment option is set.

    Otherwise, you can safely ignore it.

    FYI, the “conversion” is done by the WP core dbDelta() function, which compares the existing table structure to that of the CREATE statement. If the table doesn’t exist, it just uses the statement as-is. Otherwise, it issues the necessary ALTER statements to make the table match the CREATE statement.

    As you may have noticed, we have a bunch of workarounds within the install_table() function, some of which are due to shortcomings in the dbDelta() function itself, but most of those are for quirks in varying db versions and variants of utf8.

Viewing 1 replies (of 1 total)

The topic ‘Altering queue table with new ID key?’ is closed to new replies.