I've install the latest version chatroom. After I've installed the module, I successfully created a new chatroom on node #2. However, node #2 always give me this error message:
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 'SELECT COUNT(*) FROM ffworld_dp_chatroom AS cr INNE query: SELECT ( SELECT COUNT(*) FROM ffworld_dp_chatroom AS cr INNER JOIN ffworld_dp_chatroom_chat AS cc ON cc.crid = cr.crid INNER JOIN ffworld_dp_chatroom_msg AS cm ON cm.ccid = cc.ccid WHERE cr.crid = 2 AND cm.recipient = '' ) + ( SELECT COUNT(*) FROM ffworld_dp_chatroom AS cr INNER JOIN ffworld_dp_chatroom_chat AS cc ON cc.crid = cr.crid INNER JOIN ffworld_dp_chatroom_msg_archive AS cma ON cma.ccid = cc.ccid WHERE cr.crid = 2 AND cma.recipient = '' ) AS msg_count, MAX(cm.cmid) AS last_cmid, cc.ccid, cc.chatname, cc.when_archived FROM ffworld_dp_chatroom AS cr INNER JOIN ffworld_dp_chatroom_chat AS cc ON cc.crid = cr.crid LEFT JOIN ffworld_dp_chatroom_msg AS c in /home/yookoala/public_html/ffworld/includes/database.mysql.inc on line 172
Also, I cannot create chat under that chatroom. If I try to create one, node #2 give me another error:
* 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 'SELECT COUNT(*) FROM ffworld_dp_chatroom AS cr INNE query: SELECT ( SELECT COUNT(*) FROM ffworld_dp_chatroom AS cr INNER JOIN ffworld_dp_chatroom_chat AS cc ON cc.crid = cr.crid INNER JOIN ffworld_dp_chatroom_msg AS cm ON cm.ccid = cc.ccid WHERE cr.crid = 2 AND cm.recipient = '' ) + ( SELECT COUNT(*) FROM ffworld_dp_chatroom AS cr INNER JOIN ffworld_dp_chatroom_chat AS cc ON cc.crid = cr.crid INNER JOIN ffworld_dp_chatroom_msg_archive AS cma ON cma.ccid = cc.ccid WHERE cr.crid = 2 AND cma.recipient = '' ) AS msg_count, MAX(cm.cmid) AS last_cmid, cc.ccid, cc.chatname, cc.when_archived FROM ffworld_dp_chatroom AS cr INNER JOIN ffworld_dp_chatroom_chat AS cc ON cc.crid = cr.crid LEFT JOIN ffworld_dp_chatroom_msg AS c in /home/yookoala/public_html/ffworld/includes/database.mysql.inc on line 172.
* 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 'SELECT COUNT(*) FROM ffworld_dp_chatroom AS cr INNE query: SELECT ( SELECT COUNT(*) FROM ffworld_dp_chatroom AS cr INNER JOIN ffworld_dp_chatroom_chat AS cc ON cc.crid = cr.crid INNER JOIN ffworld_dp_chatroom_msg AS cm ON cm.ccid = cc.ccid WHERE cr.crid = 2 AND cm.recipient = '' ) + ( SELECT COUNT(*) FROM ffworld_dp_chatroom AS cr INNER JOIN ffworld_dp_chatroom_chat AS cc ON cc.crid = cr.crid INNER JOIN ffworld_dp_chatroom_msg_archive AS cma ON cma.ccid = cc.ccid WHERE cr.crid = 2 AND cma.recipient = '' ) AS msg_count, MAX(cm.cmid) AS last_cmid, cc.ccid, cc.chatname, cc.when_archived FROM ffworld_dp_chatroom AS cr INNER JOIN ffworld_dp_chatroom_chat AS cc ON cc.crid = cr.crid LEFT JOIN ffworld_dp_chatroom_msg AS c in /home/yookoala/public_html/ffworld/includes/database.mysql.inc on line 172.
I'm using PHP 4.4.3 and MySQL 4.0.27-standard on my server. I guess this may be a MySQL version issue.
Comments
Comment #1
darren ohIt could be a MySQL version info, but try the release that came out today and see how it works.
Comment #2
yookoala commentedI've installed the chatroom. The same thing happened. The error is:
I figured out that the original matter caused by this query:
I then tried to run the query under phpmyadmin environment. It resulted in the similar error:
Comment #3
yookoala commentedI read from MySQL documentation that subquery is only support on or after MySQL version 4.1. Which means that my database version is too old for subquery used in chatroom to work. Will you please rewrite the query with non-subquery form?
Thanks.
Comment #4
darren ohI don't have any plans to rewrite the query, but I'm willing to review a patch.
Comment #5
yookoala commentedI'm willing to write a patch on it.
I got rid of the first error yesterday, but I found more subquery in the module. When I test the module further, I founded that the chat Ajax script doesn't work at all. I could create a chatroom and create a chat in it, but the chat didn't respond to my input. I kept pressing the "send" button, but nothing shown up in the chat box. I could not do any further test on it then.
Should I provide the "half-way fix" patch here?
Comment #6
darren ohDrupal versions 5.1 and below have a bug which prevents the AJAX script from working (how many times must I repeat that?). You can either use the development snapshot of Drupal or fix the offending line yourself, as in issue 134659.
This is the correct place to post your patch to replace sub-queries.
Comment #7
darren ohPlease note that the query was updated today.
Comment #8
FableForge commentedI'm having the exact same issue. I downloaded the module today, thanks for any help, I'll keep an eye on this issue, since no other chatroom has worked well (or at all!) for me yet, and I'm pretty sure I tried them all.
Comment #9
tinkerbelle commentedyookoala, I'd love to know if you got the chat working, and in any case to see your patch with the old-school queries...
Comment #10
darren ohComment #11
darren ohComment #12
darren ohComment #13
darren ohComment #14
darren ohI haven't heard anything more about this. The documentation has been changed to require MySQL 5.0
Comment #15
darren ohOops. Works with MySQL 4.1.
Comment #16
heliod commentedSorry to reopen this very old issue, but I am having the same problem.
Working with MySQL 4.0.25.
I thought about upgrading it to 4.1, but the list of incompatibilities at the MySQL manual ( http://dev.mysql.com/doc/refman/4.1/en/upgrading-from-previous-series.html ) is so big that I am afraid all my 3 websites will stop working if I do the change.
Have someone gone through such an upgrade on an existing site? Can I get some help on doing it securely?