Download it now!
Bug 42905 - Wizard table: Remove autovalue from step2 which doesn't work since there's already autovalue in step3 which works.
Summary: Wizard table: Remove autovalue from step2 which doesn't work since there's al...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.4.4 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Tables
  Show dependency treegraph
 
Reported: 2011-11-14 02:18 UTC by Jurgen
Modified: 2019-07-31 15:15 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
select AutoValue ore not it is the same (39.37 KB, image/jpeg)
2011-11-14 02:18 UTC, Jurgen
Details
Use existing field and auto value (53.60 KB, image/jpeg)
2011-11-14 02:31 UTC, Jurgen
Details
Table without auto value ID field (76.30 KB, image/jpeg)
2011-11-14 02:33 UTC, Jurgen
Details
stacktrace when selecting autovalue with increment (91.76 KB, image/png)
2012-03-24 00:50 UTC, Julien Nabet
Details
patch to remove autoincrement-statement field (1.50 KB, text/plain)
2018-09-18 20:07 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jurgen 2011-11-14 02:18:42 UTC
Created attachment 53502 [details]
select AutoValue ore not it is the same

I think this is a old bug but I don't find any report

1. Create a new table with the wizard select a ID field
2. in the set Field types step select AutoValue (ore not it is the same)
3. in next step, set primary key > select: use an existing field as primary key and Auto value  
4. Create the table and the field is without the auto value 

Adding automatically a primary key works perfect but not with a selected field.
Comment 1 Jurgen 2011-11-14 02:31:11 UTC
Created attachment 53503 [details]
Use existing field and auto value
Comment 2 Jurgen 2011-11-14 02:33:33 UTC
Created attachment 53504 [details]
Table without auto value ID field
Comment 3 Julien Nabet 2012-03-24 00:50:05 UTC
Created attachment 58957 [details]
stacktrace when selecting autovalue with increment

On pc Debian x86-64 with 3.5 branch updated yesterday, I reproduced this behaviour.
I tried to add an autoincrement value but had a message containing a stacktrace attached.

I'm compiling sources master (future 3.6), I'll try with it as soon as it's finished.
Comment 4 Alex Thurgood 2015-01-03 17:38:05 UTC Comment hidden (no-value)
Comment 5 QA Administrators 2016-01-17 20:01:50 UTC Comment hidden (obsolete)
Comment 6 Jurgen 2016-01-18 08:01:11 UTC
I have tried on last LibreOffice and the bug still exist.
But now I don´t use the Base component, it haven't any change in the last years.
Comment 7 QA Administrators 2017-03-06 13:43:59 UTC Comment hidden (obsolete)
Comment 8 Julien Nabet 2018-09-16 07:37:40 UTC
It seems the auto-increment statement needs to be filled.
For example, if you put AutoValue="Yes" and type "IDENTITY" in auto-increment statement field, it'll work.
Of course, it works if it's an hsqldb embedded db. With Firebird embedded type, it won't work, you must type "GENERATED BY DEFAULT AS IDENTITY".

I must recognize it's not very intuitive, I see 2 possibilities to improve the situation here when putting AutoValue" to "Yes":
1) Fill the auto-increment statement field by default with auto-increment statement of the related DB.
or
2) Letting the empty auto-increment statement field by default and at the end, then if autovalue has been selected and auto-increment statement field has been let empty, retrieve the by default value

Any thoughts?
Comment 9 Julien Nabet 2018-09-16 07:49:53 UTC
A third possibility:
- remove auto-increment statement field and just auto-increment statement related to the db by default to create the table.
(like in Design table).
Advantages:
- simplification
- avoid UI bug at least on my laptop, "auto-increment statement" doesn't appear fully, the string is truncated.

(Of course, if you want to specify a bit more the column, you can still use an alter table in SQL command.)
Comment 10 Robert Großkopf 2018-09-16 09:32:59 UTC
The third steps works as expected for creating an AutoValue. It will work with internal HSQLDB and also with internal Firebird. Tested with LO 6.1.1.2 on OpenSUSE.

We should remove the creating of an AutoValue in the second step, where also fields will be defined. You could add there a field like ID for INTEGER-values and could create the primary key in the third step and set it as AutoValue. 

Input of an autoincrement-statement is nothing for database-beginners. Who would know it? The wizard, I think, is created for these persons.
Comment 11 Julien Nabet 2018-09-16 18:55:31 UTC
(In reply to robert from comment #10)
> The third steps works as expected for creating an AutoValue. It will work
> with internal HSQLDB and also with internal Firebird. Tested with LO 6.1.1.2
> on OpenSUSE.
Indeed! I just tested this, it worked!

> We should remove the creating of an AutoValue in the second step, where also
> fields will be defined. You could add there a field like ID for
> INTEGER-values and could create the primary key in the third step and set it
> as AutoValue. 
Even more simplification than 3rd, I like this!

> Input of an autoincrement-statement is nothing for database-beginners. Who
> would know it? The wizard, I think, is created for these persons.
Agree with this.

Is everyone ok to remove the AutoValue (from second step) + autoincrement-statement fields?
Or rather is someone against it and why? Perhaps I'm a bit too quick and it'd need some UX debate?
Comment 12 Heiko Tietze 2018-09-17 09:54:27 UTC
(In reply to Julien Nabet from comment #11)
> Perhaps I'm a bit too quick and it'd need some UX debate?

Don't think there is much to add from UX fellows. Suggestions sounds reasonable, go for it.
Comment 13 Julien Nabet 2018-09-17 10:00:58 UTC
Thank you Heiko for your feedback.
I'll take this one then.
Comment 14 Julien Nabet 2018-09-18 20:07:08 UTC
Created attachment 145001 [details]
patch to remove autoincrement-statement field
Comment 15 Julien Nabet 2018-09-18 20:11:26 UTC
Unassign myself because I don't think I'll make it.
I find it difficult to disentangle autovalue field in steps 2 and 3 from wizard + autovalue present when editing table.

I attached a patch to remove autostatement value but not sure it's a clean one.
Comment 16 Julien Nabet 2018-09-18 20:21:18 UTC
Comment on attachment 145001 [details]
patch to remove autoincrement-statement field

Patch is wrong since it removes at least the display of "Default value" field when putting "Autovalue" to "No".
Comment 17 Julien Nabet 2018-09-19 22:06:53 UTC
I tried to find the code location in Java part, since it should be easy to disable/remove the elems from Java part, so I started from wizards/com/sun/star/wizards/table/TableWizard.java, got some elems from step 3 in PrimaryKeyHandler.java of the same directory.
Then FieldFormatter.java gives some elems too but nothing about autovalue, entry required, ... fields. It seems wrapped into something but don't know how and where.

I tried to get a bt from OFieldDescControl::ActivateAggregate but it can't go up to java sources, gdb goes until
/home/julien/lo/libreoffice/bridges/source/jni_uno/jni_java2uno.cxx
but nothing more.
So I tried to display jo_method but gdb doesn't know how to deal with jstring.
(+ nothing about gdb and jstring on Google)

In brief, completely stuck.