Bug 60643 - EDITING - postgresql-SDBC GUI autoincrement setting not saved in Table Design mode
Summary: EDITING - postgresql-SDBC GUI autoincrement setting not saved in Table Design...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 125186 133349 (view as bug list)
Depends on:
Blocks: Database-Tables
  Show dependency treegraph
 
Reported: 2013-02-11 09:33 UTC by Alex Thurgood
Modified: 2023-11-14 08:14 UTC (History)
10 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 Alex Thurgood 2013-02-11 09:33:14 UTC
Tested on Linux 32bit master :
 Version 4.1.0.0.alpha0+ (Build ID: 7e2f34a3172a756a0fd70cae1294250206945a6)

When using the Table Design mode, one can set a field to be AUTOINCREMENT. In postgres this is the SEQUENCE or SERIAL function. However, setting an INT(4) field to AUTO in the Table Design mode and then saving the table does not provide the appropriate statement or activate the corresponding postgres function.

The table then has to be modified by hand separately using an ALTER TABLE statement.


Alex
Comment 1 Alex Thurgood 2013-02-11 09:34:05 UTC
Adding Lionel to CC.
Comment 2 Lionel Elie Mamane 2013-02-11 17:40:26 UTC
This happens in connectivity/source/commontools/dbtools2.cxx, function dbtools::createStandardColumnPart, around lines 90-91 and 171-175. This generates the SQL for creating the new column. That code pretty much expects to be able to just stack some text behind the:

 "colName" colType NOT NULL

and that would magically make it an autoincrement column. Alas, that is not how it happens in PostgreSQL; we need to either explicitly create the sequence and set the default value to
 nextval('seqname')
OR change colType to one of smallserial, serial or bigserial (depending on the underlying type: int2, int4 or int8). See http://www.postgresql.org/docs/9.2/static/datatype-numeric.html#DATATYPE-SERIAL

Since dbtools::createStandardColumnPart merrily ignores the auto_increment (column 12) of getTypeInfo(), we cannot even use that at the pgsql-sdbc level to assert *some* control.


So, "any" solution will have to happen by a redesign of dbtools::createStandardColumnPart, and probably some new SDBCX interface that drivers would have to implement.
Comment 3 Joel Madero 2013-02-13 18:18:31 UTC
Marking as NEW as Lionel appears to have confirmed the issue
Comment 4 Alex Thurgood 2015-01-03 17:40:23 UTC Comment hidden (no-value)
Comment 5 QA Administrators 2016-01-17 20:02:51 UTC Comment hidden (obsolete)
Comment 6 Alex Thurgood 2016-07-26 13:21:27 UTC
Still present in

Version: 5.3.0.0.alpha0+
Build ID: 36e61d03a252e73139a472c5be04ffc54a5c8efb
CPU Threads: 2; OS Version: Mac OS X 10.11.6; UI Render: default; 
Locale: fr-FR (fr.UTF-8); Calc: group
Comment 7 QA Administrators 2017-09-01 11:16:19 UTC Comment hidden (obsolete)
Comment 8 Alex Thurgood 2017-09-15 14:05:48 UTC
Still present in

Version: 5.4.1.2
Build ID: ea7cb86e6eeb2bf3a5af73a8f7777ac570321527
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group
Comment 9 Alex Thurgood 2018-07-17 12:28:46 UTC
Still present in 

Version: 5.4.7.2
Build ID: c838ef25c16710f8838b1faec480ebba495259d0
Threads CPU : 8; OS : Mac OS X 10.13.5; UI Render : par défaut; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group
Comment 10 Alex Thurgood 2019-05-13 06:22:16 UTC
*** Bug 125186 has been marked as a duplicate of this bug. ***
Comment 11 Alex Thurgood 2019-12-02 13:18:24 UTC
Still present in 

Version: 6.3.3.2
Build ID: a64200df03143b798afd1ec74a12ab50359878ed
Threads CPU : 8; OS : Mac OS X 10.14.6; UI Render : par défaut; VCL: osx; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded
Comment 12 Robert Großkopf 2020-07-07 18:56:15 UTC
*** Bug 133349 has been marked as a duplicate of this bug. ***
Comment 13 Alex Thurgood 2023-10-12 11:00:40 UTC
The table design UI no longer has the possibility to designate a field as autoincrement on macOS, only whether or not the field allows NULL entries or forces NOT NULL.

postgres server 15
Direct/native postgres SDBC driver



Version: 7.6.2.1 (AARCH64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 8; OS: Mac OS X 14.0; UI render: Skia/Raster; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 14 Alex Thurgood 2023-10-12 11:05:16 UTC
(In reply to Alex Thurgood from comment #13)
> The table design UI no longer has the possibility to designate a field as
> autoincrement on macOS, only whether or not the field allows NULL entries or
> forces NOT NULL.

Correction:
> Direct/native postgres SDBC driver
  xxxxx JDBC Driver xxxxxxxx


With the native driver, the problem remains (obviously, as the code point indicated hasn't been touched in 10 years).
Comment 15 elmau 2023-11-13 19:13:50 UTC
Still present in:

Version: 7.5.8.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 16; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: es-MX (en_US.UTF-8); UI: en-US
7.5.8-1
Calc: threaded
Comment 16 Salvador Daza 2023-11-13 20:09:23 UTC
Still present in LO 7.6.2.1

Manjaro Linux, kernel 6.1.60-1-MANJARO.
Comment 17 Robert Großkopf 2023-11-14 08:14:46 UTC
Version has to be the earliest affected version. Please don't set it to newer version.

It should be the earliest version, because it could find to get the buggy code, which introduces this bug. For this bug it could be it never worked well.