Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2006-10-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

As t3lib_db is Mysql-specific it should make use of Mysql's complete set of functions.

(issue imported from #M4359)

Actions #1

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?

Actions #2

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

Actions #3

Updated by Martin Kutschker over 17 years ago

If it works only on SETs it's not of much help, so closing this bug.

Actions

Also available in: Atom PDF