Bug 152478 - PostgreSQL direct connection: AutoValue returns '0' if tablename is created with a Space
Summary: PostgreSQL direct connection: AutoValue returns '0' if tablename is created w...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-12 07:49 UTC by Robert Großkopf
Modified: 2023-03-30 16:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2022-12-12 07:49:52 UTC
Open a Base database file with direct connection to PostgreSQL.
Go to Tools → SQL.
Execute
CREATE TABLE "public"."TestSerial" ("ID" SERIAL PRIMARY KEY, "Name" VARCHAR(50));
CREATE TABLE "public"."Test Serial" ("ID" SERIAL PRIMARY KEY, "Name" VARCHAR(50));
Two tables will be created. Only difference between this tables is the space in second table name.

Refresh tables (View → Refresh tables)
Open the tables for input data.
Write something in field "Name" and save value by moving cursor down to next row.
You will get "ID" = '1' in table "TestSerial". Next row will show "ID" = 2 and so on.
You will get always "ID" = '0' in table "Test Serial". The table name with space will stop refreshing of the field "ID". You have to reload the table to get the right values, which are inserted by PostgreSQL to "ID".

Note: You can't change content of a field, which shows "ID" = '0', because this value for "ID" doesn't exist in PostgreSQL table, but Base GUI will try to change content for a row with ID = '0'

This buggy behavior seems to be a very old bug. Have tested it under OpenSUSE 15.3 64bit rpm Linux with LO 7.4.3.2 and also LO 6.4.7.2.
Comment 1 Michael 2022-12-19 08:25:46 UTC
I confirm this Bug using 
Version: 7.3.6.2 / LibreOffice Community
Build ID: c28ca90fd6e1a19e189fc16c05f8f8924961e12e
Operating System: Manjaro Linux / KDE Plasma Version: 5.26.4

In addition to the original report, I found that the issue occurs:
- in each case, if the table's name has a Space,
- in each case, if the table's name does not have a space 
  and the table is created external, f. e. using dBeaver https://dbeaver.io/,
- Never, if the table's name does not have a space and the table is created with BASE.