summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-12-05 18:26:32 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2011-12-05 18:26:32 +0100
commita0256cf7a6d211d0b38a6fa158be2420275e63ff (patch)
tree5fdfe9b1cc7be3135a5492bb8f63646b26530eab /Bugzilla/DB.pm
parent199a6eb7a3600dfbd962c1e2a4a4f677b126262e (diff)
downloadbugzilla-a0256cf7a6d211d0b38a6fa158be2420275e63ff.tar.gz
bugzilla-a0256cf7a6d211d0b38a6fa158be2420275e63ff.tar.xz
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
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 {