Bug 138091 - Base Index Design not saved
Summary: Base Index Design not saved
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.0.2.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-09 15:45 UTC by Fred
Modified: 2020-11-25 19:10 UTC (History)
1 user (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 Fred 2020-11-09 15:45:29 UTC
Description:
Create a test table with TestID (Autovalue Primary Key), LastName (VARCHAR), FirstName (VARCHAR), MiddleName (VARCHAR).
Click Tools, then Index Design. The name SUS_IDX_46is assigned.
Define the index (mine is Unique LastName Ascending, FirstName Ascending, MidddleName Ascending)
Try to save the Index (or rename it) (or Close) and see:
--> "Index not found: SYS_IDX_46 in ststement [DROP INDEX "SYS_IDX_46" ON "T-Test"] 
FILESAVE

Steps to Reproduce:
Create a test table with TestID (Autovalue Primary Key), LastName (VARCHAR), FirstName (VARCHAR), MiddleName (VARCHAR).
Click Tools, then Index Design. The name SUS_IDX_46is assigned.
Define the index (mine is Unique LastName Ascending, FirstName Ascending, MidddleName Ascending)
Try to save the Index (or rename it) (or Close) and see:
--> "Index not found: SYS_IDX_46 in ststement [DROP INDEX "SYS_IDX_46" ON "T-Test"] 

Actual Results:
Index not found: SYS_IDX_46 in ststement [DROP INDEX "SYS_IDX_46" ON "T-Test"] 

Expected Results:
An unique index to  prevent duplicate names.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TableDesign
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: yes

gerrit.libreoffice.org / core / 8349ace3c3162073abd90d81fd06dcfb6b36b994
Comment 1 Robert Großkopf 2020-11-24 15:08:22 UTC
I tried to reproduce this one.
When I opened the index design a dialog appears:
"Before you can edit the index of a table, you have to save it. Do you want to save the changes now?"
If I won't save I'm not able to create an index.

Now I don't understand what you are doing: You try to edit the index, which is defined for the primary key?
The right way would be: Press the first icon for a new index. Then you are able to create a unique index for the fields.

OK, you didn't do this and tried to change the index for the primary key and get the error. This error is created by the internal HSQLDB, so there is no chance to change the (misleading) message. You will get a different message in internal Firebird. 
Better would be: Don't allow to change anything in this index. So nobody would try this an create only new indexes for new features and doesn't destroy automatically created indexes. But this will be a feature request ...
Comment 2 Fred 2020-11-24 22:10:42 UTC
(In reply to Robert Großkopf from comment #1)
Thank you.
Please refer to BH40-BaseHandbook, page 41.

A test table (People) would have Person_ID (primary key, autovalue), FirstName, Initial, LastName (all Text [VARCHAR]).

It is possible that there are several "John Q Public". Each would have his own Primary Key (PK). 

I want to create an Index of the (3) name fields.    

Edit the Table, <Tools><Index Design> and see several ~SYS_IDX_##~
Click the leftmost icon (New Index) and see ~index1~
Select each of the name fields, then click "Close"
Verify that Unique is checked.
See the "Do you want to save the changes made to the current index?"
Click "Yes"
Read "Index not found: index1 in statement [DROP INDEX "index1" ON "People"]

Note: the names shown for the indexes are not constant.
Comment 3 Fred 2020-11-25 01:06:42 UTC
(In reply to Robert Großkopf from comment #1)

Robert, I restarted Base in "Safe Mode" and this worked as expected. I created and tested my "index1". "John Q Public" could not be entered twice in the table, so it now has "John Q Public" and "John Q1 Public". 

I closed Base and restarted normally. Now it works, and I was able to create another index as a test. 

The only extensions are those bundled with LibreOffice:
     English dictionaries for OpenOffice/LibreOffice 4.0+
     Solver for Nonlinear Programing 0.9
     Spanish Ortografia 2.5
     Wiki Publisher 1.2.0

I don't know what to say as if did work just now as expected.
-- Fred
Comment 4 Robert Großkopf 2020-11-25 16:00:26 UTC
(In reply to Fred from comment #3)
> 
> I don't know what to say as if did work just now as expected.
> -- Fred

Hi Fred,

good to read this. So there was something wrong in you user-profile, but what?

I will set this bug so RESOLVED and WORKSFORME. Could be we open a new bug, which describes the problem the user seems to be allowed to change the index for a primary key, but the message shows he isn't.

The wrong message of the internal HSQLDB we couldn't change. It is a part of the database ...
Comment 5 Fred 2020-11-25 19:10:28 UTC
(In reply to Robert Großkopf from comment #4)
> (In reply to Fred from comment #3)

Thank you, Robert.

> Could be we open a new bug,
> which describes the problem the user seems to be allowed to change the index
> for a primary key, but the message shows he isn't.
> 
> The wrong message of the internal HSQLDB we couldn't change. It is a part of
> the database ...

I am still trying to learn Base. I don't know enough to suggest that any alteration to a Primary Key should be allowed. That was not what I was trying to do at all.

If the SYS_IDX_XX are the primary keys (there are 5 visible - I have 3 test tables) then my logic says that modification should not be allowed. 

My real world case came about as 3 "Juan Albert Morales" enrolled in the same school, two with the same birthday. The third was born a day later. They all have the same father,  different mothers (who say they did not know the others).   

> So there was something wrong in you user-profile,

I have now idea. I don't know where to begin looking. All <<Tools><Options><LibreOffice><User Data> fields are blank (null?).

Is it possible that the latest Java update did something? I know that one was installed in the last few days (now 1.8.0_251)

Again, Thank you!
-- Fred