Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FB4 unable to overwrite older ods database [CORE6023] #6273

Closed
firebird-automations opened this issue Mar 13, 2019 · 9 comments
Closed

FB4 unable to overwrite older ods database [CORE6023] #6273

firebird-automations opened this issue Mar 13, 2019 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: michalk1 (michalk1)

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.

Commits: c3724f8

====== Test Details ======

See notes in .fbt

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

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
#⁠

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

@adriano - it was really regression, when isc_dpb_overwrite is used firebird was intended to unlink file to be overwritten, not only drop database.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 RC 1 [ 10930 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Alex, database were attached and dropped to not unlink arbitrary (non-database) files.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

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.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Deferred

Test Details: Can not reproduce using 4.0.0.1803 (built 12-mar-2019).
Sent letter to Alex at el, 13.02.2021 17:40. Waiting for reply.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Deferred => Done with caveats

Test Details: Can not reproduce using 4.0.0.1803 (built 12-mar-2019).
Sent letter to Alex at el, 13.02.2021 17:40. Waiting for reply.

=>

See notes in .fbt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants