Commit b414efe7 authored by myk%mozilla.org's avatar myk%mozilla.org

Fix for bug 228917: Makes some flag SQL work with PostgreSQL by using the…

Fix for bug 228917: Makes some flag SQL work with PostgreSQL by using the semantically equivalent INNER JOIN over a comma (,). Patch by mkanat@kerio.com. r=myk a=myk
parent 345f9df2
...@@ -244,12 +244,12 @@ sub process { ...@@ -244,12 +244,12 @@ sub process {
# no longer valid. # no longer valid.
&::SendSQL(" &::SendSQL("
SELECT flags.id SELECT flags.id
FROM flags, bugs LEFT OUTER JOIN flaginclusions i FROM (flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id)
ON (flags.type_id = i.type_id LEFT OUTER JOIN flaginclusions i
ON (flags.type_id = i.type_id
AND (bugs.product_id = i.product_id OR i.product_id IS NULL) AND (bugs.product_id = i.product_id OR i.product_id IS NULL)
AND (bugs.component_id = i.component_id OR i.component_id IS NULL)) AND (bugs.component_id = i.component_id OR i.component_id IS NULL))
WHERE flags.type_id = $target->{'bug'}->{'id'} WHERE flags.type_id = $target->{'bug'}->{'id'}
AND flags.bug_id = bugs.bug_id
AND i.type_id IS NULL AND i.type_id IS NULL
"); ");
clear(&::FetchOneColumn()) while &::MoreSQLData(); clear(&::FetchOneColumn()) while &::MoreSQLData();
......
...@@ -264,12 +264,12 @@ sub normalize { ...@@ -264,12 +264,12 @@ sub normalize {
# Check for flags whose product/component is no longer included. # Check for flags whose product/component is no longer included.
&::SendSQL(" &::SendSQL("
SELECT flags.id SELECT flags.id
FROM flags, bugs LEFT OUTER JOIN flaginclusions AS i FROM (flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id)
ON (flags.type_id = i.type_id LEFT OUTER JOIN flaginclusions AS i
ON (flags.type_id = i.type_id
AND (bugs.product_id = i.product_id OR i.product_id IS NULL) AND (bugs.product_id = i.product_id OR i.product_id IS NULL)
AND (bugs.component_id = i.component_id OR i.component_id IS NULL)) AND (bugs.component_id = i.component_id OR i.component_id IS NULL))
WHERE flags.type_id IN ($ids) WHERE flags.type_id IN ($ids)
AND flags.bug_id = bugs.bug_id
AND i.type_id IS NULL AND i.type_id IS NULL
"); ");
Bugzilla::Flag::clear(&::FetchOneColumn()) while &::MoreSQLData(); Bugzilla::Flag::clear(&::FetchOneColumn()) while &::MoreSQLData();
......
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