I see this when I go to the External Link Popularity Log:
user warning: 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 'DISTINCT(n.nid), n.title, p.url, u.name, p.hostname, p.timestamp FROM pop_links_' at line 1 query: SELECT p.cid, DISTINCT(n.nid), n.title, p.url, u.name, p.hostname, p.timestamp FROM pop_links_stats p LEFT JOIN users u ON u.uid = p.uid LEFT JOIN node n ON n.nid = p.nid LEFT JOIN drigg_node dn2 ON dn2.dnid = n.nid WHERE ( 1=1 AND !(n.type='drigg' AND dn2.killed=1 ) ) AND ( !(n.type='drigg' AND n.created > UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) ) ) ORDER BY p.timestamp DESC LIMIT 0, 30 in /home/sitename/public_html/includes/database.mysql.inc on line 172.
The module had been working properly for over a month and then I suddenly started getting this problem
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | pop_links-324473-3.patch | 1.24 KB | sikjoy |
Comments
Comment #1
sikjoy commentedHi Lukas2000:
Some of this SQL I recognize, but other parts of it seem to be from the Drigg module. For example, I don't know why there is a LEFT JOIN to drigg_node. I don't reference drigg_node anywhere in my code. Also the DISTINCT function isn't used anywhere in my code. Perhaps Drigg is using hook_db_rewrite_sql to alter my query?
I'll have a look at the Drigg code to see if anything is going on there.
You mentioned that it was working for a month. Has anything changed recently? Any module upgrades?
Best,
sicjoy
Comment #2
sikjoy commentedHi Lukas2000:
Ah, indeed Drigg is inserting its own SQL, but the mistake is mine. Try this patch. It should fix the problem.
Please reply letting me know if it works.
Best regards,
sicjoy
Comment #3
taqwa commentedIt worked! Thanks SicJoy!
btw, I forgot to thank you for another issue that you helped me with a few weeks ago. Please don't take my absentmindedness to mean that I don't appreciate your help.
Thanks again!
Comment #4
sikjoy commentedAwesome!
You're welcome.
--sicjoy
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
diesel7 commentedhow do I use this patch and where? I get this error when I try to submit a scoop, thx
user warning: 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 'AND n.status = 1 AND n.promote=0 AND n.type='drigg' ) ORDER BY vc.value DESC LI' at line 1 query: SELECT * FROM node n LEFT JOIN votingapi_cache vc ON vc.content_id=n.nid LEFT JOIN term_node t ON n.nid = t.nid WHERE ( 1=1 ) AND ( 1 = 1 AND vc.content_type = 'node' AND vc.value_type = 'points' AND vc.tag = 'vote' AND vc.function = 'sum' AND n.type='drigg' AND n.created > UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) - 60*60*48 AND t.tid= AND n.status = 1 AND n.promote=0 AND n.type='drigg' ) ORDER BY vc.value DESC LIMIT 5 in /home/moksiru/public_html/includes/database.mysql.inc on line 174.
Comment #7
diesel7 commentedhow do I use this patch and where? I get this error when I try to submit a scoop, thx
user warning: 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 'AND n.status = 1 AND n.promote=0 AND n.type='drigg' ) ORDER BY vc.value DESC LI' at line 1 query: SELECT * FROM node n LEFT JOIN votingapi_cache vc ON vc.content_id=n.nid LEFT JOIN term_node t ON n.nid = t.nid WHERE ( 1=1 ) AND ( 1 = 1 AND vc.content_type = 'node' AND vc.value_type = 'points' AND vc.tag = 'vote' AND vc.function = 'sum' AND n.type='drigg' AND n.created > UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) - 60*60*48 AND t.tid= AND n.status = 1 AND n.promote=0 AND n.type='drigg' ) ORDER BY vc.value DESC LIMIT 5 in /home/moksiru/public_html/includes/database.mysql.inc on line 174.
Comment #8
sikjoy commentedYou shouldn't need this patch any more.
Which version of External Link Popularity are you using?
--sicjoy
Comment #9
diesel7 commentedsorry I didnt notice that this is actually for different module than what Im having problem with, my module that is causing this error is drigg autovoting