WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Yet Another Related Posts Plugin] MySQL error on every query (7 posts)

  1. dannoll
    Member
    Posted 4 years ago #

    I just installed YARPP. A great plugin, except that I'm noticing my error logs full of MySQL errors.
    I'm running WP 2.91, YARPP 3.1.3 and my server runs MySQL 5.1.3.

    I have even tried deactivating and reactivating the plugin and dropping the YARPP cache tables. Didn't solve the problem.

    Examples of the errors:
    ---
[30-Jan-2010 21:21:04] 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 '' at line 1 for query set names made by require, require_once, include, related_posts, yarpp_related, yarpp_cache_enforce, yarpp_cache_keywords
    and
    [30-Jan-2010 16:17:02] 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 '' at line 1 for query set names made by include, do_meta_boxes, call_user_func, yarpp_metabox, yarpp_related, yarpp_cache_enforce, yarpp_cache_keywords

    URL example:
    http://www.uncorneredmarket.com/2010/01/10-tips-for-taking-great-food-photos/

  2. dannoll
    Member
    Posted 4 years ago #

    Any chance this error has something to do with mismatched/unexpected MySQL character sets or collations in the tables that YARPP queries?

    Anyone?

  3. dannoll
    Member
    Posted 4 years ago #

    I got rid of the errors by commenting out (as shown) the following code in the keywords.php file:

    //	if (defined('DB_CHARSET')) {
    //  	$wpdb->query('set names '.DB_CHARSET);
    //	}

    Everything seems to be OK, but this isn't ideal.

    I suppose this has to do with the fact that I don't declare a character set in my wp-config.php file (becuase some non-UTF8 characters still exist in some of my tables like wp_posts):
    define('DB_CHARSET', '');

    Anyhow, this strikes me as a potential bug. I'm sure there are others running YARPP who have left DB_CHARSET emtpy in wp-config.

  4. I see, yes, this is indeed a bug. It'll be fixed in the next version. Thanks!

  5. dannoll
    Member
    Posted 4 years ago #

    Thanks for the fix, Mitcho. Looks like it works.

  6. Great!

Topic Closed

This topic has been closed to new replies.

About this Topic