I have been noticing this error in watchdog every cron run. It doesn't seem to affect the search indexing or any other functionality but the error is alarming. I looked into the code and it seems like a simple fix, even if not obvious from the SQL query shown in the error.

The 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 '0' at line 1 query: UPDATE apachesolr_index_entities_node asn SET asn.changed = '1364023932', asn.status = 0 WHERE asn.entity_id IN 0 in /<em>&lt;path&gt;</em>/sites/all/modules/apachesolr/apachesolr.index.inc on line 1301.

This happened on 6.x-3.0-rc1 but the code is incorrect in the latest commit on the branch too. I am attaching the patch in a comment.

CommentFileSizeAuthor
#1 apachesolr-sql-error-1955616-1.patch1.08 KBhussainweb

Comments

hussainweb’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

Attaching the patch. I tested with the patch applied and found no errors in my watchdog after a cron run.

kevin.dutra’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

hussainweb’s picture

I just checked and couldn't find this in the 6.x-3.x branch. Any idea when it can be committed, or are there any problems or suggestions?

pwolanin’s picture

Status: Reviewed & tested by the community » Fixed

thanks, committed.

hussainweb’s picture

Great, I see the commit at 0bb62a9. I am probably being vain but I sure wish you had marked me as the author. Still, it is great seeing my name in changelog. :)

pwolanin’s picture

@hussainweb - I'm not very consistently setting the commit author, but post some more patches and I'll try to remember to for you.

Status: Fixed » Closed (fixed)

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