]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 600495: Make the "chfieldto" query parameter work all by itself, again.
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Thu, 7 Oct 2010 12:56:47 +0000 (05:56 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Thu, 7 Oct 2010 12:56:47 +0000 (05:56 -0700)
r=mkanat, a=mkanat (module owner)

Bugzilla/Search.pm
xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm

index cc1354dcf2503e1ecf49b3d34661d7a2a53003f1..850a63457295f4f543529e3711033e8a10f478d7 100644 (file)
@@ -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:
     #
index b3da598e42e367571fecf6fc531a61e9ab7adde2..1262e19fb1f1517de607a3c9a902ae95a94de886 100644 (file)
@@ -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 };
     }