Problem/Motivation

Site content indexing for search is currently broken when using PostgreSQL as database backend. The problem is within the Node-Search-Plugin which throws the following error in PostgreSQL logs on each cron run:

ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list at character 153
STATEMENT: SELECT DISTINCT n.nid FROM node n LEFT JOIN search_dataset d ON d.type = 'node_search' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC LIMIT 100 OFFSET 0

Proposed resolution
The fix is as simple as adding "d.reindex" to the SELECT statement.

Remaining tasks
User test on MySQL and SQLite.

User interface changes
None.

API changes
None.

CommentFileSizeAuthor
#1 node-search-index-fix-2158229-1.patch1.14 KBbzrudi71
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bzrudi71’s picture

As this is my first Drupal patch ever, let's see ;-)

bzrudi71’s picture

Assigned: Unassigned » bzrudi71
bzrudi71’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: node-search-index-fix-2158229-1.patch, failed testing.

bzrudi71’s picture

Status: Needs work » Needs review
bzrudi71’s picture

Issue summary: View changes

Even if testbot seems happy with the patch we should do some additional manual testing on MySQL and SQLite. Otherwise patch seems RTBC from my side.

jhodgdon’s picture

Component: node system » search.module

We track search-related bugs in search.module even though technically the code for this one is in node.module.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

I don't think this patch can cause any problems, and it seems like a normal PostgreSQL compatibility fix to me. Plus, the tests pass. I think it is OK to commit.

bzrudi71’s picture

Thanks for reviewing!

jhodgdon’s picture

chx also looked at it at my IRC request and agreed it was a standard PostgreSQL fix.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 34008e0 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.