Broken Query in Indexer (v3.3.3)
-
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)
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Broken Query in Indexer (v3.3.3)’ is closed to new replies.