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

Lionel Elie Mamane <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|[email protected] |[email protected]
                   |desktop.org                 |
                 CC|                            |[email protected]

--- Comment #5 from Lionel Elie Mamane <[email protected]> ---
This is partially a DUP of the other "removes parentheses around subqueries"
bug, but also partially other issues piled on top of it.

In short, LibreOffice gets a bit lost in the structure

SELECT * FROM tbl1 INNER JOIN (SELECT foo, bar FROM tbl2) AS tbl3

It does not properly see that tbl3 contributes fields "foo" and "bar" to the *.

You can help it by writing:

SELECT "tbl1".*, "tbl3"."foo", "tbl3"."bar" FROM tbl1 INNER JOIN (SELECT foo,
bar FROM tbl2) AS tbl3

and then it works.

The intermediary variant:

SELECT "tbl1".*, "foo", "bar" FROM tbl1 INNER JOIN (SELECT foo, bar FROM tbl2)
AS tbl3

(assuming "tbl1" has no fields "foo" or "bar") does not work either, but that
is a HSQLDB bug. It might work with other drivers / database types. When
LibreOffice asks HSQLDB what table "bar" comes from, HSQLDB replies
SYSTEM_SUBQUERY instead of tbl3. If it just replied "I don't know", it would
work alright...


See
http://cgit.freedesktop.org/libreoffice/core/commit/?id=83076c22e1ffbad06f4b250b69cd239758fbb1ba
for implementation direction to fix the LibreOffice problem here.

-- 
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