Closed Bug 292119 Opened 20 years ago Closed 19 years ago

[PostgreSQL] POSITION(...) clause "must be type boolean, not type integer"

Categories

(Bugzilla :: Bugzilla-General, defect, P1)

2.19.2
defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: afranke, Assigned: mkanat)

References

()

Details

Attachments

(1 file)

If I enter anything (e.g.: foo) in the Quicksearch box on http://landfill.bugzilla.org/bugzilla-tip-pg/ and submit the query, then Bugzilla will die with a Software error: DBD::Pg::st execute failed: ERROR: Argument of WHERE must be type boolean, not type integer [for Statement "SELECT products.id FROM products WHERE POSITION('foo' IN LOWER(products.name))"] at Bugzilla/DB.pm line 80 Bugzilla::DB::SendSQL('SELECT products.id FROM products WHERE POSITION(\'foo\' IN LO...') called at Bugzilla/Search.pm line 1487 Bugzilla::Search::build_subselect('bugs.product_id','products.id','products','POSITION(\'foo\' IN LOWER(products.name))') called at Bugzilla/Search.pm line 865 Bugzilla::Search::__ANON__ called at Bugzilla/Search.pm line 1269 Bugzilla::Search::init('Bugzilla::Search=HASH(0xa329890)') called at Bugzilla/Search.pm line 85 Bugzilla::Search::new('Bugzilla::Search','fields','ARRAY(0xa04e6d4)','params','Bugzilla::CGI=HASH(0xa2ff730)','order','ARRAY(0xa057504)') called at /var/www/html/bugzilla-tip-pg/buglist.cgi line 763
The fix for this is part of the patch at bug 285695. Try it again with that patch applied...
Depends on: 285695
Hardware: PC → All
Target Milestone: --- → Bugzilla 2.20
Assignee: general → mkanat
Summary: PgSQL: Quicksearch dies: POSITION(...) clause "must be type boolean, not type integer" → [PostgreSQL] Quicksearch dies: POSITION(...) clause "must be type boolean, not type integer"
Whiteboard: [blocker will fix?]
Version: unspecified → 2.19.2
No longer depends on: 285695
I've removed the code that will fix this from bug 285695, and am going to put it in this bug, instead.
Summary: [PostgreSQL] Quicksearch dies: POSITION(...) clause "must be type boolean, not type integer" → [PostgreSQL] POSITION(...) clause "must be type boolean, not type integer"
Whiteboard: [blocker will fix?]
Status: NEW → ASSIGNED
Priority: -- → P1
Attached patch v1 (deleted) — Splinter Review
OK, I've asked LpSolit for too many reviews, so this one's for Joel. :-) (If you have the time, Joel.) Basically, we just need to make sure that the POSITION clause has some boolean comparison operator when it's used in a boolean fashion. So that's what we do.
Attachment #188074 - Flags: review?(bugreport)
Comment on attachment 188074 [details] [diff] [review] v1 Hey, dkl, here's another one, if you've got a bit. I'd imagine you've probably also run into this one if you've been using 2.19.3.
Attachment #188074 - Flags: review?(bugreport) → review?(dkl)
Comment on attachment 188074 [details] [diff] [review] v1 Patch looks sane, applies cleanly and fixes the problem during my testing. r=dkl
Attachment #188074 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval? → approval+
Checking in checksetup.pl; /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl new revision: 1.411; previous revision: 1.410 done Checking in Bugzilla/Search.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v <-- Search.pm new revision: 1.98; previous revision: 1.97 done Checking in Bugzilla/User.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v <-- User.pm new revision: 1.60; previous revision: 1.59 done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Did you prepend " > 0" to every place that calls sql_position()? If so, why didn't you add the " > 0" within the method itself? The code would have read a lot better that way.
(In reply to comment #7) > If so, why didn't you add the " > 0" within the method itself? The code would > have read a lot better that way. Because we don't always use sql_position as a boolean condition. So the answer to the first question there is actually "no."
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: