[TYPO3-core] RFC #15001: Bugfix: It is not possible to search for '%' or '_' inside the Backend

Xavier Perseguers typo3 at perseguers.ch
Sun Jul 18 13:09:39 CEST 2010


Hi,

>> Xavier, do you think it's possible to apply the same changes to DBAL so
>> we get consistent behavior?
>
> If I'm right, the dbal is xclassing the localrecordlist just because of
> the fact that the "makeSearchString" function does not uses
> t3lib_db->searchQuery. To be consistent we should add the searchQuery
> function to the dbal xclass of t3lib_db and remove the xclass of
> localrecordlist.
>
> In the path v2 I moved all dbal-related stuff to the class ux_t3lib_db, so
> the xclass of localrecordlist should be deleted. I also made some code
> cleaning.

This means class.ux_db_list_extra.php should be removed when committing.

Attached is v3 which fixes some issues both in non-DBAL and DBAL. In 
non-DBAL the query was wrongly created due to mixup with ".=" operator 
when building query. In DBAL, parent::searchQuery() was always called 
even if the list of fields was empty (when the database contains some 
log/debug table with only blob fields for instance).

+1 by reading and testing for non-DBAL

However the patch for DBAL still is not valid, at least for Oracle (I'm 
always testing it first there and then in other DBMS). Problem is that 
Oracle needs a special way of searching for wildcard characters. What is 
done with the patch is that for any page whose title contains '%':

SELECT * FROM pages WHERE title LIKE '%\%%'

However with Oracle this does not work, one has to write (quotes added 
to be Oracle compatible):

SELECT * FROM "pages" WHERE "title" LIKE '%\%%' ESCAPE '\'

and this is currently not supported by DBAL. However this works:

SELECT * FROM "pages" WHERE (dbms_lob.instr("title", '%', 1, 1) > 0)

This should be still investigated.

Xavier
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 15001_core_v3.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100718/16bea881/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 15001_dbal_v3.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100718/16bea881/attachment.txt>


More information about the TYPO3-team-core mailing list