https://bugs.documentfoundation.org/show_bug.cgi?id=169424
Bug ID: 169424
Summary: Can’t make a natural join or cross join with more than
two tables
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Base
Assignee: [email protected]
Reporter: [email protected]
Description:
If you make a database with three or more tables and join them together in a
chain with a natural or cross join in the design view then Base can’t reopen
the query because it can’t parse the SQL that it itself generated.
Steps to Reproduce:
1. Open the attached database. It contains the tables “house”, “person”, “sock”
with the primary keys “house_id”, “person_id” and “sock_id” respectively. The
person table also contains a “house_id” to reference which house they live in
and the sock table contains a “person_id” to reference who they belong to. It
contains a single query called “sock_addresses” which was created with the
design view. All three of the tables are in the query. There are natural joins
between the house and person tables and between the person and sock tables.
2. Try to edit the query in the design view.
Actual Results:
Base will complain that the SQL could not be parsed (even though it created
that SQL itself). It will then open the query in the SQL editor instead.
Expected Results:
It should open the design view and show the same query that was created
previously with the UI.
Reproducible: Always
User Profile Reset: No
Additional Info:
In InsertJoin in QueryDesignView.cxx, the part after “if ( eJoinType !=
CROSS_JOIN && !bNatural )” handles the case when the join is a natural or cross
join. It calls getTableRange on the two sides of the query, which I guess is
assuming the two sides of the join are just directly table names. However in
this case the right side of the join is another join and it ends up trying to
find a table whose name is “sock AS sock NATURAL RIGHT OUTER JOIN house”, which
obviously doesn’t work.
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: cf992f9b78a2e618e64bc0173e2bb90d568e1adb
CPU threads: 8; OS: Linux 6.17; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: threaded
--
You are receiving this mail because:
You are the assignee for the bug.