FirebirdSQL / firebird

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

gbak may lose NULLs in restore #8241

Closed asfernandes closed 2 months ago

asfernandes commented 2 months ago

I can reproduce this problem using a dialect 1 database with column name using a keyword. It may happens if by any reason the batch creation fails.

tdgbl->RESTORE_format is not initialized and in prepareRequest it understand the engine as an old one not supporting blr_parameter2.

Test case:

isql

create database 'x.fdb';

create table t ("TABLE" integer);
insert into t values (null);
insert into t values (null);

commit;
gfix -sql_dialect 1 x.fdb
gbak -b x.fdb x.fbk
gbak -v -c -rep x.fbk localhost:`pwd`/xb.fdb
isql xb.fdb

-- NULLs are transformed to 0
select * from t;