Page 1 of 1

Found and corrected SQL Bug

Posted: 30. July 2009 16:26
by sailsfast
Your Portal Version: 1.0.3
Your phpBB Type: Standard phpBB3
MODs installed: No
Your knowledge: Beginner

MySQL Version: Postgres not MySQL

What have you done before the problem was there?
Installed Board3
edited files
ran install


What have you already tryed to solve the problem?
Debugged SQL the error.

Presumably you might want to include this in your next release. :-)


Description and Message
After installing properly... Opening the portal resulted in this

Code: Select all

SQL ERROR [ postgres ]

ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list []

SQL

SELECT DISTINCT u.user_id, u.username, u.user_colour, u.user_allow_viewonline, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline FROM phpbb_users u, phpbb_zebra z LEFT JOIN phpbb_sessions s ON (s.session_user_id = z.zebra_id) WHERE z.user_id = 2 AND z.friend = 1 AND u.user_id = z.zebra_id GROUP BY z.zebra_id, u.user_id, u.username, u.user_allow_viewonline, u.user_colour ORDER BY u.username_clean ASC LIMIT 8 OFFSET 0

BACKTRACE

FILE: includes/db/postgres.php
LINE: 177
CALL: dbal->sql_error()

FILE: includes/db/postgres.php
LINE: 232
CALL: dbal_postgres->sql_query()

FILE: includes/db/dbal.php
LINE: 170
CALL: dbal_postgres->_sql_query_limit()

FILE: portal/block/friends.php
LINE: 78
CALL: dbal->sql_query_limit()

FILE: portal.php
LINE: 243
CALL: include('portal/block/friends.php')
To RESOLVE the error

The select doesn't match....

Find FILE: portal/block/friends.php

Goto line 73
and change u.username_clean to u.username

OR
add:
_clean to u.username

in the preceding select statment[/i]

Re: Found and corrected SQL Bug

Posted: 27. August 2009 14:26
by Christian_N
Thank you for report.
Fixed in SVN: http://board3deportal.svn.sourceforge.n ... athrev=522