Bug #57385
closed
Missing handling of caseSensitive in like Query
Added by Patrick Crausaz over 10 years ago.
Updated about 6 years ago.
Description
The "like" method of TYPO3\CMS\Extbase\Persistence\Generic\Query does not handle the given $caseSensitive parameter.
The query will always select be case sensitive, no matter what setting is given to this method.
Patrick Crausaz wrote:
The query will always select be case sensitive, no matter what setting is given to this method.
AFAIS is the query always case insensitive, at least that's the default behavior in MySQL. Thus you get the same results for "foo%" and "Foo%".
Anyways, it should be pretty straightforward porting the implementation from TYPO3 Flow here.
- Project changed from 534 to TYPO3 Core
- Description updated (diff)
- Category changed from Extbase to Extbase
- Target version changed from Extbase 6.2 to next-patchlevel
- TYPO3 Version set to 6.2
- Is Regression set to No
- Target version deleted (
next-patchlevel)
- Status changed from New to Under Review
- Status changed from Under Review to New
- Target version set to Candidate for Major Version
Actually it's not straight forward to fix this and the backport from flow will not make the situation any better. Reason is that the case sensitivity for the search is related to the DBMS settings, in MySQL it's based on the collation of the database/table/field. If it's a collation that ends with _ci the comparison will be done case insensitive, if it ends with _cs it will be case sensitive. In addition the type of the column also plays a role, binary type columns are always case sensitive.
So the caseSensitive parameter actually boils down to two choices:
1. Let the DBMS decide wether to do a case sensitive or insensitive search based on the appropriate settings
2. Force a case insensitive comparison using LOWER
Both solutions don't enable me to force a case sensitive comparison as the parameter name suggests.
Proposal: Remove the case sensitive parameter with a breaking change in 8 as it's broken by design.
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF