aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2011-02-14 12:30:01 -0800
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-02-14 12:30:01 -0800
commit1e12c1ba0cd8e4f2017fd6eff50ae8744abf5e87 (patch)
tree9a50908340aeabf9cea50fbbeecf1e4ddd199a71
parentBug 633055: Make Bug.legal_values explicitly throw an error if you pass "undef" (diff)
downloadbugzilla-1e12c1ba0cd8e4f2017fd6eff50ae8744abf5e87.tar.gz
bugzilla-1e12c1ba0cd8e4f2017fd6eff50ae8744abf5e87.tar.bz2
bugzilla-1e12c1ba0cd8e4f2017fd6eff50ae8744abf5e87.zip
Remove tabs and fix some formatting in Bugzilla::DB::Pg.
https://bugzilla.mozilla.org/show_bug.cgi?id=616981
-rw-r--r--Bugzilla/DB/Pg.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm
index 123040f73..2ff22a108 100644
--- a/Bugzilla/DB/Pg.pm
+++ b/Bugzilla/DB/Pg.pm
@@ -190,10 +190,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.