Bug 147582 - PostgreSQL JDBC: Form with Subform and SubSubform gives Parameter Error for SubSubForm
Summary: PostgreSQL JDBC: Form with Subform and SubSubform gives Parameter Error for S...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Connectivity
  Show dependency treegraph
 
Reported: 2022-02-21 15:55 UTC by Robert Großkopf
Modified: 2022-12-05 13:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Package with SQL-code for tables and 2 form (direct and JDBC connection) (45.93 KB, application/zip)
2022-02-21 15:55 UTC, Robert Großkopf
Details
Screenshot of error in subsubform, if subform without content. (25.87 KB, image/png)
2022-02-21 15:56 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2022-02-21 15:55:59 UTC
Created attachment 178443 [details]
Package with SQL-code for tables and 2 form (direct and JDBC connection)

There are some more bugs about PostgreSQL and subforms. This is a bug special for forms, which will contain a MainForm, a SubForm and a SubSubForm (subform of the subform).

Download the attached package, which contains SQL-Code for creating 3 Tables in PostgreSQL and fill on of the tables with first data.

Connect the database files to PostgreSQL. One file should be connected directly with internal driver, the other through JDBC. You only have to change the connection string in Edit → Database → Connection Type.

Open the form with direct connection. Will open without problems.

Open the form with JDBC. Will throw an error, because there seem to be something with integer and varchar values …
Type an ID for the town and a town in the subform.
You couldn't type somethin in the subsubform, because it isn't connected to the subform.
Close the form, reopen the form.
Now you could add data to the subsubform, special a name for the person.

This behavior could only be worked arround by connecting to a field, which is defined as Varchar like:
SELECT "tbl_Person".*, CAST( "ID" AS VARCHAR ( 10 ) ) AS "ID2" FROM "tbl_Person"
And get the value for the connected field for new rows by macro code from the subform.

Tested with LO 7.3.1.1 on OpenSUSE 15.3 64bit rpm Linux
Comment 1 Robert Großkopf 2022-02-21 15:56:39 UTC
Created attachment 178444 [details]
Screenshot of error in subsubform, if subform without content.
Comment 2 Alex Thurgood 2022-03-23 11:30:20 UTC
Hi Robert,

The SQL DDL is failing for me with this line when operating from a postgres session terminal on macOS (psql 10.20):

SET default_table_access_method = heap;
ERROR:  unrecognized configuration parameter "default_table_access_method"

Is this statement absolutely necessary ?
Comment 3 Alex Thurgood 2022-03-23 11:45:31 UTC
I ignore the failed DDL statement and ran the remainder without problem.

I can confirm that I got an error message on first opening of the JDBC connected form.

However, I could enter a town ID and a town, without error, and that data was saved to the corresponding table - so the subform works for me in the JDBC connection apart from that initial error message.


Version: 7.2.6.2 / LibreOffice Community
Build ID: b0ec3a565991f7569a5a7f5d24fed7f52653d754
CPU threads: 8; OS: Mac OS X 10.16; UI render: default; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 4 Alex Thurgood 2022-03-23 11:53:11 UTC
There's definitely something weird going on though:

- the first town ID / town entry was saved to the table;

- however, the second one I entered via the subform, which is visible in the town table, is not visible in the form...

When I try adding a 3rd town entry, I get an error message about a constraint violation, my previous 1st record townID gets overwritten with a different value, and my previously 2nd town entry gets overwritten with the 3rd entry.
Comment 5 Robert Großkopf 2022-03-23 14:19:11 UTC
(In reply to Alex Thurgood from comment #3)
> I ignore the failed DDL statement and ran the remainder without problem.
> 
> I can confirm that I got an error message on first opening of the JDBC
> connected form.
> 
> However, I could enter a town ID and a town, without error, and that data
> was saved to the corresponding table - so the subform works for me in the
> JDBC connection apart from that initial error message.
> 
The error is an error for the subsubform, adding a person to the town (3rd row).

I will get this error, if there is no row in the subform. If you add a row in the subform you won't get a connection to the subsubform, special in the form: Nothing appears in Town_ID. If you close the form and reopen after a town has been added a value in Town_ID will appear.
Comment 6 Alex Thurgood 2022-03-25 16:57:04 UTC
This is the error I get on opening the JDBC connected form:

Statut SQL: 42883

ERROR: operator does not exist: integer = character varying
  Indice : No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position : 79

and then indeed, there is no connection to the subsubform if no subform data is provided beforehand.

Confirming.
Comment 7 Michael 2022-12-05 13:16:56 UTC
Same here, using LibreOffice 7.3.6.2