Project

General

Profile

Actions

Bug #23103

closed

It is not possible to search for '%' or '_' inside the Backend

Added by Caspar Stuebs almost 14 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2010-07-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Neither with the search-button in the Backend-Toolbar, nor within the Admin-Tool 'DB check' with the 'full search' function, it is possible to search for the chars '%' and '_'.

Both functions does not escape the named chars for using inside the like-query, so they are interpreted as wildcards by sql.

Additionally the Toolbar-search does not use the function t3lib_db->searchQuery, which should be used for dbal support.

Solution:
adding t3lib_db->escapeStrForLike into t3lib_db->searchQuery
using t3lib_db->searchQuery inside the Toolbar-search (class.db_list.inc)

see patch
(issue imported from #M15001)


Files

bug_15001.patch (1.24 KB) bug_15001.patch Administrator Admin, 2010-07-05 00:29
15001_core_v3.diff (2.34 KB) 15001_core_v3.diff Administrator Admin, 2010-07-20 07:57
15001_dbal_v4.diff (12.4 KB) 15001_dbal_v4.diff Administrator Admin, 2010-07-20 07:57
15001_dbal_v5.diff (12.4 KB) 15001_dbal_v5.diff Administrator Admin, 2010-08-12 01:18

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #23223: BE Search: no results for double-byte characters, e.g. JapaneseClosedChristian Kuhn2010-07-18

Actions
Actions #1

Updated by Xavier Perseguers almost 14 years ago

Just uploaded 15001_core_v3.diff (from mailing list) and a new version of DBAL's patch (15001_dbal_v4.diff) which does not exist in ML but works at least with unit tests. Will have to test it on real DBMS.

Actions #2

Updated by Caspar Stuebs over 13 years ago

Uploaded a new version of DBAL's patch (15001_dbal_v5.diff)

searchQuery() should only add the ' OR ' to the query, if both parts contains data, not only the first one...

Actions #3

Updated by Xavier Perseguers over 13 years ago

Hi,

Thanks for the patch. After testing, I found a bug. Search is issed on all columns regardless of their type. In particular:

SELECT COUNT FROM "sys_language" WHERE "pid" IN (22,23,0) AND ((dbms_lob.instr("uid", 'page',1,1) > 0) OR (dbms_lob.instr("title", 'page',1,1) > 0))

This makes the query crash with Oracle as search for 'page' in column "uid" is incorrect. MySQL silently allows this but it does not make sense. As such, patch should be enhanced to search for non-numeric content only on non-numeric columns

Actions #4

Updated by Stefan Neufeind about 12 years ago

  • Target version deleted (0)

Any chance to get this ironed out and send the patch for review maybe?

Actions #5

Updated by Caspar Stuebs about 10 years ago

  • % Done changed from 0 to 100

I tested this again and it seems like this bug is solved in 6.x Versions. It can be closed.

Actions #6

Updated by Stefan Neufeind about 10 years ago

  • Status changed from New to Closed
  • Is Regression set to No

Closing as requested. Seems to be resolved in 6.x.

Actions

Also available in: Atom PDF