Project

General

Profile

Actions

Bug #27134

closed

wrong where clause compilation with multiple FIELD_IN_SET query parts

Added by Georg Schönweger almost 13 years ago. Updated almost 13 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
Start date:
2011-05-30
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

It seems there is a bug in class t3lib/class.t3lib_sqlparser.php in function compileWhereClause. I need to concatenate multiple FIELD_IN_SET query parts in my extbase extension so i did;

$query->matching(
$query->logicalOr(
$query->contains('usergroup',4),
$query->equals('uid',2),
$query->equals('uid',1),
$query->contains('usergroup',5)
)
);

this will produce a SELECT statement where all query parts before the last "contains" part ($query->contains('usergroup',5)) get lost. So the resulting SELECT statement of the above query is;

(FIND_IN_SET(5, fe_users.usergroup)) AND (fe_users.tx_extbase_type = '0') AND fe_users.deleted = 0 AND fe_users.disable = 0 AND fe_users.starttime <= 1306742460 AND (fe_users.endtime = 0 OR fe_users.endtime > 1306742460)

I attached the $clauseArray so you can reproduce easily this behavior by calling the function compileWhereClause in t3lib/class.t3lib_sqlparser.php directly.


Files

FIELD_IN_SET-concatenation-query.txt (8.67 KB) FIELD_IN_SET-concatenation-query.txt $clauseArray to reproduce the bug Georg Schönweger, 2011-05-30 10:29

Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #25488: compileWhereClause causes Extbase errors with DBAL due to wrong handling of FIND_IN_SETClosedXavier Perseguers2011-03-31

Actions
Actions #1

Updated by Xavier Perseguers almost 13 years ago

Please check whether it's related to http://forge.typo3.org/issues/25488

Actions #2

Updated by Georg Schönweger almost 13 years ago

Yes the patch at http://forge.typo3.org/issues/25488 resolves the problem, thank you :)

Actions #3

Updated by Xavier Perseguers almost 13 years ago

  • Status changed from New to Rejected
Actions #4

Updated by Xavier Perseguers almost 13 years ago

Hi Georg, could you please vote for exactly the same patch in branch master (4.6) on Gerrit? Thanks.

Actions

Also available in: Atom PDF