Bug 70425 - EDITING: Embedded Firebird - Copying integer values from Calc to Base impossible
Summary: EDITING: Embedded Firebird - Copying integer values from Calc to Base impossible
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.2.0.0.alpha0+ Master
Hardware: x86-64 (AMD64) All
: high major
Assignee: Not Assigned
URL:
Whiteboard: target:6.1.0 target:6.0.1
Keywords:
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2013-10-13 14:30 UTC by Robert Großkopf
Modified: 2019-07-10 11:27 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Package with database and Calc-document for the data - copy and paste (52.56 KB, application/zip)
2013-10-13 14:30 UTC, Robert Großkopf
Details
Version 3.0 of original odb file (4.01 KB, application/vnd.oasis.opendocument.database)
2016-11-12 09:28 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 2013-10-13 14:30:00 UTC
Created attachment 87557 [details]
Package with database and Calc-document for the data - copy and paste

Open the package of the attachment. There is a database with 3 different tables. The tables differ in the field-type of the primary-key-field "ID".

There is also a Calc-document with data for this tables.

Mark The data of one of the tables in the Calc-document and try to paste them to one table of the database. The tables with an integer or smallinteger primary-key won't accept the data:
Warning
Incorrect type for setString
Continue anyway?

OK, lets continue. One row would be added with, but the ID isn't the ID of the original table.
When you paste to the table Name_Varchar it would work.

Seems there are only characters allowed when pasting to Base-Firebird.
Comment 1 Terrence Enger 2013-10-13 17:57:18 UTC
I see this on Linux with master commit 95e95e0, fetched 2013-09-19.

Will somebody with Windows or Mac please test, so that we can tell
whether other platforms are afflicted?

Thanks,
Terry.
Comment 2 racoon 2014-07-10 19:17:44 UTC Comment hidden (me-too)
Comment 3 racoon 2014-08-05 11:55:42 UTC Comment hidden (no-value)
Comment 4 Alex Thurgood 2015-01-03 17:41:11 UTC Comment hidden (no-value)
Comment 5 racoon 2015-09-06 10:42:48 UTC Comment hidden (no-value)
Comment 6 Alex Thurgood 2016-06-03 07:19:08 UTC
Confirming on

Version: 4.4.5.2
Build ID: a22f674fd25a3b6f45bdebf25400ed2adff0ff99
Locale: fr.UTF-8

OSX 10.11.5
Comment 7 Julien Nabet 2016-06-04 16:44:23 UTC
On pc Debian x86-64 with master sources updated today, I gave a try but I only could paste the whole data in the same cell.
Must have missed something I suppose.

Anyway, it seems we're on a middle of a transition.
We won't upgrade to a newer HSQLDB version because we want to invest on Firebird but this last one is still experimental.
Moreover, an upgrade to Firebird 3.0 would arrive soon (I don't know when).
Comment 8 Julien Nabet 2016-08-19 18:09:34 UTC
With master sources updated today, I can't see tables.
Indeed, I got this error:
warn:connectivity.firebird:4258:1:connectivity/source/drivers/firebird/Util.cxx:52: firebird_sdbc error:
*unsupported on-disk structure for file /tmp/lu21wdtc.tmp/lu21wdth.tmp/firebird.fdb; found 11.2, support 12.0
caused by
'isc_attach_database'

warn:legacy.osl:4258:1:svtools/source/uno/genericunodialog.cxx:314: OGenericUnoDialog::OnDialogDying: where does this come from?
warn:connectivity.firebird:4258:1:connectivity/source/drivers/firebird/Util.cxx:52: firebird_sdbc error:
*unsupported on-disk structure for file /tmp/lu21wdtc.tmp/lu21wdti.tmp/firebird.fdb; found 11.2, support 12.0
caused by
'isc_attach_database'
Comment 9 Lionel Elie Mamane 2016-08-19 19:54:20 UTC
(In reply to Julien Nabet from comment #8)
> With master sources updated today, I can't see tables.
> Indeed, I got this error:
> warn:connectivity.firebird:4258:1:connectivity/source/drivers/firebird/Util.
> cxx:52: firebird_sdbc error:
> *unsupported on-disk structure for file
> /tmp/lu21wdtc.tmp/lu21wdth.tmp/firebird.fdb; found 11.2, support 12.0
> caused by
> 'isc_attach_database'

That's because of the update to Firebird 3.0; I just documented that in 
https://wiki.documentfoundation.org/ReleaseNotes/5.3#Base
Comment 10 Gerhard Schaber 2016-08-30 12:16:20 UTC
Could you please document the commands necessary to convert an fdb file to the archive format using a Firebird server? Thanks.
Comment 11 Gerhard Schaber 2016-08-30 12:44:53 UTC
Never mind. See http://www.firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-compat-upgrade-secdb.html. The third step is apparently not necessary.
1. Extract firebird.fdb from the database folder of the odb file
2. With a Firebird 2.5 server installation run: gbak -user sysdba -pas masterkey -b {host/path}firebird.fdb firebird25.fbk
3. With a Firebird 3.0 server installation run: gbak -user sysdba -pas masterkey -c firebird25.fbk {host/path}firebird.fdb
4. Replace firebird.fdb in the database folder of the odb file with the newly generated firebird.fdb
Comment 12 Robert Großkopf 2016-10-21 06:46:07 UTC
Nothing changed.
Bug also appears with new internal Firebird 3.0.

Version: 5.3.0.0.alpha0+
Build ID: e7324c5705eaa38a2c9aa0636f01a73f033ba4d6
CPU Threads: 4; OS Version: Linux 4.1; UI Render: default; VCL: kde4; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-10-20_06:12:58
Locale: de-DE (de_DE.UTF-8); Calc: group
Comment 13 Julien Nabet 2016-11-12 09:28:29 UTC
Created attachment 128685 [details]
Version 3.0 of original odb file

I used Lionel's tip for the convert:
 - install Firebird 2.5
 - uncompress odb file
 - gbak -backup firebird.fdb firebird.fbk
 - rm firebird.fdb
 - change owner and rights of the file firebird.bk
 - recompress all the elements (with the brand new firebird.fbk)
 - change extension from zip to odb

(see https://bugs.documentfoundation.org/show_bug.cgi?id=70506#c15)
Comment 14 Julien Nabet 2016-11-12 09:34:26 UTC
On pc Debian x86-64 with master sources updated today but when pasting in Name_VarcharID, LO put all the content in the first cell (ID).
Whatever I selected 1 row or all the rows (without header) of non special character part from ods file.
Comment 15 Julien Nabet 2016-11-12 09:47:21 UTC
Ok, I succeeded in reproducing this.
I had tried to paste after having opened the table instead of pasting in table directly.

I noticed this on console when trying to paste in one of the tables with integer/smallinteger primary key:
warn:legacy.osl:7313:1:connectivity/source/commontools/TTableHelper.cxx:239: lcl_sanitizeColumnDescs: database did provide invalid ORDINAL_POSITION values!
Comment 16 QA Administrators 2017-11-25 09:43:28 UTC Comment hidden (obsolete)
Comment 17 Robert Großkopf 2017-11-25 16:28:58 UTC
Nothing changed. Couldn't copy integer values from Calc to Base with Firebird 3.0.
Tested with
Version: 5.4.3.2
Build-ID: 92a7159f7e4af62137622921e809f8546db437e5
CPU-Threads: 4; Betriebssystem:Linux 4.4; UI-Render: Standard; VCL: kde4; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group
Comment 18 Commit Notification 2017-12-09 11:03:18 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9ccc1f59446bc4a16b6d090a3b556e184eb5f159

tdf#70425 Firebird: accept integers in setDouble

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2017-12-09 11:05:02 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9585521c28b74dec36522a6501ca670b8e14c7ca

tdf#70425 do not close cursor explicitly

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 20 Gerhard Schaber 2018-01-02 16:18:15 UTC
Hello. Will this go into 6.0 as well?
Comment 21 Julien Nabet 2018-01-07 16:47:45 UTC
(In reply to Gerhard Schaber from comment #20)
> Hello. Will this go into 6.0 as well?

About 6.0, I tried to merge the 2 quoted patches for this, it's on review on gerrit:
https://gerrit.libreoffice.org/#/c/47543/
Comment 22 Commit Notification 2018-01-27 20:02:48 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=25c751bc92534dca545d75ca348e895e2c335551&h=libreoffice-6-0

tdf#70425 suppress error of closing closed cursor

It will be available in 6.0.1.

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

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