[TYPO3-core] RFC #16508: Bug: tcaTree is not compatible DBAL due to mySQL specific use of CONCAT

Xavier Perseguers typo3 at perseguers.ch
Tue Nov 23 13:27:27 CET 2010


Hi Steffen,

> Problem:
> as already discussed in 0016336, the Usage of concat with more than 2
> parameters only is supported by MySQL.
> Fix it, to make the Tree Available with other DBMSs, too.
>
> Solution:
> cite Xavier:
> IND_IN_SET should be used whenever you want to search for (typically for
> us) an id stored in a comma-separated list
> we have native support for MySQL, efficient support for MSSQL and
> PostgreSQL and fallback but still OK support for Oracle
> FIND_IN_SET(<search>, <list>) > 0
> There's already a few calls in core for FIND_IN_SET (not many). Point is
> to add "> 0" at the end for best DBAL support even if it is optional in
> MySQL

+1 by reading (as I did not provide the patch :D)

Sidenote: this CONCAT code was weird because this was not the official 
way of querying such a field when FIND_IN_SET was not available, our 
official way was to issue a whole "subquery" (pseudocode):

AND (
	column = $uid
	OR column LIKE $uid . ',%'
	OR column LIKE '%,' . $uid
	OR column LIKE '%,' . $uid . ',%'
)

You still find this way of querying the column when using Oracle. The 
only difference is that LIKE gets then remapped to some higher 
performance operator for querying text fields.

Cheers
Xavier


More information about the TYPO3-team-core mailing list