From: mkanat%kerio.com <> Date: Thu, 17 Mar 2005 14:54:05 +0000 (+0000) Subject: Bug 286392: String concatenation on postgres does not always work X-Git-Tag: bugzilla-2.19.3~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bb3cb2ac9f523b9f840b26624a74bd4e8c81de2;p=thirdparty%2Fbugzilla.git Bug 286392: String concatenation on postgres does not always work Patch By Tomas Kopal r=mkanat, a=justdave --- diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 0d41bbd010..1c2bcbf992 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -225,7 +225,7 @@ sub sql_group_by { sub sql_string_concat { my ($self, @params) = @_; - return join(' || ', @params); + return '(' . join(' || ', @params) . ')'; } sub sql_fulltext_search { diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index de3260e7a4..be921f4d17 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -137,7 +137,7 @@ sub sql_string_concat { # Postgres 7.3 does not support concatenating of different types, so we # need to cast both parameters to text. Version 7.4 seems to handle this # properly, so when we stop support 7.3, this can be removed. - return 'CAST(' . join(' AS text) || CAST(', @params) . ' AS text)'; + return '(CAST(' . join(' AS text) || CAST(', @params) . ' AS text))'; } sub bz_lock_tables {