restore.epp (Firebird-3.0.2.32703-0.tar.bz2) | : | restore.epp (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 2925 | skipping to change at line 2925 | |||
BURP_verbose (124, relation->rel_name); // msg 124 restoring data for re lation %s | BURP_verbose (124, relation->rel_name); // msg 124 restoring data for re lation %s | |||
lstring data; | lstring data; | |||
data.lstr_allocated = 0; | data.lstr_allocated = 0; | |||
data.lstr_address = NULL; | data.lstr_address = NULL; | |||
ULONG old_length = 0; | ULONG old_length = 0; | |||
ULONG records = 0; | ULONG records = 0; | |||
rec_type record; | rec_type record; | |||
bool resync = false; | ||||
while (true) | while (true) | |||
{ | { | |||
if (get(tdgbl) != att_data_length) | if (get(tdgbl) != att_data_length) | |||
BURP_error_redirect (NULL, 39); // msg 39 expected record length | BURP_error_redirect (NULL, 39); // msg 39 expected record length | |||
USHORT len = (USHORT) get_int32(tdgbl); | USHORT len = (USHORT) get_int32(tdgbl); | |||
if (!tdgbl->gbl_sw_transportable && len != length) | if (!tdgbl->gbl_sw_transportable && len != length) | |||
{ | { | |||
#ifdef sparc | #ifdef sparc | |||
if (!old_length) | if (!old_length) | |||
skipping to change at line 3016 | skipping to change at line 3017 | |||
get_blob (tdgbl, relation->rel_fields, (UCHAR *) buffer); | get_blob (tdgbl, relation->rel_fields, (UCHAR *) buffer); | |||
else if (record == rec_array) | else if (record == rec_array) | |||
get_array (tdgbl, relation, (UCHAR *) buffer); | get_array (tdgbl, relation, (UCHAR *) buffer); | |||
get_record(&record, tdgbl); | get_record(&record, tdgbl); | |||
} | } | |||
ISC_STATUS s; | ISC_STATUS s; | |||
// ASF: Preferable we should call isc_start_and_send only when re cords == 1, but this leaks | // ASF: Preferable we should call isc_start_and_send only when re cords == 1, but this leaks | |||
// memory when there are blobs and arrays fields - CORE-3802. | // memory when there are blobs and arrays fields - CORE-3802. | |||
if (records % 1000 == 1) | if (resync || records % 1000 == 1) | |||
s = isc_start_and_send(status_vector, &request, &gds_tran s, 0, (USHORT) length, buffer, 0); | s = isc_start_and_send(status_vector, &request, &gds_tran s, 0, (USHORT) length, buffer, 0); | |||
else | else | |||
s = isc_send(status_vector, &request, 0, (USHORT) length, buffer, 0); | s = isc_send(status_vector, &request, 0, (USHORT) length, buffer, 0); | |||
resync = (s != 0); | ||||
if (s) | if (s) | |||
{ | { | |||
if (status_vector[1] == isc_not_valid) | if (status_vector[1] == isc_not_valid) | |||
{ | { | |||
if (tdgbl->gbl_sw_incremental) | if (tdgbl->gbl_sw_incremental) | |||
{ | { | |||
BURP_print (false, 138, relation->rel_nam e); | BURP_print (false, 138, relation->rel_nam e); | |||
// msg 138 validation error on field in r elation %s | // msg 138 validation error on field in r elation %s | |||
BURP_print_status (false, status_vector); | BURP_print_status (false, status_vector); | |||
} | } | |||
skipping to change at line 3050 | skipping to change at line 3053 | |||
BURP_print(false, 114, relation->rel_name ); | BURP_print(false, 114, relation->rel_name ); | |||
BURP_print_status(false, status_vector); | BURP_print_status(false, status_vector); | |||
BURP_print(false, 342); // isc_gbak_inval id_data | BURP_print(false, 342); // isc_gbak_inval id_data | |||
} | } | |||
else | else | |||
BURP_error_redirect(status_vector, 342); // isc_gbak_invalid_data | BURP_error_redirect(status_vector, 342); // isc_gbak_invalid_data | |||
} | } | |||
else | else | |||
{ | { | |||
if (tdgbl->gbl_sw_incremental) | if (tdgbl->gbl_sw_incremental && isc_sqlcode(stat us_vector) != -902) | |||
{ | { | |||
BURP_print (false, 114, relation->rel_nam e); | BURP_print (false, 114, relation->rel_nam e); | |||
// msg 114 restore failed for record in r elation %s | // msg 114 restore failed for record in r elation %s | |||
BURP_print_status (false, status_vector); | BURP_print_status (false, status_vector); | |||
} | } | |||
else | else | |||
BURP_error_redirect (status_vector, 48); | BURP_error_redirect (status_vector, 48); | |||
// msg 48 isc_send failed | // msg 48 isc_send failed | |||
} | } | |||
records--; | ||||
} | } | |||
if (record != rec_data) | if (record != rec_data) | |||
break; | break; | |||
} // while (true) | } // while (true) | |||
BURP_free (buffer); | BURP_free (buffer); | |||
if (data.lstr_address) | if (data.lstr_address) | |||
BURP_free (data.lstr_address); | BURP_free (data.lstr_address); | |||
isc_release_request(status_vector, &request); | isc_release_request(status_vector, &request); | |||
skipping to change at line 7269 | skipping to change at line 7274 | |||
* Write relation meta-data and data. | * Write relation meta-data and data. | |||
* Use the default transaction for RELATIONS, | * Use the default transaction for RELATIONS, | |||
* and use the global_trans for VIEWS. This | * and use the global_trans for VIEWS. This | |||
* enables us to have views of SP and views | * enables us to have views of SP and views | |||
* with plans. Assume it is a view if it has | * with plans. Assume it is a view if it has | |||
* RDB$VIEW_BLR, also assume RDB$VIEW_BLR is | * RDB$VIEW_BLR, also assume RDB$VIEW_BLR is | |||
* the first blob in the backup file. | * the first blob in the backup file. | |||
* | * | |||
* | * | |||
**************************************/ | **************************************/ | |||
SLONG rel_flags = 0, sys_flag = 0, type = 0; | SLONG rel_flags = 0, sys_flag = fb_sysflag_user, type = rel_per | |||
bool rel_flags_null = true, type_null = true; | sistent; | |||
bool rel_flags_null = true; | ||||
ISC_QUAD view_blr = isc_blob_null, view_src = isc_blob_null, | ISC_QUAD view_blr = isc_blob_null, view_src = isc_blob_null, | |||
rel_desc = isc_blob_null, ext_desc = isc_blob_nul l; | rel_desc = isc_blob_null, ext_desc = isc_blob_nul l; | |||
bool view_blr_null = true, view_src_null = true, rel_desc_null = true, | bool view_blr_null = true, view_src_null = true, rel_desc_null = true, | |||
ext_desc_null = true; | ext_desc_null = true; | |||
BASED_ON RDB$RELATIONS.RDB$SECURITY_CLASS sec_class; | BASED_ON RDB$RELATIONS.RDB$SECURITY_CLASS sec_class; | |||
sec_class[0] = '\0'; | sec_class[0] = '\0'; | |||
bool sec_class_null = true; | bool sec_class_null = true; | |||
BASED_ON RDB$RELATIONS.RDB$EXTERNAL_FILE ext_file_name; | BASED_ON RDB$RELATIONS.RDB$EXTERNAL_FILE ext_file_name; | |||
ext_file_name[0] = '\0'; | ext_file_name[0] = '\0'; | |||
bool ext_file_name_null = true; | bool ext_file_name_null = true; | |||
// Before starting to restore relations, commit everything that was resto | ||||
red | ||||
// prior to this point. This ensures that no pending error can later affe | ||||
ct | ||||
// other metadata being restored. | ||||
if (!tdgbl->relations) | ||||
{ | ||||
BURP_verbose (68); | ||||
// msg 68 committing meta data | ||||
COMMIT | ||||
ON_ERROR | ||||
general_on_error (); | ||||
END_ERROR; | ||||
EXEC SQL SET TRANSACTION NO_AUTO_UNDO; | ||||
if (gds_status[1]) | ||||
EXEC SQL SET TRANSACTION; | ||||
} | ||||
// Pick up relation attributes | // Pick up relation attributes | |||
burp_rel* relation = (burp_rel*) BURP_alloc_zero (sizeof(burp_rel)); | burp_rel* relation = (burp_rel*) BURP_alloc_zero (sizeof(burp_rel)); | |||
relation->rel_next = tdgbl->relations; | relation->rel_next = tdgbl->relations; | |||
tdgbl->relations = relation; | tdgbl->relations = relation; | |||
/* | /* | |||
STORE (REQUEST_HANDLE tdgbl->handles_get_relation_req_handle1) | STORE (REQUEST_HANDLE tdgbl->handles_get_relation_req_handle1) | |||
X IN RDB$RELATIONS | X IN RDB$RELATIONS | |||
X.RDB$SYSTEM_FLAG = 0; | X.RDB$SYSTEM_FLAG = 0; | |||
skipping to change at line 7386 | skipping to change at line 7409 | |||
GET_TEXT(relation->rel_owner); | GET_TEXT(relation->rel_owner); | |||
break; | break; | |||
case att_relation_ext_file_name: | case att_relation_ext_file_name: | |||
ext_file_name_null = false; | ext_file_name_null = false; | |||
GET_TEXT(ext_file_name); | GET_TEXT(ext_file_name); | |||
break; | break; | |||
case att_relation_type: | case att_relation_type: | |||
if (tdgbl->RESTORE_format >= 8) | if (tdgbl->RESTORE_format >= 8) | |||
{ | ||||
type_null = false; | ||||
type = get_int32(tdgbl); | type = get_int32(tdgbl); | |||
} | ||||
else | else | |||
bad_attribute(scan_next_attr, attribute, 111); | bad_attribute(scan_next_attr, attribute, 111); | |||
break; | break; | |||
default: | default: | |||
bad_attribute(scan_next_attr, attribute, 111); | bad_attribute(scan_next_attr, attribute, 111); | |||
// msg 111 table | // msg 111 table | |||
break; | break; | |||
} | } | |||
} | } | |||
skipping to change at line 7423 | skipping to change at line 7443 | |||
X.RDB$SYSTEM_FLAG.NULL = FALSE; | X.RDB$SYSTEM_FLAG.NULL = FALSE; | |||
X.RDB$FLAGS.NULL = rel_flags_null; | X.RDB$FLAGS.NULL = rel_flags_null; | |||
X.RDB$SECURITY_CLASS.NULL = sec_class_null; | X.RDB$SECURITY_CLASS.NULL = sec_class_null; | |||
X.RDB$VIEW_BLR.NULL = view_blr_null; | X.RDB$VIEW_BLR.NULL = view_blr_null; | |||
X.RDB$VIEW_SOURCE.NULL = view_src_null; | X.RDB$VIEW_SOURCE.NULL = view_src_null; | |||
X.RDB$DESCRIPTION.NULL = rel_desc_null; | X.RDB$DESCRIPTION.NULL = rel_desc_null; | |||
X.RDB$RUNTIME.NULL = TRUE; | X.RDB$RUNTIME.NULL = TRUE; | |||
X.RDB$EXTERNAL_DESCRIPTION.NULL = ext_desc_null; | X.RDB$EXTERNAL_DESCRIPTION.NULL = ext_desc_null; | |||
X.RDB$EXTERNAL_FILE.NULL = ext_file_name_null; | X.RDB$EXTERNAL_FILE.NULL = ext_file_name_null; | |||
X.RDB$RELATION_TYPE.NULL = type_null; | X.RDB$RELATION_TYPE.NULL = FALSE; | |||
X.RDB$SYSTEM_FLAG = (USHORT) sys_flag; | X.RDB$SYSTEM_FLAG = (USHORT) sys_flag; | |||
X.RDB$FLAGS = (USHORT) rel_flags; | X.RDB$FLAGS = (USHORT) rel_flags; | |||
X.RDB$VIEW_BLR = view_blr; | X.RDB$VIEW_BLR = view_blr; | |||
X.RDB$VIEW_SOURCE = view_src; | X.RDB$VIEW_SOURCE = view_src; | |||
X.RDB$DESCRIPTION = rel_desc; | X.RDB$DESCRIPTION = rel_desc; | |||
X.RDB$EXTERNAL_DESCRIPTION = ext_desc; | X.RDB$EXTERNAL_DESCRIPTION = ext_desc; | |||
strcpy(X.RDB$SECURITY_CLASS, sec_class); | strcpy(X.RDB$SECURITY_CLASS, sec_class); | |||
strcpy(X.RDB$RELATION_NAME, relation->rel_name); | strcpy(X.RDB$RELATION_NAME, relation->rel_name); | |||
skipping to change at line 8473 | skipping to change at line 8493 | |||
X.RDB$DEBUG_INFO.NULL = TRUE; | X.RDB$DEBUG_INFO.NULL = TRUE; | |||
X.RDB$ENGINE_NAME.NULL = TRUE; | X.RDB$ENGINE_NAME.NULL = TRUE; | |||
X.RDB$ENTRYPOINT.NULL = TRUE; | X.RDB$ENTRYPOINT.NULL = TRUE; | |||
skip_init(&scan_next_attr); | skip_init(&scan_next_attr); | |||
while (skip_scan(&scan_next_attr), get_attribute(&attribu te, tdgbl) != att_end) | while (skip_scan(&scan_next_attr), get_attribute(&attribu te, tdgbl) != att_end) | |||
{ | { | |||
switch (attribute) | switch (attribute) | |||
{ | { | |||
case att_trig_type: | case att_trig_type: | |||
X.RDB$TRIGGER_TYPE = (USHORT) get_int32(t dgbl); | X.RDB$TRIGGER_TYPE = get_int32(tdgbl); | |||
break; | break; | |||
case att_trig_type2: | case att_trig_type2: | |||
if (tdgbl->RESTORE_format >= 10) | if (tdgbl->RESTORE_format >= 10) | |||
X.RDB$TRIGGER_TYPE = get_int64(td gbl); | X.RDB$TRIGGER_TYPE = get_int64(td gbl); | |||
else | else | |||
bad_attribute(scan_next_attr, att ribute, 134); | bad_attribute(scan_next_attr, att ribute, 134); | |||
break; | break; | |||
case att_trig_flags: | case att_trig_flags: | |||
End of changes. 11 change blocks. | ||||
9 lines changed or deleted | 32 lines changed or added |