https://bugs.documentfoundation.org/show_bug.cgi?id=158453

            Bug ID: 158453
           Summary: Form with nested query can not find column
           Product: LibreOffice
           Version: 7.6.3.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Base
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 191133
  --> https://bugs.documentfoundation.org/attachment.cgi?id=191133&action=edit
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to