Commit 8bb3cb2a authored by mkanat%kerio.com's avatar mkanat%kerio.com

Bug 286392: String concatenation on postgres does not always work

Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=justdave
parent 27767372
...@@ -225,7 +225,7 @@ sub sql_group_by { ...@@ -225,7 +225,7 @@ sub sql_group_by {
sub sql_string_concat { sub sql_string_concat {
my ($self, @params) = @_; my ($self, @params) = @_;
return join(' || ', @params); return '(' . join(' || ', @params) . ')';
} }
sub sql_fulltext_search { sub sql_fulltext_search {
......
...@@ -137,7 +137,7 @@ sub sql_string_concat { ...@@ -137,7 +137,7 @@ sub sql_string_concat {
# Postgres 7.3 does not support concatenating of different types, so we # 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 # 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. # 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 { sub bz_lock_tables {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment