Bug 117072 - FIREBIRD: Migration Libo6.1 after starting migration then saving a copy of the file with 'file save as', leaves the file configured as hsqldb sdc and firebird .fbk also stored in the ODB file
Summary: FIREBIRD: Migration Libo6.1 after starting migration then saving a copy of th...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Firebird-Migration
  Show dependency treegraph
 
Reported: 2018-04-17 20:34 UTC by Drew Jensen
Modified: 2018-04-20 10:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
simple ODB with hsqldb database, tables only, migrate to fb without any errors. (3.30 KB, application/vnd.oasis.opendocument.database)
2018-04-17 20:34 UTC, Drew Jensen
Details
example of hsqldb marked ODB with firebird datafile also (7.76 KB, application/vnd.oasis.opendocument.database)
2018-04-17 22:59 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-04-17 20:34:35 UTC
Created attachment 141430 [details]
simple ODB with hsqldb database, tables only, migrate to fb without any errors.

Test system: Version: 6.1.0.0.alpha0+
Build ID: 0f93692fda4226323422cf82ce34ae4bd5e22fab
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-04-16_23:39:49
Locale: en-US (en_US.UTF-8); Calc: group

When the user allows the migration process to run the fb database is created in the database directory of the ODB as firebird.fbk. That is written to disk silently and if the user then closes the ODB without saving it firebird.fbk is left in the file on disk. This causes problems if the user then tries to migrate that file again. 

What I would of expected is that the firebird.fbk file was removed from the ODB and it saved, silently, so that the user has the orignal file as it was on the disk.

To reproduce:
Open the example odb.
Click on Tables.
Say yes to migrating to firebird.
Close the file without saving it.
Mount the original ODB file with an archive viewer and in the database directory you will find the firebird.fbk file.
Comment 1 Drew Jensen 2018-04-17 21:34:26 UTC
Thinking that it might be a problem to remove the .fbk if between the migration function and when the user decided to not save the file. ie- queries may need fixing and perhaps they edit a query marking the odb as dirty because the querydef has changed. The application has to not save that change to the querydef when removing firebird.fbk. 

It could be handled at the beginning of the migration process; check for and delete if found, before, creating the new fb db.
Comment 2 Drew Jensen 2018-04-17 22:39:19 UTC
I went through the the steps yet again (and then again with more actions) BUT now I can't reproduce this at all. Looking like this was a mistake to enter in tracker.
Comment 3 Drew Jensen 2018-04-17 22:59:32 UTC
Created attachment 141433 [details]
example of hsqldb marked ODB with firebird datafile also

Right and as soon as I entered that last comment I realized what I had done.

Start with a hsqldb file.
Start the migration process. 
Then save as with this migrated file.
The ODB is saved with the configuration for HSQLDB sdbc (and data files of course) and the firebird data file.

If you try to migrate this file it will fail with an error that it can't create a table that already exists.
Comment 4 Robert Großkopf 2018-04-18 18:33:55 UTC
Could confirm the buggy behavior.
Expected:
Migration is executed.
Save AS - will save the file with the migrated part.

Really happening:
Firebird database is also saved in the file where the migration started - but I haven't saved the file. Works in the background. Makes it impossible to try a new migration, because Firebird says: Table exist ...

Tested with 
Version: 6.1.0.0.alpha0+
Build-ID: cc10b063235dcb25ad16f697ea0b1ff91a10bacb
CPU-Threads: 4; BS: Linux 4.4; UI-Render: Standard; VCL: kde4; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-04-18_13:21:28
Comment 5 Drew Jensen 2018-04-18 19:32:19 UTC
@robert, this was very poor reporting on my part. I edited the summary to be something quite different from what it started as.

What I'm calling a bug here is not that there is a firebird.fbk file in new copy of the ODB rather that the file has not been properly updated to reflect the change of sdbc driver to use.
Comment 6 Drew Jensen 2018-04-18 19:38:10 UTC
to be precise the new ODB is not configured to use the firebird sdbc driver.

My first comment about a silent write to disk was IDK from where, I haven't reproduced it since.
Comment 7 Drew Jensen 2018-04-20 10:46:08 UTC
Checked with: Version: 6.1.0.0.alpha0+
Build ID: fc5d185bdb0f27bc6014d47338740f741ac05d21
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-04-19_00:40:03
Locale: en-US (en_US.UTF-8); Calc: group

this is working as I would expect now, the new file is recognized as embedded firebird.

Setting status to 'works for me'