Skip to content

Commit 52db7fe

Browse files
committed
Given the backup file already contains fields in the optimized order, insist on it and prevent the engine from generating field IDs in a different order. This restores the original record layout optimization accidentally broken by my commit #2ed48a6.
1 parent 67fa3b6 commit 52db7fe

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/burp/restore.epp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ bool get_collation(BurpGlobals* tdgbl);
132132
SLONG get_compressed(BurpGlobals* tdgbl, UCHAR* buffer, SLONG length);
133133
void get_data(BurpGlobals* tdgbl, burp_rel*, WriteRelationReq* req);
134134
bool get_exception(BurpGlobals* tdgbl);
135-
burp_fld* get_field(BurpGlobals* tdgbl, burp_rel*);
135+
burp_fld* get_field(BurpGlobals* tdgbl, burp_rel*, USHORT id);
136136
bool get_field_dimensions(BurpGlobals* tdgbl);
137137
bool get_files(BurpGlobals* tdgbl);
138138
bool get_filter(BurpGlobals* tdgbl);
@@ -3806,7 +3806,7 @@ bool get_exception(BurpGlobals* tdgbl)
38063806
}
38073807

38083808

3809-
burp_fld* get_field(BurpGlobals* tdgbl, burp_rel* relation)
3809+
burp_fld* get_field(BurpGlobals* tdgbl, burp_rel* relation, USHORT id)
38103810
{
38113811
/**************************************
38123812
*
@@ -3865,6 +3865,9 @@ burp_fld* get_field(BurpGlobals* tdgbl, burp_rel* relation)
38653865
// ODS 14
38663866
X.RDB$FIELD_SOURCE_SCHEMA_NAME.NULL = TRUE;
38673867

3868+
X.RDB$FIELD_ID.NULL = FALSE;
3869+
X.RDB$FIELD_ID = id;
3870+
38683871
if (relation->rel_name.schema.hasData())
38693872
{
38703873
strcpy(X.RDB$SCHEMA_NAME, relation->rel_name.schema.c_str());
@@ -4084,6 +4087,9 @@ burp_fld* get_field(BurpGlobals* tdgbl, burp_rel* relation)
40844087
X.RDB$NULL_FLAG.NULL = TRUE;
40854088
X.RDB$COLLATION_ID.NULL = TRUE;
40864089

4090+
X.RDB$FIELD_ID.NULL = FALSE;
4091+
X.RDB$FIELD_ID = id;
4092+
40874093
skip_init(&scan_next_attr);
40884094
while (get_attribute(&attribute, tdgbl) != att_end)
40894095
{
@@ -8249,6 +8255,7 @@ bool get_relation(BurpGlobals* tdgbl, Coordinator* coord, RestoreRelationTask* t
82498255
// Eat up misc. records
82508256
burp_fld* field = NULL;
82518257
burp_fld** ptr = &relation->rel_fields;
8258+
USHORT id = 0;
82528259

82538260
rec_type record;
82548261
while (get_record(&record, tdgbl) != rec_data)
@@ -8277,7 +8284,7 @@ bool get_relation(BurpGlobals* tdgbl, Coordinator* coord, RestoreRelationTask* t
82778284
return true;
82788285

82798286
case rec_field:
8280-
*ptr = field = get_field (tdgbl, relation);
8287+
*ptr = field = get_field(tdgbl, relation, id++);
82818288
if (!field)
82828289
return false;
82838290
ptr = &field->fld_next;

0 commit comments

Comments
 (0)