Closed (duplicate)
Project:
Drupal core
Version:
5.1
Component:
user system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 May 2007 at 14:30 UTC
Updated:
12 Jun 2007 at 18:53 UTC
Using postgresql and the who's online block throws this error:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list in /var/www/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT DISTINCT u.uid, u.name FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.timestamp >= 1178287457 AND s.uid > 0 ORDER BY s.timestamp DESC in /var/www/includes/database.pgsql.inc on line 144.
The code appeared when I enabled the "who's online" block so I investigated that and found that it orders by the s.timestamp but does not include that in the select list which apparently is a problem for pgsql.
Attached patch includes the column in the select list. This is a minor performance hit for MySQL because it returns unnecessary data, but I believe it's an acceptable performance hit to get the query working on PGSQL.
I tested a default ubuntu: pgsql8.1.8 and MySQL 5.0.
| Comment | File | Size | Author |
|---|---|---|---|
| onlineblock_pgsql_compliance.patch | 1.11 KB | greggles |
Comments
Comment #1
greggleshttp://drupal.org/node/148974
"duplicate" of a later bug... :/