summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-12-05 18:04:47 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2011-12-05 18:04:47 +0100
commit6b0315b816c479f90117b69c9ff57d9c843b9397 (patch)
tree211b3c62f4d0ac1678855637e95b51c1a209cb3a /Bugzilla/DB.pm
parent848da716b1624bd53d7ab18dde22b09b2a0163b9 (diff)
downloadbugzilla-6b0315b816c479f90117b69c9ff57d9c843b9397.tar.gz
bugzilla-6b0315b816c479f90117b69c9ff57d9c843b9397.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 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 {