summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xeditgroups.cgi6
-rwxr-xr-xeditusers.cgi6
-rwxr-xr-xprocess_bug.cgi16
3 files changed, 14 insertions, 14 deletions
diff --git a/editgroups.cgi b/editgroups.cgi
index 96503a125..981fec48a 100755
--- a/editgroups.cgi
+++ b/editgroups.cgi
@@ -137,9 +137,9 @@ if ($action eq 'changeform') {
my @groups;
SendSQL("SELECT groups.id, groups.name, groups.description," .
- " IF(group_group_map.member_id IS NOT NULL, 1, 0)," .
- " IF(B.member_id IS NOT NULL, 1, 0)," .
- " IF(C.member_id IS NOT NULL, 1, 0)" .
+ " CASE WHEN group_group_map.member_id IS NOT NULL THEN 1 ELSE 0 END," .
+ " CASE WHEN B.member_id IS NOT NULL THEN 1 ELSE 0 END," .
+ " CASE WHEN C.member_id IS NOT NULL THEN 1 ELSE 0 END" .
" FROM groups" .
" LEFT JOIN group_group_map" .
" ON group_group_map.member_id = groups.id" .
diff --git a/editusers.cgi b/editusers.cgi
index 5b1c88e98..6d6c844ca 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -135,9 +135,9 @@ sub EmitFormElements ($$$$)
if($user ne "") {
print "</TR><TR><TH VALIGN=TOP ALIGN=RIGHT>Group Access:</TH><TD><TABLE><TR>";
SendSQL("SELECT groups.id, groups.name, groups.description, " .
- "MAX(IF(grant_type = " . GRANT_DIRECT . ", 1, 0))," .
- "MAX(IF(grant_type = " . GRANT_DERIVED . ", 1, 0))," .
- "MAX(IF(grant_type = " . GRANT_REGEXP . ", 1, 0))" .
+ "MAX(CASE WHEN grant_type = " . GRANT_DIRECT . " THEN 1 ELSE 0 END)," .
+ "MAX(CASE WHEN grant_type = " . GRANT_DERIVED . " THEN 1 ELSE 0 END)," .
+ "MAX(CASE WHEN grant_type = " . GRANT_REGEXP . " THEN 1 ELSE 0 END)" .
"FROM groups " .
"LEFT JOIN user_group_map " .
"ON user_group_map.group_id = groups.id " .
diff --git a/process_bug.cgi b/process_bug.cgi
index c0e6e13a6..cdbb69ecf 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -572,9 +572,9 @@ sub ChangeStatus {
if ($::FORM{knob} eq 'reopen') {
# When reopening, we need to check whether the bug was ever
# confirmed or not
- $::query .= "bug_status = IF(everconfirmed = 1, " .
- SqlQuote($str) . ", " .
- SqlQuote($::unconfirmedstate) . ")";
+ $::query .= "bug_status = CASE WHEN everconfirmed = 1 THEN " .
+ SqlQuote($str) . " ELSE " .
+ SqlQuote($::unconfirmedstate) . " END";
} elsif (IsOpenedState($str)) {
# Note that we cannot combine this with the above branch - here we
# need to check if bugs.bug_status is open, (since we don't want to
@@ -603,11 +603,11 @@ sub ChangeStatus {
my @open_state = map(SqlQuote($_), OpenStates());
my $open_state = join(", ", @open_state);
- $::query .= "bug_status = IF(bug_status IN($open_state), " .
- "IF(everconfirmed = 1, " .
- SqlQuote($str) . ", " .
- SqlQuote($::unconfirmedstate) . " ), " .
- "bug_status)";
+ $::query .= "bug_status = CASE WHEN bug_status IN($open_state) THEN " .
+ "(CASE WHEN everconfirmed = 1 THEN " .
+ SqlQuote($str) . " ELSE " .
+ SqlQuote($::unconfirmedstate) . " END) ELSE " .
+ "bug_status END";
} else {
$::query .= "bug_status = " . SqlQuote($str);
}