Bug 75129 - EDITING: Base TABLE broken when editing FIELD NAME and FIELD TYPE all at once
Summary: EDITING: Base TABLE broken when editing FIELD NAME and FIELD TYPE all at once
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.1.5.3 release
Hardware: Other Linux (All)
: medium critical
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-18 02:28 UTC by Kevin Suo
Modified: 2014-02-22 06:48 UTC (History)
2 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 Kevin Suo 2014-02-18 02:28:01 UTC
Problem description: 
When I change the FIELD NAME and FIELD TYPE at once, the table is broken and thus causes data loss.

Steps to reproduce:

1. New base TABLE in design mode, Fields: 
ID (Integer, AutoVaule, Primary Key);
AGE (Tiny Interger).
Save.

2. OPEN the TABLE and insert a row of data:
AGE: 28
Save.

3. EDIT the TABLE fields:
change "AGE (Tiny Integer)" to "DATE_OF_BIRTH (Date)", save.
A warning message will show up and say "The column DATE_OF_BIRTH" could not be saved, and ask whether should the column be deleted and appended.

4. When choose NO, the FIELD NAME is back to "AGE" and the save button is greyed-out. Close the EDIT window.

5. OPEN the above TABLE to see the columns and rows. You will see the 2nd column is "DATE_OF_BIRTH" rather than "AGE". However, in TABLE design mode (EDIT), the 2nd column is still "AGE".

6. Do anything possible to correct the problem shown in step 5. You may find it's impossible. That is to say, the TABLE is broken, and your data is lost. (Base seems confused about whether the column is "AGE" or "DATE_OF_BIRTH".)

Current behavior:
Base is confused in step 3, and causes TABLE to be broken.


Expected behavior:
Base should accept the FIELD changes in step 3 correctly, and not cause TABLE to be broken.

Tested in 4.2.0.4 and 4.1.5.3, 100% reproductive.
              
Operating System: Ubuntu
Version: 4.2.0.4 release
Comment 1 Kevin Suo 2014-02-18 02:32:12 UTC
Changing version to 4.1.5.3, as there was no such version shown in BSA.
Comment 2 Robert Großkopf 2014-02-21 17:42:35 UTC
Have tested it with LO 4.1.5.3 OpenSUSE 12.3 64bit rpm Linux. Could confirm that the shown fieldname in position 4 isn't correct. The warning says something about the column DATE_OF_BIRTH, which is already saved to the database. It is only impossible to change the content to "DATE". The fieldname AGE doesn't exist any more when you press the save-button. So it isn't correct to show the old fieldname. You could see the new name in the table, you could put data in the field.
If you go to View → Refresh Tables you could see the new fieldname also when you try to edit the table again. I could set the name back to AGE without any problem.
So I cannot confirm the bug - the table isn't broken here.
Open another bug for the wrong description in the table-editor. This behavior I could confirm.
Comment 3 Kevin Suo 2014-02-22 06:48:44 UTC
(In reply to comment #2)

> So I cannot confirm the bug - the table isn't broken here.
> Open another bug for the wrong description in the table-editor. This
> behavior I could confirm.

Another bug report has being filed, Bug 75354. Marking this one as RESOLVED WORKSFORME.