[TYPO3-core] RFC: #9944: Feature: Unneccessary wildcard string comparisons in EM

Marcus Krause marcus#exp2008 at t3sec.info
Mon Dec 15 11:45:59 CET 2008


Hi!

This is an SVN patch request.

Type: feature

Branches: trunk

Bugtracker reference: http://bugs.typo3.org/view.php?id=9944


Problem:
On several places [1] within EM, TYPO3 uses wildcard character '%'
prepended and appended to existing and valid extension keys when
searching in cache_extensions DB table. This is due to the fact that the
API lacks of a config option to search for exact matches only.

This is kind of stupid as we know that e.g. aboutmodules is an existing
and valid extension key. Why then search for %aboutmodules%.

[1] search for extension updates; bulk import of extensions; show
details of extensions

Solution:
Introduce a new boolean parameter $exactMatch for method
searchExtensionsXML(); default is false. If true a query like
AND extkey = "EXTKEY"
is created instead of
AND extkey LIKE '%EXTKEY%'

Notes:
The patch reorders parameters of method searchExtensionsXML(), i.e. not
appending the new parameter at the end but instead in between existing
ones. I now that this breaks backward compatibility but I took care that
all method calls in module em are updated to reflect this. The reason
for doing it that way is the fact that the new order reflects importance
of this parameter. Also I don't want that method calls have to provide a
default limit number only to be able to set $exactMatch parameter.
See bugtracker for query logs, performance impact, query planner.

Marcus.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 9944.diff
Type: text/x-patch
Size: 4145 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20081215/8354378c/attachment.bin 


More information about the TYPO3-team-core mailing list