Active
Project:
Aggregator2
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2005 at 16:48 UTC
Updated:
20 Dec 2005 at 01:26 UTC
I'm using the latest CVS version from the repository and have done my best to update mysql, recently adding the guid field because lack of this was causing an error. However, whenever I try to manually refresh a feed I receive this 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 = '
I have no idea what the cause is. Has anyone else had this problem?
Comments
Comment #1
ahwayakchih commentedCan You post whole sql query which errors out?
Also be sure to check if feed node is setup properly (go and edit feed node and see if all fields are filled as they should).
Comment #2
alaa commentedI get the same error with a variety of feeds, yet ot find the time to investigate and isolate the condition that triggers this error, but here is a sample while refreshing the feed @ http://www.manalaa.net/rss.xml
as you can the error message shows a truncated query, any suggestions on how I can see the full query?
Comment #3
jasonwhat commentedI definitely have everything set up correctly. I'm not sure what you mean by the full sql query. The error I showed is the complete error whenever I do a manual refresh.
Comment #4
jasonwhat commentedI don't know if this will help any, but I don't see any feed items on the aggregator2 feeds actual page. I thought I read in the change log or somewhere that the actual items are supposed to be listed on the feed node types page rather than just statistics for the feed like how many published items are in the feed. If this is correct, maybe I'm missing something in my version, though I got it from cvs.
Comment #5
ahwayakchih commentedBy "full SQL query" i mean whole query, the one You posted is kinda cutted (or am i missing something?).
For now there's only special sources/[feed_id] page on which there are items. You should see "view items" link with each feed.
Comment #6
jasonwhat commentedI bolded the part that was cutting off. It is in a text box when I vew the error which is weird. I don't really know about that. As for my links I only have source site, refresh items, and remove items as links. No link to view the items. I'm not sure what I'm missing.
Comment #7
ahwayakchih commentedThe "0 = 0" in SQL happened to me few times long time ago. Not it's not there, and i never really found out why it happened.
It was reported by other people too, but nothing specific. Just that error shows up.
BUT similar thing happened when data in database was "screwed". For example when one there was a bug in aggregator2 because of which feed was loosing URL field.
So please check if feed is all ok. Maybe also backupd database and, for testing, remove all items from feed and then refresh it again. If error disappears we'll know it's because of some data missing (it may happen also when cron run is quit before it finishes, for example because of taking too much time and hitting timelimit).
Comment #8
alaa commentedthis has nothing to do with database being screwed up or cron not running properly, I get this error when aggregating from a drupal rss feed try (http://www.manalaa.net/rss.xml) even on a new empty installation, it occurs on every update not just occasionaly.
it aggregates feed items with no trouble, but it fails to grab the feed description.
Comment #9
ahwayakchih commentedNo errors, nothing. So it must be something about environment. Maybe some other module? What modules do You use on site?
Comment #10
ahwayakchih commentedSome time ago i added the same handling way for descripton as it is for image link. Description is updated only if it's empty in node. So to update it You should first edit feed and remove all content form "body"/"description" field.
Comment #11
alaa commentedI've no idea if this is somehow specific to my installation but I did some tests to find out what is going on exactly with that sql error.
I found out that the error came from a query in the function node_save after being called inside aggregator2_refresh.
by debugging node_save I found out that in the part
at some point $key takes the value '0' and the in_array() test returns true with key value 0. according to a comment in php manual and some tests I did, in_array(0,array("any string",...)) will always return true. so the update sql statement ends with a 0=%s where nid=some_nid
which is the sql syntax error, changing the if (in_array line to if($key && in_array($key, fields)) or adding a stict type checking requirement to in_array solves the problem.
now is my analysis correct? is this in fact a bug in node.module?
Comment #12
alaa commentedthe in_array error was reported @ http://drupal.org/node/32361 and a patch submitted