Support » Plugin: Yoast SEO » MySQL 8 compatiblity issue

  • Resolved jkohlbach

    (@jkohlbach)


    Hi team,

    In wp-content/plugins/wordpress-seo/admin/filters/class-cornerstone-filter.php you have a function get_post_total

    This function has an problem with the SQL syntax, you’re using double quotes on the meta_value = “1” when it should be single quotes like meta_value = ‘1’

    In SQL syntax, it is standard to use single quotes for string literals. Normally (and especially in < version 8) MySQL is configured to interpret double quotes as single quotes in these cases.

    However, in MySQL 8 a common configuration is to set sql_mode=ANSI_QUOTES which means that double quotes are not interpreted that way and this will cause an error on the All Pages screen like:

    SELECT COUNT( 1 ) FROM wp_postmeta WHERE post_id IN( SELECT ID FROM wp_posts WHERE post_type = 'page' ) && meta_value = "1" AND meta_key = '_yoast_wpseo_is_cornerstone'

    Screenshot: https://snipboard.io/yZJRic.jpg

    Would appreciate a fix on the next patch if possible. It’s a very simple fix and means you’ll be (from what I can tell) MySQL 8 compatible.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘MySQL 8 compatiblity issue’ is closed to new replies.