Commit 00cc8677 authored by jocuri%softhome.net's avatar jocuri%softhome.net

Patch for bug 248001: Conversion of boolean conditions in SQL statements for…

Patch for bug 248001: Conversion of boolean conditions in SQL statements for better DB independence; patch by David Lawrence <dkl@redhat.com>; r=joel, vladd; a=justdave.
parent 7600babc
...@@ -342,11 +342,11 @@ sub groups { ...@@ -342,11 +342,11 @@ sub groups {
" LEFT JOIN user_group_map" . " LEFT JOIN user_group_map" .
" ON user_group_map.group_id = groups.id" . " ON user_group_map.group_id = groups.id" .
" AND user_id = $::userid" . " AND user_id = $::userid" .
" AND NOT isbless" . " AND isbless = 0" .
" LEFT JOIN group_control_map" . " LEFT JOIN group_control_map" .
" ON group_control_map.group_id = groups.id" . " ON group_control_map.group_id = groups.id" .
" AND group_control_map.product_id = " . $self->{'product_id'} . " AND group_control_map.product_id = " . $self->{'product_id'} .
" WHERE isbuggroup"); " WHERE isbuggroup = 1");
while (&::MoreSQLData()) { while (&::MoreSQLData()) {
my ($groupid, $name, $description, $ison, $ingroup, $isactive, my ($groupid, $name, $description, $ison, $ingroup, $isactive,
......
...@@ -246,9 +246,9 @@ sub GetGroupsByUserId { ...@@ -246,9 +246,9 @@ sub GetGroupsByUserId {
SendSQL(" SendSQL("
SELECT DISTINCT groups.id, name, description, isactive SELECT DISTINCT groups.id, name, description, isactive
FROM groups, user_group_map FROM groups, user_group_map
WHERE user_id = $userid AND NOT isbless WHERE user_id = $userid AND isbless = 0
AND user_group_map.group_id = groups.id AND user_group_map.group_id = groups.id
AND isbuggroup AND isbuggroup = 1
ORDER BY description "); ORDER BY description ");
my @groups; my @groups;
......
...@@ -274,7 +274,7 @@ if ($action eq 'changeform') { ...@@ -274,7 +274,7 @@ if ($action eq 'changeform') {
" LEFT JOIN group_group_map as B" . " LEFT JOIN group_group_map as B" .
" ON B.member_id = groups.id" . " ON B.member_id = groups.id" .
" AND B.grantor_id = $group_id" . " AND B.grantor_id = $group_id" .
" AND B.isbless" . " AND B.isbless = 1" .
" WHERE groups.id != $group_id ORDER by name"); " WHERE groups.id != $group_id ORDER by name");
while (MoreSQLData()) { while (MoreSQLData()) {
......
...@@ -81,8 +81,8 @@ sub queue { ...@@ -81,8 +81,8 @@ sub queue {
# should not have access. # should not have access.
" COUNT(DISTINCT ugmap.group_id) AS cntuseringroups, " COUNT(DISTINCT ugmap.group_id) AS cntuseringroups,
COUNT(DISTINCT bgmap.group_id) AS cntbugingroups, COUNT(DISTINCT bgmap.group_id) AS cntbugingroups,
((COUNT(DISTINCT ccmap.who) AND cclist_accessible) ((COUNT(DISTINCT ccmap.who) AND cclist_accessible = 1)
OR ((bugs.reporter = $::userid) AND bugs.reporter_accessible) OR ((bugs.reporter = $::userid) AND bugs.reporter_accessible = 1)
OR bugs.assigned_to = $::userid ) AS canseeanyway OR bugs.assigned_to = $::userid ) AS canseeanyway
" . " .
# Use the flags and flagtypes tables for information about the flags, # Use the flags and flagtypes tables for information about the flags,
......
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