Bug #57385

Missing handling of caseSensitive in like Query

Added by Patrick Crausaz over 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Start date:
2014-03-27
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

Associated revisions

Revision 6c497f49 (diff)
Added by Morton Jonuschat about 3 years ago

[TASK] Deprecate caseSensitive parameter of Extbase Query::like

In contrast to a case insensitive query a case sensitive query can
not be enforced as it largely depends on the settings of the database
system. Deprecate the parameter as it isn't used at all and log
an appropriate notice.

Change-Id: Ie767c6a9d5d3de5857c7a3bf38a5dd43ce580d07
Resolves: #57385
Releases: master
Reviewed-on: https://review.typo3.org/49856
Reviewed-by: Frank Naegler <>
Tested-by: Frank Naegler <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>

History

#1 Updated by Mathias Brodala over 5 years ago

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.

#2 Updated by Alexander Opitz about 5 years ago

  • Project changed from Extbase MVC Framework 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

#3 Updated by Mathias Schreiber about 4 years ago

  • Target version deleted (next-patchlevel)

#4 Updated by Gerrit Code Review almost 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44968

#5 Updated by Morton Jonuschat almost 4 years ago

  • 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.

#6 Updated by Gerrit Code Review about 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49856

#7 Updated by Gerrit Code Review about 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49856

#8 Updated by Gerrit Code Review about 3 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49856

#9 Updated by Morton Jonuschat about 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#10 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF