Bug 51605 - Field add corrupts table
Summary: Field add corrupts table
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Database (show other bugs)
Version: Inherited From OOo
Hardware: All All
: medium major
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-30 13:37 UTC by walkerkorea
Modified: 2015-01-03 17:38 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Database shows table before and after relocate columns by GUI (3.64 KB, application/vnd.sun.xml.base)
2013-01-22 19:34 UTC, robert
Details
Describes, how to reproduce the bug. (67.35 KB, application/vnd.oasis.opendocument.graphics)
2013-01-22 19:41 UTC, robert
Details

Description walkerkorea 2012-06-30 13:37:00 UTC
Version: LibreOffice Base 3.5.4.2
Build: 165a79a-7059095-e13bb37-fef39a4-9503d18
OS: Windows 7 Home Premium (32-bit).

Scenario:
Table X has 3 fields A, B, and D, with rows with data. You edit table X, and add field C. You cut field D, move to end, and paste after C.

Desired result:
Open Table X and it shows 4 fields A, B, C and D, in that order. Able to rename fields, and add new fields, and have them display when you open X. Copy table X to X2, and both field definitions and data are copied to X2.

Actual result:
Open Table X, and it shows 3 fields A, B, and C, but field C has data from old D. Edit Table X, and it shows 3 fields A, B, and D. Inconsistent results if you attempt to rename D (/C) field, or add new field with name C or D. However, even if you are able to rename D as D1 and back to D, and add new field C, the new field C will not appear when you open X, and field D will still be named C.

If you attempt to copy and special paste table X to X2, it fails to copy the data, but 3 fields are named A, B, and D.

Reproducible? Yes. Able to duplicate this error, with same results.
Comment 1 robert 2012-07-22 08:57:47 UTC
You can not sort the columns while editing the table in the GUI. If you will change a table and put C at the place you wish, this would only work with a SQL-command in the HSQLDB:
ALTER TABLE "X" ADD "C" VARCHAR(25) BEFORE "D";
The changes in the table were made, when you save the table. So when you cut "D" and put "C" at this position it is recognized as a renaming of the column.
In the HSQLDB there is no possibility to cut and paste a column.
Comment 2 Jochen 2012-08-28 18:38:04 UTC
Hi reporter,

IMHO your observation isn´t a bug. Okay?
Comment 3 robert 2013-01-22 19:34:22 UTC
Created attachment 73473 [details]
Database shows table before and after relocate columns by GUI
Comment 4 robert 2013-01-22 19:41:34 UTC
Created attachment 73474 [details]
Describes, how to reproduce the bug.

There is a possibility to cut and paste fields in the table-editor of the Base-GUI. Users might think, that it would cut and paste the whole content of the field (the whole column). But this function cuts and pastes only the name and the type of the field. So the old contend appears at another position of the table. In the example-database a field of a birthday (DATE) is changed to a field of a street (VARCHAR) - the date of the birthday appears as varchar in the street-column.
Comment 5 robert 2013-01-22 19:43:35 UTC
The behavior is the same on Windows and other platforms.
This bug exists since the first version of LO.
Changed the bug to New.
Comment 6 Alex Thurgood 2015-01-03 17:38:28 UTC
Adding self to CC if not already on


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.