Project

General

Profile

Actions

Bug #83074

open

The inSet (FIND_IN_SET) function generates invalid SQL

Added by Thanos no-lastname-given over 6 years ago. Updated 9 months ago.

Status:
Accepted
Priority:
Could have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2017-11-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When building a custom query with getQueryBuilderForTable using the The inSet function in ExpressionBuilder.php, the SQL is wrong because the function returns the pair of fieldName - value in reverse order.

The solution is to change the line 364 of ExpressionBuilder.php to

return sprintf(
  'FIND_IN_SET(%s, %s)',
   $this->connection->quoteIdentifier($fieldName),
   $value
);

or to use plain sql to the query builder: 'FIND_IN_SET(el.element_type, '. $allowedTypes . ')', but with the addition single quotes in the argument string : "'x,c,z'"


Files

patch.diff (570 Bytes) patch.diff Thanos no-lastname-given, 2017-11-23 19:34

Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Task #99451: PHPDoc, name of arguments and documentation not very intuitive for ExpressionBuilder::inSetNew2023-01-03

Actions
Actions

Also available in: Atom PDF