summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2011-12-08 21:01:57 +0100
committerDave Lawrence <dlawrence@mozilla.com>2011-12-08 21:01:57 +0100
commit60fb0c9b84f771a16a8abed0e1847b409b197217 (patch)
tree91630354cc75f081c38a95a30907e9aa2647bc13 /Bugzilla/DB.pm
parent720db163b9814b294b163347d994e513b8771ae7 (diff)
parent62410084926e1473c903c43b53d09c99311746c2 (diff)
downloadbugzilla-60fb0c9b84f771a16a8abed0e1847b409b197217.tar.gz
bugzilla-60fb0c9b84f771a16a8abed0e1847b409b197217.tar.xz
merged with bugzilla/4.2
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index a537d6131..083a1c208 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -397,8 +397,11 @@ sub sql_string_concat {
sub sql_string_until {
my ($self, $string, $substring) = @_;
- return "SUBSTRING($string FROM 1 FOR " .
- $self->sql_position($substring, $string) . " - 1)";
+
+ my $position = $self->sql_position($substring, $string);
+ return "CASE WHEN $position != 0"
+ . " THEN SUBSTR($string, 1, $position - 1)"
+ . " ELSE $string END";
}
sub sql_in {