diff options
Diffstat (limited to 'Bugzilla/DB/Pg.pm')
-rw-r--r-- | Bugzilla/DB/Pg.pm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index 9766da383..5963f5308 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -93,7 +93,7 @@ sub sql_not_regexp { } sub sql_limit { - my ($self, $limit,$offset) = @_; + my ($self, $limit, $offset) = @_; if (defined($offset)) { return "LIMIT $limit OFFSET $offset"; @@ -131,6 +131,15 @@ sub sql_interval { return "INTERVAL '$interval'"; } +sub sql_string_concat { + my ($self, @params) = @_; + + # 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)'; +} + sub bz_lock_tables { my ($self, @tables) = @_; |