SELECT pmi.thread_id, pm.subject, MAX(pm.timestamp) as timestamp, MAX(pmi.new) as new FROM pm_message pm INNER JOIN pm_index pmi ON pm.mid = pmi.mid WHERE (pmi.uid = 1) AND (pmi.deleted = 0) GROUP BY pmi.thread_id ORDER BY pmi.new desc, MAX(pmi.mid) DESC

Does not work on my installation of Drupal 6.4 with mysql 4.1.22. If I removing the max from the order by is working. Or if I change it to use the one of the groups selected in the select.

Am I missing something here?

Comments

naheemsays’s picture

what does replacing "MAX(pmi.mid)" with "timestamp" do for you?

kellyburton’s picture

I actually just removed it from the order by, since the items are already sorted.

naheemsays’s picture

Can you please still add it and try?

Without it, the items are still sorted, but just with the threads with new replies at the top. there is no sorting after that to get the messages in the right order.

illepic’s picture

I replaced "MAX(pmi.mid)" with "timestamp" and the error went away. No messages to test sorting on yet, however.

naheemsays’s picture

Status: Active » Closed (duplicate)

Thanks, I will change it to timestamp.

Fixing in #315325: Userblocking architecture + other fixes.

kellyburton’s picture

Status: Closed (duplicate) » Active

This is rebroken in the lastest release.

berdir’s picture

- latest release ? do you mean dev or rc2 ? I can't reproduce it in any version I have.

Can you please post the exact error message ?

kellyburton’s picture

Status: Active » Fixed

My mistake, I just tried both the RC2 and the DEV version and I am not getting the error now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.