Bug #16633
closedt3lib_db::listQuery uses LIKE instead of FIND_IN_SET()
0%
Description
As t3lib_db is Mysql-specific it should make use of Mysql's complete set of functions.
(issue imported from #M4359)
Updated by Michael Stucki about 18 years ago
I tried to change this. Honestly, I didn't know about FIND_IN_SET before, but found some documentation about it.
Finally I have changed the listQuery() according to your suggestion, but now I'm getting MySQL errors all the time.
After tracking this down I can reproduce the error using this query:
SELECT pages.uid,sys_domain.*
FROM pages,sys_domain
WHERE (
pages.uid=sys_domain.pid AND
sys_domain.hidden=0 OR
FIND_IN_SET ('0',pages.fe_group) > 0
)
LIMIT 1
It will fail for some reason. However, after removing the "LIMIT 1" statement, the query works with no problem.
Anybody knowing what's wrong here?
Updated by Marc Wöhlken about 18 years ago
It will fail for some reason. However, after removing the "LIMIT 1" statement, the
query works with no problem.
The find_in_set function does not work correctly on varchar-fields like pages.fe_group. Use it to search set type fields only.
Regards
Marc
Updated by Martin Kutschker over 17 years ago
If it works only on SETs it's not of much help, so closing this bug.