https://bugs.freedesktop.org/show_bug.cgi?id=60504

          Priority: medium
            Bug ID: 60504
          Assignee: [email protected]
           Summary: EDITING: Sort removes brackets in Queries - Sorting
                    doesn't work in correlated Subqueries
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: [email protected]
          Hardware: Other
            Status: UNCONFIRMED
           Version: 3.3.4 release
         Component: Database
           Product: LibreOffice

https://bugs.freedesktop.org/attachment.cgi?id=71964

Two queries. One works with "Sort" in every field, the other works only with
"Sort Ascending" and "Sort Descending" 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 "Sort" for some fields.
"Sort" 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"
ORDER BY SELECT SUM( "Revenue" ) - SUM( "Expense" ) FROM "Checkout" WHERE "ID"
<= "a"."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 "Sort" 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 "Sort" to the subquery.

Seems to be the same behavior as
https://bugs.freedesktop.org/show_bug.cgi?id=58644

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to