summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB/Pg.pm
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-03-09 08:23:30 +0100
committermkanat%kerio.com <>2005-03-09 08:23:30 +0100
commit5be75754f810eb414b666f3894e2dbf8943e3f0f (patch)
tree5c91e75fa2aaf9ad93e570396834d161b1aedfb1 /Bugzilla/DB/Pg.pm
parent3f4abbd8d47883c52cdbd25ce308fe7d638f25ce (diff)
downloadbugzilla-5be75754f810eb414b666f3894e2dbf8943e3f0f.tar.gz
bugzilla-5be75754f810eb414b666f3894e2dbf8943e3f0f.tar.xz
Bug 281582: Replace CONCAT and MATCH with Bugzilla::DB function call (Note: This patch also creates a database-agnostic fulltext search method.)
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=myk
Diffstat (limited to 'Bugzilla/DB/Pg.pm')
-rw-r--r--Bugzilla/DB/Pg.pm11
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) = @_;