Hi I'm running a postgres 8.3 database with the finder module. If doing a search on an integer field, I'm searching on node id, I get an error.
Here's the query that throws an error:
SELECT COUNT(*) FROM node node WHERE node.type IN ('repair_order') AND node.status = 1 AND (node.nid LIKE '%8%')
But if I cast the nid as text it works:
SELECT COUNT(*) FROM node node WHERE node.type IN ('repair_order') AND node.status = 1 AND (node.nid::text LIKE '%8%')
So perhaps type casting could be added to the module to support postgres? I can't imagine it would cause any problems with mySQL...
Thanks for the great module!
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | finder_typecast.patch | 1.64 KB | Redocbew |
Comments
Comment #1
Redocbew commentedFirst Contributed Patch!
Added a helper function to determine database type and include explicit typecasting if required
Comment #2
danielb commentedThanks for bringing my attention to this. I am sure this problem will be in a couple other places too, so I will carefully review where this is and get back to you.
Comment #3
danielb commentedI am going to make this change to finder_placeholder(), I believe it will have the same effect and won't require me to update all the query calls in different places
Comment #4
danielb commented