Bug 116772 - Using LIKE in query assistant
Summary: Using LIKE in query assistant
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.3.1.2 release
Hardware: All All
: high major
Assignee: Lionel Elie Mamane
URL:
Whiteboard: target:6.1.0 target:6.0.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Database-Queries
  Show dependency treegraph
 
Reported: 2018-04-03 13:23 UTC by hug.charlotte@gmail.com
Modified: 2018-05-29 09:58 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Step 3 query assistant LIKE query (24.30 KB, image/png)
2018-04-05 13:49 UTC, hug.charlotte@gmail.com
Details
Step 8 query assistant LIKE query (28.67 KB, image/png)
2018-04-05 13:50 UTC, hug.charlotte@gmail.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hug.charlotte@gmail.com 2018-04-03 13:23:54 UTC
Description:
When executing Query Assistant with LIKE criteria, the assistant does not execute it at all. Results do no take into account the criteria LIKE 'string'

Steps to Reproduce:
1.execute query assistant
2.in research criteria, step 3, use LIKE or COMME (in french) and 'string'
3.'string' is replace by 0 when following the configuration of the query
4. results do no take into account the LIKE criteria

Actual Results:  
1.execute query assistant
2.in research criteria, step 3, use LIKE or COMME (in french) and 'string'
3.'string' is replace by 0 when following the configuration of the query
4. results do no take into account the LIKE criteria

Expected Results:
4. results do no take into account the LIKE criteria


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: fr
Module: OfficeDatabaseDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: yes


User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:59.0) Gecko/20100101 Firefox/59.0
Comment 1 Alex Thurgood 2018-04-05 08:16:03 UTC
No repro with

Version: 6.0.1.1
Build ID: 60bfb1526849283ce2491346ed2aa51c465abfe6
Threads CPU : 4; OS : Mac OS X 10.13.3; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group

1) Open a test database containing with a table containing text data.
2) Create new query via UI Query Designer
3) Add table
4) Select table field(s) to display
5) In the Criteria box of the field on which to use the LIKE operator, enter:

LIKE '*string_to_search*'

6) Press the execute query button
7) Query executes and returns correct entries.
Comment 2 Alex Thurgood 2018-04-05 08:20:59 UTC
Also tested with

Version: 5.4.5.1
Build ID: 79c9829dd5d8054ec39a82dc51cd9eff340dbee8
Threads CPU : 4; OS : Mac OS X 10.13.3; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group

No repro, the LIKE operator works for me, at least on text strings.


@hug.charlotte : please provide us with either a test case ODB in which the problem is present, or else a detailed step-by-step description of how to reproduce the problem.

Setting to NEEDINFO.
Comment 3 hug.charlotte@gmail.com 2018-04-05 13:49:34 UTC
Created attachment 141129 [details]
Step 3 query assistant LIKE query
Comment 4 hug.charlotte@gmail.com 2018-04-05 13:50:00 UTC
Created attachment 141130 [details]
Step 8 query assistant LIKE query
Comment 5 hug.charlotte@gmail.com 2018-04-05 13:54:24 UTC
I add a constraint in step 3 using LIKE.
At step 8 : there is no sign of the constraint LIKE.
Moving back to step 3 : constraint has been deleted.

Many thanks for your help.
Comment 6 Alex Thurgood 2018-04-05 14:37:03 UTC
Ah, thank you, my bad, and apologies, I had overlooked that you were using the Query wizard.

This behaviour rings a bell as a duplicate.
Comment 7 Alex Thurgood 2018-04-05 14:45:05 UTC
Confirming with 

Version: 6.0.1.1
Build ID: 60bfb1526849283ce2491346ed2aa51c465abfe6
Threads CPU : 4; OS : Mac OS X 10.13.4; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group


When I reach the end of the wizard and try to execute the query by clicking on "Finish", I get the following error message :

SELECT "table"."ID" AS "ID", "table"."Description" AS "Description", "table"."Path_to_File" AS "Path_to_File" FROM "table" "table" WHERE ("table"."Path_to_File" LIKE )

Indeed, one can see that the LIKE search string has not been passed to LO's built-in query parser.


==>> REGRESSION
Comment 8 Alex Thurgood 2018-04-05 14:55:33 UTC
Works correctly in 

Version: 5.2.7.2
Build ID: 2b7f1e640c46ceb28adf43ee075a6e8b8439ed10
Threads CPU : 4; Version de l'OS :Mac OS X 10.13.4; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group
Comment 9 Alex Thurgood 2018-04-05 15:00:01 UTC
First error message of failed query construction in :

Version: 5.3.1.2
Build ID: e80a0e0fd1875e1696614d24c32df0f95f03deb2
Threads CPU : 4; Version de l'OS :Mac OS X 10.13.4; UI Render : par défaut; Moteur de mise en page : nouveau; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group
Comment 10 Alex Thurgood 2018-04-05 15:03:17 UTC
Can't find any dupe. Oh well.
Comment 11 Xisco Faulí 2018-04-07 14:13:14 UTC
Regression introduced by:

author	Fabio Buso <dev.siroibaf@gmail.com>	2016-08-09 10:25:37 +0200
committer	Lionel Elie Mamane <lionel@mamane.lu>	2016-08-10 14:32:32 +0000
commit 2c76fd1e04441889fbc416d4e5815ef31b474193 (patch)
tree cd7aea0a33a0df8a3bef79ec801db5bed2fd62bf
parent d6e8d4f773d970b69baedd8523a426f18a8d8eef (diff)
tdf#67647 getStructuredFilter returns operator

Bisected with: bibisect-linux-64-5.3

Adding Cc: to Fabio Buso
Comment 12 Xisco Faulí 2018-04-07 14:13:46 UTC
@Lionel, I thought you might be interested in this one...
Comment 13 Lionel Elie Mamane 2018-04-08 06:32:58 UTC
The general problem with LIKE is fixed in https://gerrit.libreoffice.org/52573
The specific problem with wrong escaping of "'" as first character of value is fixed in https://gerrit.libreoffice.org/52575

Do not put "'" around the value unless you want to look for rows that do have "'" in the specified column.
Comment 14 Commit Notification 2018-04-08 15:06:42 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=e29435932d84076c4d9c443e6f6fd95a08799386

tdf#116772 adapt handling of LIKE conditions to cleaned up StructuredFilter

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2018-04-10 15:23:03 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=060e43da66c759de2c4799131e13c5156f01d492&h=libreoffice-6-0

tdf#116772 adapt handling of LIKE conditions to cleaned up StructuredFilter

It will be available in 6.0.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Xisco Faulí 2018-05-29 09:24:05 UTC
A polite ping to Lionel Elie Mamane: is this bug fixed? if so, could you
please close it as RESOLVED FIXED ? Thanks