Bug Hunting Session
Bug 58644 - EDITING: Auto-Filter removes brackets in Queries - Filter doesen't work in correlated Subqueries
Summary: EDITING: Auto-Filter removes brackets in Queries - Filter doesen't work in co...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.3.4 release
Hardware: Other All
: medium normal
Assignee: Lionel Elie Mamane
URL:
Whiteboard: target:4.2.0 target:4.1.0 target:4.0.5
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-22 08:59 UTC by Robert Großkopf
Modified: 2013-07-10 19:58 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Two queries. One works with autofilter in every field, the other doesn't work in the subquery. (4.02 KB, application/vnd.oasis.opendocument.base)
2012-12-22 08:59 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2012-12-22 08:59:08 UTC
Created attachment 71964 [details]
Two queries. One works with autofilter in every field, the other doesn't work in the subquery.

Create a query with a correlating subquery. 
I have made this in the attachment:
SELECT "ID", "Revenue", "Expense", ( SELECT SUM( "Revenue" ) - SUM( "Expense" ) FROM "Checkout" WHERE "ID" <= "a"."ID" ) AS "Balance" FROM "Checkout" AS "a"
Set autofilter for some fields.
Autofilter works with all fields, except the correlating subquery. It fails in the subquery with 
SELECT "ID", "Revenue", "Expense", ( SELECT SUM( "Revenue" ) - SUM( "Expense" ) FROM "Checkout" WHERE "ID" <= "a"."ID" ) AS "Balance" FROM "Checkout" AS "a" WHERE SELECT SUM( "Revenue" ) - SUM( "Expense" ) FROM "Checkout" WHERE "ID" <= "a"."ID" = 12.50 ORDER BY "ID" ASC
The brackets around the subquery were removed.
If you set two brackets before and after the subquery, only one bracket is removed and the autofilter works.
SELECT "ID", "Revenue", "Expense", (( SELECT SUM( "Revenue" ) - SUM( "Expense" ) FROM "Checkout" WHERE "ID" <= "a"."ID" )) AS "Balance" FROM "Checkout" AS "a"
works as expected for setting a filter to the subquery.
Comment 1 Lionel Elie Mamane 2013-07-09 21:23:53 UTC
Reproduced in master (commit/build id c63b74d22d360893bb9e1200f59099ffb7943705 of 2013-07-03 21:36:58).
Comment 2 Commit Notification 2013-07-10 01:22:33 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=6eb9c378f43e5f507d53d60d060becf4bb7615b8

fdo#58644 fix handling of subqueries



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 3 Commit Notification 2013-07-10 06:16:26 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3d2f55bbc3067b0da9cf2d8e8f321765e74af6b4&h=libreoffice-4-1

fdo#58644 fix handling of subqueries


It will be available in LibreOffice 4.1.1.

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 4 Commit Notification 2013-07-10 06:16:46 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=75f59b8f79f31af1ffe1fee42d093ae9269485c3&h=libreoffice-4-0

fdo#58644 fix handling of subqueries


It will be available in LibreOffice 4.0.5.

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 5 Commit Notification 2013-07-10 19:58:43 UTC
Lionel Elie Mamane committed a patch related to this issue.
It has been pushed to "libreoffice-4-1-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7802990f3155de25d38f894d1261dc975c37762d&h=libreoffice-4-1-0

fdo#58644 fix handling of subqueries


It will be available already in LibreOffice 4.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.