Issue Details (XML | Word | Printable)

Key: CORE-6023
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Alexander Peshkov
Reporter: michalk1
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

FB4 unable to overwrite older ods database

Created: 13/Mar/19 08:23 AM   Updated: 29/Dec/20 09:09 AM
Component/s: Engine
Affects Version/s: 4.0 Beta 1
Fix Version/s: 4.0 RC 1

Environment: Windows 10, FB 4.0 Beta 1

QA Status: No test


 Description  « Hide
FB4 is unable to overwrite database files created by older firebird versions. It concerns gbak restore (with -rep switch) and database creation functions, even when run under sysdba account. This is probably not an error per se, but it differs from FB3 and can complicate automated database migration process.

gbak -rep -v -user sydba -password masterkey C:\TEST\TEST.GBK localhost:C:\TEST\TEST.FDB
...
gbak: ERROR:unsupported on-disk structure for file C:\TEST\TEST.FDB; found 11.2, support 13.0
gbak: ERROR: IProvider::attachDatabase failed when loading mapping cache
gbak: ERROR:failed to create database localhost:c:\TEST\TEST.FDB

Local (embedded) connections are not affected, only TCP ones. Strangely, when embedded overwriting is tested first, the server seems to remember that it has successfully accessed this database file, so that subsequent TCP rewrites of the same file (that I each time replace by the original old database) now succeed as well. This lasts until server is restarted.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 13/May/19 03:53 PM
Rule is that one should attach then drop. For non-database files (and older ODS) that is not possible.

I think the behavior should not be changed.

Alexander Peshkov added a comment - 10/Apr/20 05:05 PM
At least we should not have different behavior for remote vs. embedded connections. Currently:

# ./gbak -user sysdba -pas masterkey -rep e4.fbk localhost:`pwd`/employee3.fdb
gbak: ERROR:unsupported on-disk structure for file /usr/home/firebird/HEAD/gen/Debug/firebird/bin/employee3.fdb; found 12.0, support 13.0
gbak: ERROR: IProvider::attachDatabase failed when loading mapping cache
gbak: ERROR:failed to create database localhost:/usr/home/firebird/HEAD/gen/Debug/firebird/bin/employee3.fdb
gbak:Exiting before completion due to errors
# ./gbak -rep e4.fbk employee3.fdb
#


Alexander Peshkov added a comment - 25/Dec/20 05:52 PM
@Adriano - it was really regression, when isc_dpb_overwrite is used firebird was intended to unlink file to be overwritten, not only drop database.

Adriano dos Santos Fernandes added a comment - 28/Dec/20 04:07 PM
Alex, database were attached and dropped to not unlink arbitrary (non-database) files.

Alexander Peshkov added a comment - 29/Dec/20 09:09 AM
At least since 2.1 version we have another behavior. I create foolish, definitely non-database, file:
echo jnjdnjfn >/tmp/not.fdb

And after it can replace it with rather old gbak:
gbak -z -rep -user sysdba -pas masterkey e21.bak localhost:/tmp/not.fdb
gbak:gbak version LI-V2.1.7.18553 Firebird 2.1
gbak: Version(s) for database "localhost:/tmp/not.fdb"
        Firebird/linux AMD64 (access method), version "LI-V2.1.7.18553 Firebird 2.1"
        Firebird/linux AMD64 (remote server), version "LI-V2.1.7.18553 Firebird 2.1/tcp (fbs3)/P11"
        Firebird/linux AMD64 (remote interface), version "LI-V2.1.7.18553 Firebird 2.1/tcp (fbs3)/P11"
        on disk structure version 11.1

I have no desire to build fb1.0 right now but looking at it's sources one can see that control over overwrite option was enhanced since that time: default changed to false and added check for overwrite of database w/o admin rights. But what about generic non-DB file - it was always overwritable with dpb_overwrite.