[TYPO3-dam] "LIKE BINARY" in SQL-Queries forces errors on PostgreSQL
Andreas Wolf
typo3ml at andreaswolf.info
Thu Jan 3 10:27:22 CET 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Michiel Roos schrieb:
> Christian Trabold wrote:
>> In some places DAM uses "LIKE BINARY" for binary safe comparisons of the
>> filepaths. Examples:
>>
>> /components/class.tx_dam_selectionFolder.php
>>
>> $query.= ' LIKE BINARY
>> '.$GLOBALS['TYPO3_DB']->fullQuoteStr($likeStr.'%', 'tx_dam');
>>
>>
>> /class.tx_dam_db.php
>>
>> $where['file_path'] = 'tx_dam.file_path LIKE BINARY
>> '.$GLOBALS['TYPO3_DB']->fullQuoteStr($likeStr.'%', 'tx_dam');
If I interpret the clause correctly, it casts the $likeStr to binary
values, i.e. changes the representation to the character codes, thus
making the comparison case-sensitive.
>> I wonder, if the "BINARY" operator is really mandatory to run DAM. What
>> do you think?
>>
>> I'd also really appreciate it, if someone could elaborate, why the
>> BINARY-Operator was implemented. Maybe we can find a DBAL-compliant
>> solution.
I suppose it has been used to implement a case-sensitive comparison on
MySQL < 4.1. At least that's what the comment by Paul Masri on [1] suggests.
I can't see a reason why this should be neccessary - but perhaps there
are others with more experience in MySQL details who can shed some more
light on this...
[1] http://dev.mysql.com/doc/refman/5.1/en/charset-binary-op.html
Cheers,
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQIVAwUBR3yqegJFrtzcYmY6AQgB2w/9Gum9c6bn0ePIBHy7VP30Am9w8zyEjJ0a
vvHPI8yCZmTnoTxMPU5TWl6HLQIw0FxdTEGEOXc+SuAm2skjcFUsiAFpNUbtgm/+
6YBZq/2yjCiXMRG+b7P4uGulWVrqJ2AYy/zvLdM/J+BbDd3urMN73fY5kF7OmNC7
Ng9r6VweiBAhtNYquxXUY5MbWnGTQrkbislEX8ZFQC+4oQ2y4TnPaXkMeFfnSRji
bNn0IZsJs259cXnFIApO4q/H9QcMenlFJIqMmMoywDMNZTlynufurt5lU86a5SrL
bL2e0AnZDXj4s+/CpsgcTliyFoNlqF8sUWJjKY2Q6rSxU6BXuXTi/DBj7uArXRU9
e9WfD6iM06kQJvtcIGPs9/3eJwV904Fxs/mRgqVBDHcw3rdsu+M8j/FlgaQoV2PY
+bLEUBu7jPf7wUGq7TsHzY5xVvfQ8T/kf5mToQwN/s11lox6gtmeKjcRSHjKt6Lf
Y0j/E3zg6a4fcAkCr6aKw3NNUkq6LJWaxzxSivAdbhOr7oOnyNZBuNoYazoMzKoR
q6qJs4ZhhDr/osAB0OHooMCGGiufnnrbC1bVe/cya9J46laHKE5maOQXceylwuNU
QI9KPgMTBuUfTZ5QMWeQ5jXNjieWmucgV8DA/Oyly7HgFawjzpIqEfYzv6CWYw1G
sOHUd3IzIDU=
=YGzG
-----END PGP SIGNATURE-----
More information about the TYPO3-project-dam
mailing list