From a46f353a0a226e45a80be2dd07adc78128f4df03 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Thu, 10 Mar 2005 15:49:41 +0000 Subject: Bug 285532: GetSelectableProducts cannot run on PostgreSQL when classifications are enabled Patch By Max Kanat-Alexander r=Tomas.Kopal, a=justdave --- globals.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'globals.pl') diff --git a/globals.pl b/globals.pl index 44bf7dc3e..53119c034 100644 --- a/globals.pl +++ b/globals.pl @@ -509,7 +509,8 @@ sub GetSelectableProducts { my $extra_sql = $by_id ? "id, " : ""; - my $extra_from_sql = $by_classification ? ", classifications" : ""; + my $extra_from_sql = $by_classification ? " INNER JOIN classifications" + . " ON classifications.id = products.classification_id" : ""; my $query = "SELECT $extra_sql products.name " . "FROM products $extra_from_sql " . @@ -527,7 +528,6 @@ sub GetSelectableProducts { } $query .= "WHERE group_id IS NULL "; if ($by_classification) { - $query .= "AND classifications.id = products.classification_id "; $query .= "AND classifications.name = "; $query .= SqlQuote($by_classification) . " "; } -- cgit v1.2.3-24-g4f1b