Bug #21514
closedDAM-related: Element browser crashes as where-clause cannot be parsed
0%
Description
DAM issue queries containing a LIKE BINARY operator.
I found a discussion:
http://lists.typo3.org/pipermail/typo3-project-dam/2008-January/001507.html
I suggest to drop the BINARY operator if found after LIKE or NOT LIKE. It is possible to do something better later, such as supporting a "LIKE BINARY" or "NOT LIKE BINARY" operator, but it should then be mapped to something that is handled by the underlying DBMS.
(issue imported from #M12535)
Files
Updated by Xavier Perseguers about 15 years ago
After discussion with Ries, it might be interesting in case PostgreSQL is used to remap LIKE and NOT LIKE to ILIKE and NOT ILIKE and remap "LIKE BINARY" and "NOT LIKE BINARY" to LIKE and NOT LIKE.
For MySQL, it would be left as is and for other DBMS, we should see on a case by case basis but basically the idea would be to drop the BINARY operator.
Idea is not to implement full support of BINARY operator (as described on http://dev.mysql.com/doc/refman/5.0/en/charset-binary-op.html ) but only to support it after "LIKE".
Another solution for PostgreSQL is to define case-sensitive or insensitive behavior when creating the table: http://www.postgresql.org/docs/8.4/static/citext.html
Updated by Philipp Thiele over 14 years ago
Patch v2 works for me (TYPO3 4.3.3, DBAL 1.0.4 with Oracle 11g), but location given in diff-file (class.ux_t3lib_sqlparser.php) is wrong now (i think, Xavier, you have moved some methods from class.ux_t3lib_sqlparser to class.t3lib_sqlparser before DBAL version changed to 1.0).
So I had to patch class.t3lib_sqlparser.php instead of the DBAL x-class. I don't know if this is correct, but this still works.
Is there any technical reason why this patch isn't added to trunk already?
Updated by Xavier Perseguers over 14 years ago
The reason is that I waited for some feedback before changing this behavior. Feature freeze is there for a while now for TYPO3 4.4, meaning I may commit this once development of 4.5 starts, in 1 month or so...
Updated by Xavier Perseguers over 14 years ago
Well, having a look again at this bug, in fact v2 should not be somehow "applied" to Core itself as it contains DBAL-related code. Instead, SQL parser in Core should handle BINARY keyword and v2 should be adapted to remap this additional keyword in DBAL according to the underlying driver.
Updated by Xavier Perseguers over 14 years ago
Committed to:
- TYPO3 trunk (rev. 8531)
- DBAL trunk (rev. 36497)