{"action":"closed","issue":{"url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/9237","repository_url":"https://api.github.com/repos/Yoast/wordpress-seo","labels_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/9237/labels{/name}","comments_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/9237/comments","events_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/9237/events","html_url":"https://github.com/Yoast/wordpress-seo/issues/9237","id":305406092,"number":9237,"title":"Error when MySQL is set to sql-mode=ANSI_QUOTES","user":{"login":"aehrhardt","id":2049439,"avatar_url":"https://avatars1.githubusercontent.com/u/2049439?v=4","gravatar_id":"","url":"https://api.github.com/users/aehrhardt","html_url":"https://github.com/aehrhardt","followers_url":"https://api.github.com/users/aehrhardt/followers","following_url":"https://api.github.com/users/aehrhardt/following{/other_user}","gists_url":"https://api.github.com/users/aehrhardt/gists{/gist_id}","starred_url":"https://api.github.com/users/aehrhardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aehrhardt/subscriptions","organizations_url":"https://api.github.com/users/aehrhardt/orgs","repos_url":"https://api.github.com/users/aehrhardt/repos","events_url":"https://api.github.com/users/aehrhardt/events{/privacy}","received_events_url":"https://api.github.com/users/aehrhardt/received_events","type":"User","site_admin":false},"labels":[{"id":200344831,"url":"https://api.github.com/repos/Yoast/wordpress-seo/labels/code-review","name":"code-review","color":"78BDF2","default":false},{"id":19494704,"url":"https://api.github.com/repos/Yoast/wordpress-seo/labels/enhancement","name":"enhancement","color":"bfe5bf","default":true}],"state":"closed","locked":false,"assignee":{"login":"andizer","id":325040,"avatar_url":"https://avatars0.githubusercontent.com/u/325040?v=4","gravatar_id":"","url":"https://api.github.com/users/andizer","html_url":"https://github.com/andizer","followers_url":"https://api.github.com/users/andizer/followers","following_url":"https://api.github.com/users/andizer/following{/other_user}","gists_url":"https://api.github.com/users/andizer/gists{/gist_id}","starred_url":"https://api.github.com/users/andizer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andizer/subscriptions","organizations_url":"https://api.github.com/users/andizer/orgs","repos_url":"https://api.github.com/users/andizer/repos","events_url":"https://api.github.com/users/andizer/events{/privacy}","received_events_url":"https://api.github.com/users/andizer/received_events","type":"User","site_admin":false},"assignees":[{"login":"andizer","id":325040,"avatar_url":"https://avatars0.githubusercontent.com/u/325040?v=4","gravatar_id":"","url":"https://api.github.com/users/andizer","html_url":"https://github.com/andizer","followers_url":"https://api.github.com/users/andizer/followers","following_url":"https://api.github.com/users/andizer/following{/other_user}","gists_url":"https://api.github.com/users/andizer/gists{/gist_id}","starred_url":"https://api.github.com/users/andizer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andizer/subscriptions","organizations_url":"https://api.github.com/users/andizer/orgs","repos_url":"https://api.github.com/users/andizer/repos","events_url":"https://api.github.com/users/andizer/events{/privacy}","received_events_url":"https://api.github.com/users/andizer/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-03-15T03:47:01Z","updated_at":"2018-03-26T08:36:41Z","closed_at":"2018-03-26T08:36:41Z","author_association":"NONE","body":"* [x] I've read and understood the [contribution guidelines](https://github.com/Yoast/wordpress-seo/blob/trunk/.github/CONTRIBUTING.md).\r\n* [x] I've searched for any related issues and avoided creating a duplicate issue.\r\n\r\n### Please give us a description of what happened.\r\n\r\nAfter installing the wordpress-seo plug-in I've started seeing lots of error messages in our Apache httpd error log. \r\n\r\nAn example of this error is: \r\n\r\nGot error 'PHP message: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"wp_yoast_seo_meta\"' at line 1 for query SHOW TABLES LIKE \"wp_yoast_seo_meta\" made by require_once('wp-admin/admin.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, wpseo_admin_init, WPSEO_Admin_Init->__construct, WPSEO_Admin->__construct, WPSEO_Admin->initialize_seo_links, WPSEO_Meta_Table_Accessible::is_accessible, WPSEO_Meta_Table_Accessible::check_table\r\n\r\nPHP message: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"wp_yoast_seo_links\"' at line 1 for query SHOW TABLES LIKE \"wp_yoast_seo_links\" made by require_once('wp-admin/admin.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, wpseo_admin_init, WPSEO_Admin_Init->__construct, WPSEO_Admin->__construct, WPSEO_Admin->initialize_seo_links, WPSEO_Link_Table_Accessible::is_accessible, WPSEO_Link_Table_Accessible::check_table\\n'\r\n\r\nI've been able to isolate this as being a result of us having to use sql-mode=ANSI_QUOTES for our MySQL server. We use this mode as it is needed by a legacy app that runs on the same server.\r\n\r\nI have tested by changing the quoting on the two impacted statements to use \\' instead of \" for quoting of the string component of the statement and can confirm the error goes away.\r\n\r\n### Please describe what you expected to happen and why.\r\n\r\nCan the quoting for these SQL statement be changed to single quotes, rather than double quotes to support the stricter string quoting requirements when using ANSI_QUOTES mode? Single quotes are valid for quoting strings with the default SQL mode of MySQL as well as ANS_QUOTES mode. This change will make the code more compatible with different MySQL modes.\r\n\r\n\r\n### How can we reproduce this behavior?\r\n1. Run the MySQL with the configuration property sql-mode=ANSI_QUOTES\r\n2. Access the wordpress site with wordpress-seo enabled.\r\n\r\n### Technical info\r\n* WordPress version: 4.94\r\n* Yoast SEO version: 7.0.3\r\n* Relevant plugins in case of a bug:\r\n* Tested with theme: \r\n"}}
{"actor":{"display_login":"andizer"}}