From 0811ac92bf752121208867728aa4629b9eb9c02a Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Fri, 8 Jul 2005 09:34:03 +0000 Subject: Bug 292119: [PostgreSQL] POSITION(...) clause "must be type boolean, not type integer" Patch By Max Kanat-Alexander r=dkl, a=justdave --- Bugzilla/Search.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Bugzilla/Search.pm') diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index f0bc0b6fe..e69c3232f 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -988,10 +988,10 @@ sub init { $term = "$ff != $q"; }, ",casesubstring" => sub { - $term = $dbh->sql_position($q, $ff); + $term = $dbh->sql_position($q, $ff) . " > 0"; }, ",substring" => sub { - $term = $dbh->sql_position(lc($q), "LOWER($ff)"); + $term = $dbh->sql_position(lc($q), "LOWER($ff)") . " > 0"; }, ",substr" => sub { $funcsbykey{",substring"}->(); @@ -1466,7 +1466,7 @@ sub ListIDsForEmail { } elsif ($type eq 'substring') { &::SendSQL("SELECT userid FROM profiles WHERE " . $dbh->sql_position(lc(::SqlQuote($email)), "LOWER(login_name)") . - " " . $dbh->sql_limit(51)); + " > 0 " . $dbh->sql_limit(51)); while (&::MoreSQLData()) { my ($id) = &::FetchSQLData(); push(@list, $id); @@ -1522,7 +1522,7 @@ sub GetByWordListSubstr { foreach my $word (split(/[\s,]+/, $strs)) { if ($word ne "") { push(@list, $dbh->sql_position(lc(::SqlQuote($word)), - "LOWER($field)")); + "LOWER($field)") . " > 0"); } } -- cgit v1.2.3-24-g4f1b