Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
search.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2008 at 15:37 UTC
Updated:
27 Aug 2008 at 17:02 UTC
PostgreSQL (at least on 8.3), returns an error when AND is used between and integer and a boolean. The search module is bitten by that, because it sometimes generates queries such as:
SELECT xxx FROM yyy WHERE 1 AND (i.word = ?)
Here is a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| search-postgres-and.patch | 880 bytes | damien tournoud |
Comments
Comment #1
dries commentedA better solution might be to remove the
WHERE 1or theWHERE 1 = 1?Comment #2
damien tournoud commentedThis will be much simpler to do as part of #258998: do_search refactoring: performance, legibility, move validation to validation/submit handlers of form., I will post a note there.
In the meantime, I would like to see the simple fix here committed, as it probably breaks search on 6.x.
Comment #3
dries commentedOK, let's go with this fix for the time being. Committed to CVS HEAD and DRUPAL-6. Thanks.
Comment #4
chx commentedIf postgresql can't take 1 for TRUE then it's broken and we should drop support. Not for the first time we committed a hack just to support a database where the theory fanatics so galopped away that it's no longer useable for a web app.
Edit: why a web app? Because with a web app, much less than a desktop app, you need casting all the time -- whatever comes from the browser is a string etc.
Comment #5
Freso commentedIf the work-around has been committed and the proper fix will be a part of #258998: do_search refactoring: performance, legibility, move validation to validation/submit handlers of form., isn't this fixed now?
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.