Bug 125613 - FIREBIRD: Impossible to import boolean content from Calc to Firebird
Summary: FIREBIRD: Impossible to import boolean content from Calc to Firebird
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.2.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2019-05-31 19:58 UTC by Robert Großkopf
Modified: 2021-12-21 16:38 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Firebird table for importing content from Calc (4.76 KB, application/vnd.oasis.opendocument.database)
2019-05-31 19:58 UTC, Robert Großkopf
Details
Calc-table as content for the Firebird table (8.54 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-05-31 19:59 UTC, Robert Großkopf
Details
bt with debug symbols (gtk3) (10.16 KB, text/plain)
2019-05-31 20:07 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2019-05-31 19:58:28 UTC
Created attachment 151815 [details]
Firebird table for importing content from Calc

Download the two attachments: One with a Firebird database, another with a Calc table. 
Copy the content of the table and try to import it to the table, which already exists in Firebird. The fields will have the right order, the first row will have the field names.
An error appears: "Incorrect type for setString".
All fields with different commands for setting a boolean-field will be filled as TRUE, only the empty field will be set as NULL.
It will be impossible to set a boolean field FALSE through the import from Calc.

All is tested with LO 6.2.4.2 on OpenSUSE 15 64bit rpm Linux.
Comment 1 Robert Großkopf 2019-05-31 19:59:08 UTC
Created attachment 151816 [details]
Calc-table as content for the Firebird table
Comment 2 Julien Nabet 2019-05-31 20:07:02 UTC
Created attachment 151817 [details]
bt with debug symbols (gtk3)

On pc Debian x86-64 with master sources updated today, I could reproduce this.

I attached a bt corresponding to the one which generates the dialog box.
Comment 3 Julien Nabet 2019-05-31 21:07:40 UTC
Gdb debugging shows the pb is in dbaccess/source/ui/misc/DExport.cxx, function ODatabaseExport::insertValueIntoColumn(), DataType::BOOLEAN isn't taken into account.
So we got this:
#0  0x00007fffd3482bfb in connectivity::firebird::OPreparedStatement::setDouble(int, double) (this=0x55555df5ee30, nIndex=2, nValue=0)
    at /home/julien/lo/libreoffice/connectivity/source/drivers/firebird/PreparedStatement.cxx:417
#1  0x00007fffd11210db in dbaui::OParameterUpdateHelper::updateDouble(int, double const&) (this=0x55555defaea0, _nPos=2, _nValue=@0x7ffffffefdc0: 0)
    at /home/julien/lo/libreoffice/dbaccess/source/ui/misc/UpdateHelperImpl.hxx:50
#2  0x00007fffd111cd2e in dbaui::ODatabaseExport::insertValueIntoColumn() (this=0x55555df25ca0) at /home/julien/lo/libreoffice/dbaccess/source/ui/misc/DExport.cxx:380
#3  0x00007fffd11372fa in dbaui::OHTMLReader::NextToken(HtmlTokenId) (this=0x55555df25bc0, nToken=HtmlTokenId::TABLEDATA_OFF) at /home/julien/lo/libreoffice/dbaccess/source/ui/misc/HtmlReader.cxx:194
Comment 4 Julien Nabet 2019-05-31 21:25:45 UTC
Should we add "updateBoolean" in IUpdateHelper.hxx https://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/inc/IUpdateHelper.hxx?r=f3d9aab8 and implement it UpdateHelperImpl.hxx?

UpdateHelperImpl.hxx seems only used by DExport.hxx but since updateBoolean seems present in each DB driver (when using git grep -n updateBoolean in connectivity part), thought it could help.

Any thoughts?
Comment 5 Julien Nabet 2019-06-01 09:33:56 UTC
I gave it a try but it seems offapi/com/sun/star/sdbc/XParameters.idl should be changed too to add a setBoolean method.

Also, perhaps all "updateBoolean" methods hould be changed to take a "bool" var instead of sal_Bool.
Comment 6 Julien Nabet 2021-12-20 21:03:20 UTC
Robert: on pc Debian x86-64 with master sources updated today or with LO Debian package 7.2.4.1, I don't reproduce this anymore.
Could you give a new try?
Comment 7 Robert Großkopf 2021-12-21 16:38:48 UTC
(In reply to Julien Nabet from comment #6)
> Robert: on pc Debian x86-64 with master sources updated today or with LO
> Debian package 7.2.4.1, I don't reproduce this anymore.
> Could you give a new try?

You are right. Tested it with LO 7.2.5.1 on OpenSUSE 15.2 64bit rpm Linux. Works now as expected. I will close this one as WORKSFORME.