Bug Hunting Session
Bug 121553 - Editing: Firebird: Table editor erroneously prompts to change CLOB field to a BLOB field during alter table
Summary: Editing: Firebird: Table editor erroneously prompts to change CLOB field to a...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.2.0.0.beta1+
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2018-11-20 14:27 UTC by Drew Jensen
Modified: 2019-05-13 16:53 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file (3.00 KB, application/vnd.oasis.opendocument.database)
2018-11-20 14:27 UTC, Drew Jensen
Details
Screen shot of erroneous error message (65.37 KB, image/png)
2018-11-20 14:28 UTC, Drew Jensen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Drew Jensen 2018-11-20 14:27:15 UTC
Created attachment 146837 [details]
Test file

The Firbird support in Base added CLOB to the list recently.
Using the table editor to create a CLOB field in a table works initially.
However if you attempt to alter the table structure subsequently by adding a new column then during the ALTER TABLE process the CLOB field is first erroneously reported as needing to be dropped and added to the back of the table columns, but will change the type of field from CLOB to BLOB.

Steps to reproduce:
1 - download and open the attached test file.
2 - Open the table TABLE2 with the Table Editor
3 - Add a new column after Notes of any name and type
4 - Click on save changes.

Result:
User is prompted (see second attachment for screen shot) that the Notes field can not be changed (OK) and instead should it be dropped and appended with new format.

This is because what the application really wants to do is change the column type to BLOB (a type that was supported with older versions of LO/Firebird when it did not support CLOB), so if you the user answers yes it does just that (which looses any data currently in the column for all records) and the user is now unable to edit, insert, etc any data in the changed field. If the user is sharp and answers no there is no harm.

Expected result:
The application adds the new column silently.

Setting this to priority 'High' because of the data loss potential.
Comment 1 Drew Jensen 2018-11-20 14:28:13 UTC
Created attachment 146838 [details]
Screen shot of erroneous error message

screen shot of error box message.
Comment 2 Robert Großkopf 2018-11-20 15:14:33 UTC
I have tested it with both tables:
The "notes"-field, defined as BLOB[BLOB], needs an <OBJECT> for input.
The "notes"-field, defined as CLOB[BLOB], could contain text.

Both fields show the same irritating and wrong errormessage. You have to switch to "No" to prevent dataloss.

By the way: What is the real type of the fields? With HSQLDB the real type is described in square brackets, and this is the same here ([BLOB]).

Tested with LO 6.1.3.2, OpenSUSE 15, 64bit rpm Linux
Comment 3 Drew Jensen 2018-11-20 15:44:49 UTC
Real type.

BLOB and CLOB are two types of LOB, to be AR about it.

From Firebird perspective a CLOB is a specialized sub type of BLOB with the C in CLOB standing for Character and the BLOB being a generic binary encoded large object. CLOB signifies to client software that the binary data may be retrieved as character data. 

Same is true of the Image field type in Base, which is another BLOB sub type.

So, it is accurate in the table editor to, as it does, display the types as:
BLOB  [BLOB]
CLOB  [BLOB]
IMAGE [BLOB]

The actual equivalent to the CLOB [BLOB] field in the HSQLdb SDBC was the field type MEMO [BLOB].
Comment 4 RolandVL 2019-05-13 16:52:34 UTC
This bug is also in LibreOffice Version: 6.1.5.2 ("Stable Version")