summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorjocuri%softhome.net <>2004-07-31 18:36:18 +0200
committerjocuri%softhome.net <>2004-07-31 18:36:18 +0200
commitb37e43b5ab5a2dda0d50aa1e32b816a799f79bf6 (patch)
treec324f0cdca9d3f482bcf4dec1dafb10d76f14e3b /process_bug.cgi
parent7cea397f3ea0988b4edd4b2225fc65bf28b63611 (diff)
downloadbugzilla-b37e43b5ab5a2dda0d50aa1e32b816a799f79bf6.tar.gz
bugzilla-b37e43b5ab5a2dda0d50aa1e32b816a799f79bf6.tar.xz
Patch for bug 253360: replace IF() with CASE WHEN for database compatibility; patch by Tomas Kopal <Tomas.Kopal@altap.cz>; r=vladd, a=justdave.
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi16
1 files changed, 8 insertions, 8 deletions
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);
}