From 6b0315b816c479f90117b69c9ff57d9c843b9397 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Mon, 5 Dec 2011 18:04:47 +0100 Subject: Bug 550299: User fields are left blank in buglists and whines when local user accounts are used (i.e. they have no @company.com suffix) r/a=mkanat --- Bugzilla/DB.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Bugzilla/DB.pm') diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index ccd86d781..6043aee00 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 { -- cgit v1.2.3-24-g4f1b