]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 286392: String concatenation on postgres does not always work
authormkanat%kerio.com <>
Thu, 17 Mar 2005 14:54:05 +0000 (14:54 +0000)
committermkanat%kerio.com <>
Thu, 17 Mar 2005 14:54:05 +0000 (14:54 +0000)
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=justdave

Bugzilla/DB.pm
Bugzilla/DB/Pg.pm

index 0d41bbd01015b688eff5cc3d4e02db48e1591c15..1c2bcbf992ccf19967207148ef27558a8aff7b5d 100644 (file)
@@ -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 {
index de3260e7a4017ed15d33d52b98d2fbd68559463a..be921f4d17eeb66c2d07c5530ef31795c9f0cc64 100644 (file)
@@ -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 {