Closed (fixed)
Project:
Live Discussion
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
9 Jan 2005 at 23:06 UTC
Updated:
13 Sep 2005 at 13:03 UTC
I use this module on 2 other Drupal Sites, without issues. But on one Install I get:
user error: You have an error in your SQL syntax near 'on n.nid = c.nid where c.status = 0 group by c.nid order by the_time desc LIMIT' at line 1
query: SELECT c.nid, n.title, count(c.nid) as comment_count, max(c.timestamp) as the_time FROM comments c JOIN node n on n.nid = c.nid where c.status = 0 group by c.nid order by the_time desc LIMIT 5 in /var/www/html/includes/database.mysql.inc on line 125.Thanks for ANY feedback.
Comments
Comment #1
Prometheus6 commentedWhat version of Drupal and MySQL are you using?
Comment #2
czarphanguye commentedThanks for a reply:
Drupal v4.5.1
- But, I have been using Drupal since v4.4.0. The reason I bring this up, After doing some additional research I think this issue has something to do with the comment problem. I have NOT used a patch, nor anything else.. just the update.php
I'm not sure what SQL version I'm use... How would I check that?
Comment #3
Prometheus6 commentedIf you use phpMyAdmin, just connect and the home page will tell you what version you're running. On the command line give the -V or --version switch.
I am new to Drupal development and never really coded againt 4.4. I didn't know there was a comment issue for upgraders. Were the two sites that had no problems clean installs or upgrades? At any rate in the next day or two I'll probably load up 4.4, upgrade it and see how that works.
Comment #4
czarphanguye commentedDear Prometheus6,
Thank you for your reply.
MySQL version is 3.23.56. Both sites, that Live Discussion work are fresh installations of Drupal v4.5.1.
Comment #5
czarphanguye commentedP.S.
In /admin/settings/live_discussions the "Show comment count per post" selection refuses to tick. It started in the off position and remains.
Comment #6
Prometheus6 commentedOkay, I have a copy of the 4.4 archive that predates that thread about the comment update issue. I'll see if I can duplicate your problem by doing the install and update...that much I can get back to you on by tomorrow.
Comment #7
Prometheus6 commentedOkay, I was able to duplicate the checkbox thing but not the sql error message., but I did find a coding error that I think could cause the sql error message under some conditions.
I've committed some changes I think will fix the whole lot. Give the system a couple of hours to repackage the download and try it again.
Comment #8
czarphanguye commentedThanks, I tried out the new module (mod date the 12th).
Same MySQL error. ;-/
Comment #9
Prometheus6 commentedI may be stumped...and I you have no idea how much I hate saying that. I've done upgrade from 4.4 to 4.5 and 4.5.1 and get no SQL errors at all.
The query in the error message:
SELECT c.nid, n.title, count(c.nid) as comment_count, max(c.timestamp) as the_time FROM comments c JOIN node n on n.nid = c.nid where c.status = 0 group by c.nid order by the_time desc LIMIT 5…is the right one. Can you run it successfully in phpMyAdmin?
Comment #10
Prometheus6 commentedCan not duplicate
Comment #11
jmstriegel commentedI was able to duplicate on media temple's hosting service. mysql --version gives:
mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)
It apparently doesn't like the JOIN syntax for some reason. If you change to INNER JOIN it appears to work correctly.
Comment #12
Prometheus6 commentedMySQL pre-version 4 doesn't like my join syntax it seems, though I still am not clear why it would complain. I recently got a rewritten module on another project of mine (rather than a patch, which is why I haven't looked at it yet) that the submitter said "now works" with this very version of MySQL.
Thanks for finding that. I'll probably run through all my GPL modules looking for similar stuff.
Comment #13
Prometheus6 commentedUpdated 4.6 and HEAD.