category.inc line 833 did not include all the columns mentioned in the Order By within the Select list as required by standard SQL and PostgreSQL.

The attached patch takes care of this.

Comments

PMunn’s picture

I just took a look at the March 6th dev release and this bug is still present in the source code. If anyone would like to take a look and give the patch (or a new one that does the same thing) a chance, I'd appreciate it.

PMunn’s picture

This bug is still present in the 2007-07-16 5.x-1.x-dev version.

PMunn’s picture

The bug is still there in the August 6th release. (Is this annoying? Please examine and apply the patch, or suggest an alternative.)

JirkaRybka’s picture

Version: 5.x-1.x-dev » 6.x-2.0-beta3
Priority: Critical » Normal
Status: Needs review » Needs work

After nearly 2 years, the 6.x-2.0-beta3 release seems to have the same, still (category.inc, line 72). I can't test on PgSQL, but it would not hurt to roll a small patch, still. One thing we should be careful about, is that we don't add columns with the same name as already retrieved from a different table, effectively overriding the values with something unneeded. I would say, just alias the added columns.

Taking down from critical, since no-one cared for 2 years...

JirkaRybka’s picture

Status: Needs work » Closed (fixed)

In fact, this issue only just shows how old stuff may be found in the Category queue. This is not a problem for quite a while now:

PgSQL 6.5 (archive) documentation - SELECT:

From release 6.4 of PostgreSQL, the columns in the ORDER BY clause do not need to appear in the SELECT clause. Thus the following statement is now legal:

SELECT name FROM distributors ORDER BY code;

Drupal 6 now requires PgSQL 7.4 minimum, so the problem doesn't exist anymore.

Closing this issue.