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.
Comment | File | Size | Author |
---|---|---|---|
#1 | node-search-index-fix-2158229-1.patch | 1.14 KB | bzrudi71 |
Comments
Comment #1
bzrudi71 CreditAttribution: bzrudi71 commentedAs this is my first Drupal patch ever, let's see ;-)
Comment #2
bzrudi71 CreditAttribution: bzrudi71 commentedComment #3
bzrudi71 CreditAttribution: bzrudi71 commentedComment #5
bzrudi71 CreditAttribution: bzrudi71 commented1: node-search-index-fix-2158229-1.patch queued for re-testing.
Comment #6
bzrudi71 CreditAttribution: bzrudi71 commentedEven 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.
Comment #7
jhodgdonWe track search-related bugs in search.module even though technically the code for this one is in node.module.
Comment #8
jhodgdonI 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.
Comment #9
bzrudi71 CreditAttribution: bzrudi71 commentedThanks for reviewing!
Comment #10
jhodgdonchx also looked at it at my IRC request and agreed it was a standard PostgreSQL fix.
Comment #11
alexpottCommitted 34008e0 and pushed to 8.x. Thanks!