Bug 122300 - LibreOffice Base: Table Creation Wizard: Primary Key "AutoValue" does not populate after error.
Summary: LibreOffice Base: Table Creation Wizard: Primary Key "AutoValue" does not pop...
Status: RESOLVED DUPLICATE of bug 117527
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.1.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Wizard
  Show dependency treegraph
 
Reported: 2018-12-24 03:01 UTC by OldIronSides1797
Modified: 2024-03-19 13:56 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample Database with Functioning "Autovalue" (5.38 KB, application/vnd.oasis.opendocument.database)
2018-12-24 03:04 UTC, OldIronSides1797
Details
Sample Database with Non-functioning "Autovalue" (3.06 KB, application/vnd.oasis.opendocument.database)
2018-12-24 03:05 UTC, OldIronSides1797
Details
Error Message seen at end of Table Creation Wizard (19.75 KB, image/png)
2018-12-24 03:09 UTC, OldIronSides1797
Details
Error Message when attempting to add entries to a non-function database. (22.43 KB, image/png)
2018-12-24 03:10 UTC, OldIronSides1797
Details

Note You need to log in before you can comment on or make changes to this bug.
Description OldIronSides1797 2018-12-24 03:01:04 UTC
Description:
The "AutoValue" field does not populate when erroneous entries during the Table Creation Wizard cause an error at the end of the Table Creation Wizard. (i.e. "Use Wizard to Create Table...")  

Steps to Reproduce:
REPRODUCING THE ERROR: 
1. To reproduce the error, start with a new LibreOffice Base database and open the table Wizard to create a new table.  

2. Select "Create a new database" and Embedded database: "HSQLDB Embedded". 
- Then, click the "Next" button. 

3. In the next screen: "Decide How to Proceed After Saving the Database".
- Accept the default settings: 
- "Yes, register the database for me" 
- "Open the database for editing" 
- Then, click the "Finish" button.

4. The Save window will appear.
- Select a Name for the Database
- Save the file in a suitable location. 
- Click the "Save" button.

5. The LibreOffice Base Window will open. 
- Under the tasks select "Use Wizard to Create Table..."

6. The Table Wizard appears.
- Select the category: "Business".  
- Select the table sample: "MailingList" . 
- Select "MailingListID" from the available fields and add it to the selected fields on the right. 
- Select "FirstName" and "Lastname" and add them to the selected fields on the right. 
- Click the "Next" button.

8. In the "Set field types and formats" window, accept the defaults for everything except the "AutoValue" of "MailingListID". 

9. For "MailingListID", change the AutoValue to "Yes".  
- Then, introduce an error by entering "0001" for the "Auto-increment statem". 
- Note: Entering "+1" also causes an error. 
- Click the "Next" button.

10.  Now the "Set the primary key" window appears.  
- Keep the default "Create a primary key" checked.  
- Then, choose "Use an existing field as a primary key". 
- Under the "Fieldname" drop down menu, choose "MailingListID". 
- For "Fieldname" keep the default setting with "Auto value" checked. 
- Click the "Next" button.

11. The "Create Table" window.
- Accept the default table name of "MailingList" 
- and the default setting "Insert data immediately".  
- Click on the "Finish" button. 

12. Immediately, an error message appears. 
- In this case it reads:
 "Unexpected token: 0001 in statement [CREATE TABLE "MailingList" 
("MailingListID" INTEGER NOT NULL 0001]".  
- Click the OK button to clear the error pop-up and go back to the wizard. 

13. Click the "Back" button twice so that you view the "Set field types and formats" window.  
- Correct the error, by removing the "0001" from the "Auto-increment statem" box. 
- Click the "next" button twice. 
Note: 
I would expect this correction to resolve the error but it does not. Instead the the Table Creation Wizard must be started over and run without error before the "Autovalue" works properly.

14. Finally, click the "Finish" button. 

15. The table will come up for editing.
- However, the "MailingListID" field does not "AutoValue" like it is supposed to.  
- This "AutoValue" error prevents saving of the table and prevents saving any records in the table.
- The following error message appears, when attempting to insert a new record:

"Error inserting the new record"
"Attempt to insert null into a non-nullable column: 
column:MailingListID 
table: MailingList 
in statement [INSERT INTO "MailingList" ("FirstName", "LastName") VALUES (?,?)]"

Actual Results:
-Wizard allows for error to be introduced and does not explain what entries are allowable.
-After error occurs backing up and correcting the error does not fix the error. 
-The error is only corrected if the Wizard is started over and run without error.

Expected Results:
-The Table Wizard should not allow invalid entries.
-A help link should be included next to the "autovalue" option explaining what suitable entries should be. 
-The "autovalue" field value should not be editable unless there is a reason to edit it. 



Reproducible: Always


User Profile Reset: No



Additional Info:
NOTE: 
- Backing up and correcting the error within the wizard should fix the problem. 
- When an error like this occurs, it should not require starting over with a new table.  
- The "AutoValue" failure only results when an error occurs during the wizard. 
- If no error occurs during the table creation wizard, the "AutoValue" works properly as expected. 

NOTE: 
- Pertinent LibreOffice Help documentation: 
- (See Search Term: Database Wizard (Base))
- I was building a database to create address labels. So,...
- (See Search Term: labels;from databases)

LIBREOFFICE VERSION - In which bug was discovered:
Version: 6.1.4.2
Build ID: libreoffice-6.1.4.2-snap1
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group threaded
(The release was provided by Canonical.)

OPERATING SYSTEM - On which LibreOffice was installed. 
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic

POSSIBLE RELATED BUGS:
Bug 108058 - After renaming Primary Key AutoValue feature fails

SUGGESTIONS:
- The potential of this error could be lessened, if the desired entry in the "AutoValue" box was more clear.  A link next it giving explanation would be helpful. 
- Also, the "AutoValue" box should not be editable, unless there is a reason for changing it. 


INCLUDED SAMPLE FILES:
- Working database with functioning "Autovalue".
- Non-working database with non-functioning "Autovalue".
Comment 1 OldIronSides1797 2018-12-24 03:04:27 UTC
Created attachment 147794 [details]
Sample Database with Functioning "Autovalue"
Comment 2 OldIronSides1797 2018-12-24 03:05:52 UTC
Created attachment 147795 [details]
Sample Database with Non-functioning "Autovalue"
Comment 3 OldIronSides1797 2018-12-24 03:09:25 UTC
Created attachment 147796 [details]
Error Message seen at end of Table Creation Wizard
Comment 4 OldIronSides1797 2018-12-24 03:10:53 UTC
Created attachment 147797 [details]
Error Message when attempting to add entries to a non-function database.
Comment 5 Drew Jensen 2018-12-27 17:37:58 UTC
This looks to be a duplicate of "Firebird: EDIT: Table wizard does not set field properties "AutoValue" to "Yes" for user selected primary key field." 

Setting as such.

*** This bug has been marked as a duplicate of bug 117527 ***
Comment 6 Mike Kaganski 2024-03-19 13:56:58 UTC
I don't quite see how this HSQLDB issue could be a dupe of a Firebird issue?