diff options
author | jocuri%softhome.net <> | 2004-07-31 16:36:18 +0000 |
---|---|---|
committer | jocuri%softhome.net <> | 2004-07-31 16:36:18 +0000 |
commit | b37e43b5ab5a2dda0d50aa1e32b816a799f79bf6 (patch) | |
tree | c324f0cdca9d3f482bcf4dec1dafb10d76f14e3b /process_bug.cgi | |
parent | 7cea397f3ea0988b4edd4b2225fc65bf28b63611 (diff) | |
download | bugs-b37e43b5ab5a2dda0d50aa1e32b816a799f79bf6.tar bugs-b37e43b5ab5a2dda0d50aa1e32b816a799f79bf6.tar.gz bugs-b37e43b5ab5a2dda0d50aa1e32b816a799f79bf6.tar.bz2 bugs-b37e43b5ab5a2dda0d50aa1e32b816a799f79bf6.tar.xz bugs-b37e43b5ab5a2dda0d50aa1e32b816a799f79bf6.zip |
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-x | process_bug.cgi | 16 |
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); } |