WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] Broken Query in Indexer (v3.3.3) (3 posts)

  1. marktfrey
    Member
    Posted 1 year ago #

    Getting DB errors on indexing, seem to be due to a malformed query in lib/indexing.php, lines 74--98.

    The error in question:

    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 'LIMIT 500' at line 17]
    SELECT post.ID FROM wp_posts post LEFT JOIN wp_posts parent ON (post.post_parent=parent.ID) LEFT JOIN wp_relevanssi r ON (post.ID=r.doc) WHERE r.doc is null AND( (post.post_status IN ('publish','draft','private','pending','future') OR (post.post_status='inherit' AND( (parent.ID is not null AND (parent.post_status IN ('publish','draft','private','pending','future'))) OR (post.post_parent=0) ) ) ) AND post.post_type IN ('page') LIMIT 500

    The solution:
    There's an extra opening parenthesis after the first and condition in the WHERE clause.

    WHERE
    		r.doc is null
    		AND(
    			(post.post_status IN ($valid_status)

    should be

    WHERE
    		r.doc is null
    		AND
    			(post.post_status IN ($valid_status)

    https://wordpress.org/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks, I always appreciate a bug report with a solution included.

  3. marktfrey
    Member
    Posted 1 year ago #

    Thanks for the quick fix, Mikko!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic