Bug 125957 - FIREBIRD: Datatype Binary(fix) [CHAR] couldn't be filled with content
Summary: FIREBIRD: Datatype Binary(fix) [CHAR] couldn't be filled with content
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.3.0.0.beta1+
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:7.2.0 target:7.1.0.0.beta2 tar...
Keywords:
: 125958 (view as bug list)
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2019-06-16 16:43 UTC by Robert Großkopf
Modified: 2020-12-06 13:34 UTC (History)
6 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 Robert Großkopf 2019-06-16 16:43:44 UTC
Open any internal Firebird database. Open a table for editing or create a new table. There is a data type Binary(fix)[CHAR]. Choose this type for a field.

After saving the table open the table for data input. The field will get an <OBJECT>, so it couldn't be filled in the table view.

Create a form for it. I have tried many fields, also the image-control, which is the only field for read binary data. No possibility to get data into this field type.

Now reopen the table for editing. Look at the field. The type will have switched to Text(fix)[CHAR].

Don't know where Binary(fix)[CHAR] should be for. But a field, which couldn't be filled with content through a form or directly through the table view, should be removed from the table editor.
Comment 1 Robert Großkopf 2019-06-16 16:51:06 UTC
*** Bug 125958 has been marked as a duplicate of this bug. ***
Comment 2 Alex Thurgood 2019-06-18 07:27:22 UTC
Confirmed with

Version: 6.4.0.0.alpha0+
Build ID: eda0568ec550a10b962c2427edfe05ea3197f107
CPU threads: 4; OS: Mac OS X 10.14.5; UI render: default; VCL: osx; 
Locale: fr-FR (fr_FR.UTF-8); UI-Language: en-US
Calc: threaded
Comment 3 Julien Nabet 2020-05-15 17:42:25 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

This type has been added with this block:
    865         // Binary (CHAR)
    866         // It is distinguished from Text type by its character set
    867         aRow[1] = new ORowSetValueDecorator(OUString("CHAR"));
    868         aRow[2] = new ORowSetValueDecorator(DataType::BINARY);
    869         aRow[3] = new ORowSetValueDecorator(sal_Int16(32765)); // Prevision = max length
    870         aRow[6] = new ORowSetValueDecorator(OUString("length")); // Create Params
    871         aRow[9] = new ORowSetValueDecorator(
    872                 sal_Int16(ColumnSearch::NONE)); // Searchable
    873         aRow[14] = ODatabaseMetaDataResultSet::get0Value(); // Minimum scale
    874         aRow[15] = ODatabaseMetaDataResultSet::get0Value(); // Max scale
    875         tmp.push_back(aRow);
See https://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/firebird/DatabaseMetaData.cxx?r=572c9db0#865
in commit https://cgit.freedesktop.org/libreoffice/core/commit/?id=bf662904c4b60e93c6b86e06288d41996eed12a2
author	Tamas Bunth <tamas.bunth@collabora.co.uk>	2017-12-16 12:57:43 +0100
committer	Tamás Bunth <btomi96@gmail.com>	2017-12-28 10:39:48 +0100
commit bf662904c4b60e93c6b86e06288d41996eed12a2 (patch)
tree e3508e2504a07622559793393fcbc19023157bfd
parent 3c567e55e6aed9e0da892d8b9fc09f8a0c784fcc (diff)
tdf#104734 Firebird: Add Binary (fix) type
There is no explicit binary type in Firebird. It can be accomplished
using the CHAR type with a special character set, which tells the
database that it is binary data and there is no collation. (called
OCTETS).

Because of that, we also need the character set to decide the exact
column type.

And also refactor some parts of the driver:
- Create class to determine internal type from firebird type, subtype,
scale and character set.
- Use internal type (DataType::XXX) in XDatabaseMetaData::getTypeInfo()
indirectly. (We want to return a Firebird type for each internal type,
not in the opposite direction.

I can remove the block but perhaps it should be fixed, in this case, I don't know what should be done.

Lionel/Tamas: don't hesitate to share your thoughts about it.
Comment 4 Julien Nabet 2020-12-06 10:09:27 UTC
After the different FBs related changes in LO, the root cause was easier to find.
https://gerrit.libreoffice.org/c/core/+/107280

With it when reopening the table we still see "Binary(fix)[CHAR]" and it can be used in a form.
The pb is when I tried to insert an image, I got a crash :-( However I suppose it should be another bugtracker.
Comment 5 Commit Notification 2020-12-06 11:51:04 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f26949e23d13d1b94d4b2bdfe8c4432d720d0fc8

tdf#125957: FIREBIRD Datatype Binary(fix)[CHAR] couldn't be filled with content

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Julien Nabet 2020-12-06 11:55:00 UTC
patches waiting for Jenkins here:
for 7.1: https://gerrit.libreoffice.org/c/core/+/107294
for 7.0: https://gerrit.libreoffice.org/c/core/+/107295

(considering the root cause, it's not Linux specific or 64 bits specific)
Comment 7 Commit Notification 2020-12-06 12:22:40 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/581f17605985fe659141e67f692215974880ae55

tdf#125957: FIREBIRD Datatype Binary(fix)[CHAR] couldn't be filled with content

It will be available in 7.1.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2020-12-06 13:34:25 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/9ccfe37486cb8caa018c714a670514fcedbe4a0f

tdf#125957: FIREBIRD Datatype Binary(fix)[CHAR] couldn't be filled with content

It will be available in 7.0.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.