diff options
author | mozilla%colinogilvie.co.uk <> | 2005-07-20 05:38:14 +0000 |
---|---|---|
committer | mozilla%colinogilvie.co.uk <> | 2005-07-20 05:38:14 +0000 |
commit | 82787bc9132869edb068904dfc8123414c115639 (patch) | |
tree | defa3df28ae742034c5ea9bd321011d37dbf8b12 /buglist.cgi | |
parent | 3d9cbd26f5bcf6cba530a6693c2536f90c5bade1 (diff) | |
download | bugs-82787bc9132869edb068904dfc8123414c115639.tar bugs-82787bc9132869edb068904dfc8123414c115639.tar.gz bugs-82787bc9132869edb068904dfc8123414c115639.tar.bz2 bugs-82787bc9132869edb068904dfc8123414c115639.tar.xz bugs-82787bc9132869edb068904dfc8123414c115639.zip |
Bug 282737: Software Error from time-tracking fields during Change Columns
Patch by Joel, Me, r=wurblzap, a=myk
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-x | buglist.cgi | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/buglist.cgi b/buglist.cgi index 4768843de..45c0db552 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -733,7 +733,15 @@ foreach my $fragment (split(/,/, $order)) { # Add order columns to selectnames # The fragment has already been validated $fragment =~ s/\s+(asc|desc)$//; - $fragment =~ tr/a-zA-Z\.0-9\-_//cd; + # This fixes an issue where columns being used in the ORDER BY statement + # can have the SQL that generates the value changed to become invalid - + # mainly affects time tracking. + if ($fragment =~ / AS (\w+)/) { + $fragment = $columns->{$1}->{'name'}; + } + else { + $fragment =~ tr/a-zA-Z\.0-9\-_//cd; + } push @selectnames, $fragment; } } @@ -881,7 +889,7 @@ while (my @row = $buglist_sth->fetchrow_array()) { # or because of human choice my %min_membercontrol; if (@bugidlist) { - my $sth = $dbh->prepare(
+ my $sth = $dbh->prepare( "SELECT DISTINCT bugs.bug_id, MIN(group_control_map.membercontrol) " . "FROM bugs " . "INNER JOIN bug_group_map " . |