Bug #16633
closed
t3lib_db::listQuery uses LIKE instead of FIND_IN_SET()
Added by Martin Kutschker about 18 years ago.
Updated over 17 years ago.
Category:
Database API (Doctrine DBAL)
Description
As t3lib_db is Mysql-specific it should make use of Mysql's complete set of functions.
(issue imported from #M4359)
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?
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
If it works only on SETs it's not of much help, so closing this bug.
Also available in: Atom
PDF