Bug 158453 - Form with nested query can not find column
Summary: Form with nested query can not find column
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Queries
  Show dependency treegraph
 
Reported: 2023-11-30 10:17 UTC by Andreas Säger
Modified: 2024-12-20 06:19 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Database document with 2 forms "LO fail" and "LO work around" (50.99 KB, application/vnd.oasis.opendocument.database)
2023-11-30 10:17 UTC, Andreas Säger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Säger 2023-11-30 10:17:11 UTC
Created attachment 191133 [details]
Database document with 2 forms "LO fail" and "LO work around"

I have a working query with 2 subqueries in parsed mode. It returns the expected result when I open it.
When I try to use that query with a subform, I get the following error:

The data content could not be loaded. at /home/buildslave/source/libo-core/connectivity/source/commontools/dbtools.cxx:746
Column not found: SYSTEM_SUBQUERY.MID in statement [SELECT "Debits2".*, "Debits2"."Months" * "Debits2"."FEE" AS "Amount" FROM ( SELECT "Debits1".*, DATEDIFF( 'mm', "Debits1"."D", COALESCE ( "Debits1"."D2", CURRENT_DATE ) ) + casewhen( DAY( "Debits1"."D" ) < DAY( "Debits1"."D2" ), 1, 0 ) AS "Months" FROM ( SELECT "MS1"."D", MIN( "MS2"."D" ) AS "D2", "MS1"."MID", "MS1"."RID", "MS1"."FEE" FROM "MEMBERSHIPS" AS "MS1" LEFT JOIN "MEMBERSHIPS" AS "MS2" ON "MS1"."D" < "MS2"."D" AND "MS1"."MID" = "MS2"."MID" GROUP BY "MS1"."D", "MS1"."MID", "MS1"."RID", "MS1"."FEE" ) AS "Debits1" ) AS "Debits2" WHERE ( "SYSTEM_SUBQUERY"."MID" = :link_from_ID )] at /home/buildslave/source/libo-core/connectivity/source/drivers/jdbc/Object.cxx:173

MID is the column that should be substituted by the parent form's primary key.

When I split the query in a cascade of 3 queries and bind the subform to the last one, the subform works as expected.
Comment 1 Andreas Säger 2023-11-30 10:19:10 UTC
Open the forms "LO fail" (Query1) and "LO work around" (Debits).


Both forms work with OpenOffice.
Comment 2 Robert Großkopf 2023-12-15 16:34:06 UTC
Could confirm the buggy behavior. Couldn't test with AOO, because I can't get Base working there (Java version could be found but doesn't work with AOO).

Have tested also with older LO-versions. LO 6.4.7.2 is the oldest version I have installed, which will accept the Java-version I have installed.

Did you use the same Java-version for both tests?
Comment 3 Andreas Säger 2023-12-16 11:27:58 UTC
(In reply to Robert Großkopf from comment #2)
> Did you use the same Java-version for both tests?

$ java --version
openjdk 11.0.21 2023-10-17
OpenJDK Runtime Environment (build 11.0.21+9-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.21+9-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

Same version as displayed in the options dialogs of AOO/LO. Well, it's a JDK.