Bug 48807 - AutoFilter in form uses field value as LIKE pattern
Summary: AutoFilter in form uses field value as LIKE pattern
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.3.4 release
Hardware: All Linux (All)
: medium normal
Assignee: Lionel Elie Mamane
URL:
Whiteboard: target:3.7.0
Keywords:
Depends on:
Blocks: 42120
  Show dependency treegraph
 
Reported: 2012-04-17 02:14 UTC by Lionel Elie Mamane
Modified: 2012-09-14 13:54 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
testcase (10.43 KB, application/vnd.oasis.opendocument.database)
2012-04-17 02:15 UTC, Lionel Elie Mamane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Elie Mamane 2012-04-17 02:14:20 UTC
Test case: see attachment 52678 [details] of bug 42120.

1) Add a record with fname='A*' and lname left blank (or any arbitrary value).
2) Position form on this record.
3) Click on AutoFilter button (Filters the records, based on the content of the currently selected field)

Result is two records, namely "Alex Thurgood" and "A*". "Alex Thurgood" should not be in the results, since the fname is not "A*", but is "Alex".

The problem is that the generated filter is "fname LIKE 'A*'" instead of "fname = 'A*'". The "A*" in the fname field in the newly inserted record is a *value* and should not silently be treated as a *pattern*.

Note that when doing AutoFilter on lname, the generated filter is "IS EMPTY" (a synonym for "IS NULL"), not "LIKE NULL" or "LIKE ''". That is good.
Comment 1 Lionel Elie Mamane 2012-04-17 02:15:20 UTC
Created attachment 60151 [details]
testcase

testcase with "A*" already added.
Comment 2 sasha.libreoffice 2012-04-17 02:31:01 UTC
Thanks for bugreport
May be in navigator should be some check field "use patterns"? When checked, should added LIKE ' ' around.
Comment 3 Lionel Elie Mamane 2012-04-17 04:25:37 UTC
(In reply to comment #2)
> Thanks for bugreport
> May be in navigator should be some check field "use patterns"? When checked,
> should added LIKE ' ' around.

IMO, for AutoFilter, this does not make any sense. For "filter by form", it could possibly maybe make sense, but then this comment belongs to bug 42120, not here.
Comment 4 sasha.libreoffice 2012-04-18 02:04:23 UTC
Sorry. Indeed for  bug 42120. May be we should change it to Functionality request?
Comment 5 Jochen 2012-08-27 18:09:28 UTC
@Robert
Please: have a look on this bugreport. What is your opinion?
Comment 6 Not Assigned 2012-08-30 03:29:26 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3655f2546500d52f2e555fb8d4964a26cf0f341e

fdo#48807 autofilter should not use LIKE operator
Comment 7 Lionel Elie Mamane 2012-09-14 09:39:39 UTC
We decided not to backport this to 3.6.x, as it is a behaviour change.
Comment 8 sasha.libreoffice 2012-09-14 13:54:51 UTC
Thanks for fixing this bug