I get the following error on my server:

---
Not unique table/alias: 'chatroom_online_list' query: INSERT INTO chatroom_online_list (ccid, uid, session_id, guest_id, modified) SELECT 1, 1, '332e62acb720d89e2a56ff377dc33d8f', COALESCE(MAX(guest_id) + 1, 1), UNIX_TIMESTAMP() FROM chatroom_online_list WHERE ccid = 1 in /home/virtual/site225/fst/var/www/html/dev.ppacheco.com/includes/database.mysql.inc on line 120.
---

That's because MySQL 3 does not suport updating and querying the same table in a single query, so this one needs to be splitted if you wan't to be compatible with mysql's earlier versions.

cheers
Pacheco

CommentFileSizeAuthor
#5 chatroom_0.patch1.36 KBpacheco
#2 chatroom.patch1.28 KBpacheco

Comments

Anonymous’s picture

pacheco is working on a patch for this issue.

pacheco’s picture

Status: Active » Needs review
StatusFileSize
new1.28 KB

here it is, please review

Anonymous’s picture

hi pacheco,

thanks for the patch. two little things:

1. i think we should wrap the two queries in db_lock_table('chatroom_online_list') and db_unlock_table('chatroom_online_list')

2. i think the third last line:

$chat_id, $user->uid, $session_id, db_fetch_array($result));

should be:

$chat_id, $user->uid, $session_id, db_result($result));

do those changes sound ok to you?

cheers
justin

Anonymous’s picture

Status: Needs review » Needs work
pacheco’s picture

Status: Needs work » Needs review
StatusFileSize
new1.36 KB

sure... we don't need to fetch an array on that :P

table locked too

Anonymous’s picture

thank pacheco,

i'll put this in today.

cheers
justin

Anonymous’s picture

Assigned: Unassigned »
Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)