FirebirdSQL / firebird

Firebird server, client and tools
https://firebirdsql.org
1.26k stars 217 forks source link

generator restored with increment=0 from 2.5 backup #8142

Closed hmoffatt closed 5 months ago

hmoffatt commented 5 months ago

I have a database backup created with Firebird 2.5 containing generators. When I restore them to a Firebird 5 server, using 2.5's gbak, they are restored with an increment of 0.

The original definition is as simple as CREATE GENERATOR GEN_G_USER_NUM;

It works if I restore using Firebird 5's gbak. If this is a 2.5 bug then I'll close it of course, or is it a 5 server bug? It was certainly a surprise as there were no errors given, just silent corruption.

AlexPeshkoff commented 5 months ago

That's definitely not a bug, but different behavior of different FB versions (we try to approach SQL std). FB5 gbak knows about that difference and takes it into an account. On contrary 2.5 gbak can not know about that difference (how could future changes be predicted >15 years ago) and therefore does can't perform correct restore.

PS. It's always preferred to use for restore exactly same GBAK version - such mode is better tested, frequently used and therefore much more stable.

PPS. One may use old versions for backup provided DB does not contain new features.