• Resolved mdxclr

    (@mdxclr)


    Hi,
    in the latest versions I’m getting

    WordPress database error: [Specified key was too long; max key length is 1000 bytes]
    ALTER TABLE wp_wrc_relations CHANGE COLUMN 'object_id' 'object_id' VARCHAR(255) NOT NULL

    updating DB from 5.6 to 5.7 fixing that problem, but I’m already getting that error on the 3rd server, its not comfortable.
    Is there some way to more easiest fix?

    • This topic was modified 5 years, 3 months ago by mdxclr.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @mdxclr

    Thank you for using our plugin and for bringing this to our attention.

    We were using a different collation on our test environment, which didn’t throw this error. I now changed it and was able to reproduce your error. We will fix this in our upcoming release.

    For now, if you don’t want to wait until our next release you could change the file /wp-content/plugins/wp-rest-cache/includes/caching/class-caching.php and on lines 1186 and 1187 change the VARCHAR(xxx) to VARCHAR(191).

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @mdxclr

    We just released a new version of our plugin which solves this error.

    engdahl

    (@engdahl)

    Hello @rockfire!

    I’m getting the same error as mdxlcr above. Running on version 2020.1.0. Strange thing is it was working fine yesterday but today when I woke up to continue work I cant access the REST api at all due to this error throwing a 500. Please advise on how I can fix this.

    [06-Mar-2020 11:56:14 UTC] WordPress database error Specified key was too long; max key length is 1000 bytes for query CREATE TABLEpbd_wrc_relations (
    cache_id BIGINT(20) NOT NULL,
    object_id VARCHAR(191) NOT NULL,
    object_type VARCHAR(191) NOT NULL,
    PRIMARY KEY (cache_id, object_id),
    INDEX cache_id (cache_id),
    INDEX object (object_id, object_type)
    ) made by include(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook->apply_filters, WP_Rest_Cache_Plugin\Includes\Caching\Caching->update_database_structure, dbDelta

    • This reply was modified 5 years ago by engdahl.
    • This reply was modified 5 years ago by engdahl.
    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @engdahl

    Thank you for using our plugin!

    We just released a new version of our plugin which should solve your problem.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Specified key was too long; max key length is 1000 bytes]’ is closed to new replies.