[Libreoffice-bugs] [Bug 130376] New: PostgreSQL JDBC: Autoincrement doesn't return values in Queries with Alias
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Mon Feb 3 08:16:57 UTC 2020
https://bugs.documentfoundation.org/show_bug.cgi?id=130376
Bug ID: 130376
Summary: PostgreSQL JDBC: Autoincrement doesn't return values
in Queries with Alias
Product: LibreOffice
Version: unspecified
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Base
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: robert at familiegrosskopf.de
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.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200203/73aa55a1/attachment.htm>
More information about the Libreoffice-bugs
mailing list