Commit a46f353a authored by mkanat%kerio.com's avatar mkanat%kerio.com

Bug 285532: GetSelectableProducts cannot run on PostgreSQL when classifications are enabled

Patch By Max Kanat-Alexander <mkanat@kerio.com> r=Tomas.Kopal, a=justdave
parent 71a8f7bf
...@@ -509,7 +509,8 @@ sub GetSelectableProducts { ...@@ -509,7 +509,8 @@ sub GetSelectableProducts {
my $extra_sql = $by_id ? "id, " : ""; 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 " . my $query = "SELECT $extra_sql products.name " .
"FROM products $extra_from_sql " . "FROM products $extra_from_sql " .
...@@ -527,7 +528,6 @@ sub GetSelectableProducts { ...@@ -527,7 +528,6 @@ sub GetSelectableProducts {
} }
$query .= "WHERE group_id IS NULL "; $query .= "WHERE group_id IS NULL ";
if ($by_classification) { if ($by_classification) {
$query .= "AND classifications.id = products.classification_id ";
$query .= "AND classifications.name = "; $query .= "AND classifications.name = ";
$query .= SqlQuote($by_classification) . " "; $query .= SqlQuote($by_classification) . " ";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment