Bug #521
Display and sort by rating doesn't work in PostgreSQL
| Status: | Closed | Start date: | 11/04/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | 11/04/2009 | |
| Assignee: | Ryan Gordon | % Done: | 100% |
|
| Category: | PostgreSQL | |||
| Target version: | 1.4.10 | Estimated time: | 1.00 hour | |
| Reproducibility: | Always | Database Type: | PostgreSQL | |
| Reported In MyBB Version: | 1.4.8 | Database Version: | 8.3.8 | |
| PHP Version: | 5.2.6 | SQA assignments: | ||
| Browser: |
Description
The ordering of threads by rating produces the following SQL error in PostgreSQL:
2009-11-02 13:39:24 EET ERROR: column t.averagerating does not exist at character 135
--
SELECT t.numratings, t.totalratings, t.tid
FROM threads t
WHERE t.fid='2' AND t.visible='1'
ORDER BY t.sticky DESC, t.averagerating desc , t.totalratings DESC
LIMIT 20 OFFSET 0
Furthermore, the display of thread ratings in forumdisplay.php doesn't work neither - it shows the number of votes correctly, but the average is always zero.
After inspecting the code I found the reason for the first error and then fixed both issues.
The patch is attached and additionally can be found here: http://clubs.ath.cx/forumdisplay.patch
Associated revisions
Last commit (r4536) actually fixes 521 (fixes:521)
History
Updated by Doug Sisk over 2 years ago
- % Done changed from 100 to 0
Please do not mark a bug as done. Only team members can do so.
Updated by Ryan Gordon about 2 years ago
- Status changed from New to Assigned
- Assignee set to Ryan Gordon
- Target version set to 1.4.10
Updated by Ryan Gordon about 2 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100
Applied in changeset r4537.
Updated by Ryan Gordon about 2 years ago
Applied in changeset r4537.
Updated by Ryan Gordon about 2 years ago
SQA, please test this thoroughly. Please ensure this works on the oldest version of PostgreSQL we support in addition to the latest stable. Thanks!
Updated by Ryan Gordon about 2 years ago
- Status changed from Resolved to Closed