Don't know if this is a bug of LO or of the JDBC-Connector ... You will need a connection to a PostgreSQL-database through JDBC. Create a table like CREATE TABLE "public"."Test" ( "ID-Test" serial PRIMARY KEY, "Text" varchar(100) NULL ); Input some data into the table. Will work right, the primary key will be incremented. Create a query SELECT "ID-Test", "Text" FROM "public"."Test" AS "a" Start the query and input a value to the field "Text". "ID-Test" will return '0'. '0' will be returned for all new input. Reload the data and the right values will appear. Log-file of PostgreSQL will show this: ERROR: relation "a" does not exist at character 30 STATEMENT: SELECT MAX( "ID-Test" ) FROM "a" The "normal" way to get the incremented value is like this, which will work in Tools - SQL: INSERT INTO "public"."Test" AS "a" ("Text") VALUES ('Test') RETURNING "ID-Test"; This bug appears in all LO-Versions I have tested here - from LO 6.1.5 up to LO 6.4.0 on OpenSUSE 15.1 64bit rpm Linux.
Found the same here, using LO-BASE: Version: 6.1.5.2, Build-ID: 90f8dcf33c87b3705e78202e3df5142b201bd805, CPU-Threads: 4; BS: Linux 5.3; UI-Render: Standard; VCL: kde4; Gebietsschema: de-DE (de_DE.UTF-8); Calc: group threaded PostgreSQL: PostgreSQL 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, 64-bit Additional information: 1) All variants for SQL-queries, having an Alias-Name in the FROM-clause cause that entry in the PostgreSQL-Log-file and - as reported - the ID for new entries is shown as 0; entering more than one record at a time, you'll see multiple ID-values = 0 below each other. Having this fault, I also found issues in BASE-Forms or Queries, where sometimes one ore more data fields get lost on saving. 2) The same SQL-query without Alias-Name in the FROM-clause works fine without entry in the PostgreSQL-Log-file, the ID is shown correct no data fields get lost anymore. 3) Using the same SQL-query WITH Alias-Name in the FROM-clause in DBeaver works fine without entry in the PostgreSQL-Log-file or any other issue.
Tested it a little bit more. Executed the query of the bug-report. Entered a new value in a new row in the field Text. Saved the value by leaving the row. ID-Test shows 0. Changed the new value of Text in this field. Saved this by leaving the row. The old value will be shown again, the changed value has been lost. Seems Base wants to make an update for a row with the primary-key 0, which doesn't exist. This buggy behavior could lead to data loss!
This bug isn't only a bug of JDBC. It will be the same for the direct connection. If I connect to PostgreSQL through ODBC it won't appear if I won't set Edit > Database > Advanced settings > Special settings "Respect the result set type from the database driver" to true. I have changed the summary to reflect this
Dear Robert Großkopf, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Bug is still the same with LO 7.3.0.3 SELECT "ID-Test", "Text" FROM "public"."Test" AS "a" will return '0' in "ID-Test" for every new row. SELECT "ID-Test", "Text" FROM "public"."Test" AS "Test" will work well. Could be it is because SELECT "ID-Test", "Text" FROM "Test" will work also. Setting an Alias for the table will destroy the returning for input new values. This will only appear in query GUI. Tools → SQL will work right.
Version: 24.8.3.1 (X86_64) / LibreOffice Community Build ID: 65412f067af443213e726c93f137ccc85c9a1e06 CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb) Locale: de-DE (de_DE.UTF-8); UI: de-DE Calc: threaded
Bug is still the same: Version: 24.8.3.1 (X86_64) / LibreOffice Community Build ID: 65412f067af443213e726c93f137ccc85c9a1e06 CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb) Locale: de-DE (de_DE.UTF-8); UI: de-DE Calc: threaded