summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-10-07 14:56:47 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-10-07 14:56:47 +0200
commitf1973062b3ccda18738e188738da55af12b90f96 (patch)
treec0382a1b5d15e53187576bbc485d79784f6305aa
parentaf2f8916f920c2ac2876c9a85a4e4737ab8a6d60 (diff)
downloadbugzilla-f1973062b3ccda18738e188738da55af12b90f96.tar.gz
bugzilla-f1973062b3ccda18738e188738da55af12b90f96.tar.xz
Bug 600495: Make the "chfieldto" query parameter work all by itself, again.
r=mkanat, a=mkanat (module owner)
-rw-r--r--Bugzilla/Search.pm16
-rw-r--r--xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm7
2 files changed, 18 insertions, 5 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index cc1354dcf..850a63457 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -1309,14 +1309,20 @@ sub _special_parse_chfield {
# if there is a "from" date specified. It doesn't conflict with
# searching [Bug creation], because a bug's delta_ts is set to
# its creation_ts when it is created. So this just gives the
- # database an additional index to possibly choose.
- #
- # It's not safe to do it for "to" dates, though--"chfieldto" means
- # "a field that changed before this date", and delta_ts could be either
- # later or earlier than that.
+ # database an additional index to possibly choose, on a table that
+ # is smaller than bugs_activity.
if ($date_from ne '') {
push(@charts, ['delta_ts', 'greaterthaneq', $date_from]);
}
+ # It's not normally safe to do it for "to" dates, though--"chfieldto" means
+ # "a field that changed before this date", and delta_ts could be either
+ # later or earlier than that, if we're searching for the time that a field
+ # changed. However, chfieldto all by itself, without any chfieldvalue or
+ # chfield, means "just search delta_ts", and so we still want that to
+ # work.
+ if ($date_to ne '' and !@fields and $value_to eq '') {
+ push(@charts, ['delta_ts', 'lessthaneq', $date_to]);
+ }
# Basically, we construct the chart like:
#
diff --git a/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm b/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
index b3da598e4..1262e19fb 100644
--- a/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
+++ b/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
@@ -74,6 +74,13 @@ sub search_params {
return { chfield => $field, $ch_param => $value };
}
+ if ($field eq 'delta_ts' and $operator eq 'greaterthaneq') {
+ return { chfieldfrom => $value };
+ }
+ if ($field eq 'delta_ts' and $operator eq 'lessthaneq') {
+ return { chfieldto => $value };
+ }
+
if ($field eq 'deadline' and $operator eq 'greaterthaneq') {
return { deadlinefrom => $value };
}