Bug #103961
closedPostgres: Extbase LIKE query is case sensitive
100%
Description
While updating a pretty old site to 12.4 i stumbled up on a like query that is now executed case sensitive.
Similar to #98570 --> \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::parseDynamicOperand
Kind of ugly to patch that in there, but seems to do the job.
case QueryInterface::OPERATOR_LIKE: $placeHolder = $this->createTypedNamedParameter($value, Connection::PARAM_STR); $platform = $this->queryBuilder->getConnection()->getDatabasePlatform(); if ($platform instanceof \Doctrine\DBAL\Platforms\PostgreSQLPlatform) { $expr = $exprBuilder->comparison($fieldName, 'ILIKE', $placeHolder); } else { $expr = $exprBuilder->comparison($fieldName, 'LIKE', $placeHolder); } break;
It seems that the old adodb/dbal setup automatically used ILIKE for Postgres
if ($isLikeOperator && $functionMapping) { if ($this->databaseConnection->runningADOdbDriver('postgres') || $this->databaseConnection->runningADOdbDriver('postgres64') || $this->databaseConnection->runningADOdbDriver('postgres7') || $this->databaseConnection->runningADOdbDriver('postgres8')) { // Remap (NOT)? LIKE to (NOT)? ILIKE // and (NOT)? LIKE BINARY to (NOT)? LIKE switch ($v['comparator']) { case 'LIKE': $v['comparator'] = 'ILIKE'; break; case 'NOT LIKE': $v['comparator'] = 'NOT ILIKE'; break; default:
Maybe the old behavior should be restored? I'm fine with having my instance patched though if you'd like to stick to the defaults
Updated by Andreas Kießling 6 months ago
- Related to Epic #90719: PostgreSQL related issues added
Updated by Gerrit Code Review 6 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84451
Updated by Gerrit Code Review 6 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84451
Updated by Gerrit Code Review 6 months ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84451
Updated by Gerrit Code Review 6 months ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84451
Updated by Gerrit Code Review 6 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84534
Updated by Georg Ringer 6 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 7f706d2c32c758c3e7bb4ad280bba6663551344b.