]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Remove tabs and fix some formatting in Bugzilla::DB::Pg.
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Mon, 14 Feb 2011 20:29:42 +0000 (12:29 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Mon, 14 Feb 2011 20:29:42 +0000 (12:29 -0800)
https://bugzilla.mozilla.org/show_bug.cgi?id=616981

Bugzilla/DB/Pg.pm

index 888040ee80c941c02a0b6b8655a87fd37029c898..0a21a5c10e9d354d64ee22e603af3f9bbe627d43 100644 (file)
@@ -198,10 +198,10 @@ sub sql_string_until {
     # PostgreSQL does not permit a negative substring length; therefore we
     # use CASE to only perform the SUBSTRING operation when $substring can
     # be found withing $string.
-    return "CASE WHEN " . $self->sql_position($substring, $string)
-                        . " != 0 THEN SUBSTRING($string FROM 1 FOR "
-                        . $self->sql_position($substring, $string) . " - 1)"
-                       . " ELSE $string END";
+    my $position = $self->sql_position($substring, $string);
+    return "CASE WHEN $position != 0"
+             . " THEN SUBSTRING($string FROM 1 FOR $position - 1)"
+             . " ELSE $string END";
 }
 
 # Tell us whether or not a particular sequence exists in the DB.