Skip to content

Commit

Permalink
Backport fix for CORE-1064 - Wrong backup order for character sets an…
Browse files Browse the repository at this point in the history
…d collations
  • Loading branch information
asfernandes committed Dec 27, 2006
1 parent 1b6650c commit 1955e81
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions src/burp/backup.epp
Expand Up @@ -297,12 +297,12 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)



// decide what type of database we've got
// decide what type of database we've got

set_capabilities();

// Write burp record first with other valuable information
// In case of split operation, write a 'split' header first to all the files
// Write burp record first with other valuable information
// In case of split operation, write a 'split' header first to all the files

if (tdgbl->action->act_action == ACT_backup_split)
{
Expand All @@ -320,11 +320,11 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)

MVOL_init_write(dbb_file, file_name, &tdgbl->io_cnt, &tdgbl->io_ptr);

// Write database record
// Write database record

write_database(dbb_file);

// Write global fields
// Write global fields

BURP_verbose(150, NULL, NULL, NULL, NULL, NULL);
// msg 150 writing global fields
Expand All @@ -339,7 +339,19 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)
write_shadow_files();
}

// Write relations
if (tdgbl->BCK_capabilities & BCK_ods8)
{
// Write Character Sets
BURP_verbose(msgVerbose_write_charsets, NULL, NULL, NULL, NULL, NULL);
write_character_sets();

// Write Collations
BURP_verbose(msgVerbose_write_collations, NULL, NULL, NULL, NULL,
NULL);
write_collations();
}

// Write relations

BURP_verbose(154, NULL, NULL, NULL, NULL, NULL);
// msg 154 writing relations
Expand Down Expand Up @@ -381,19 +393,9 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)
BURP_verbose(197, NULL, NULL, NULL, NULL, NULL);
// msg 197 writing exceptions
write_exceptions();

// Write Character Sets
BURP_verbose(msgVerbose_write_charsets, NULL, NULL, NULL, NULL, NULL);
write_character_sets();

// Write Collations
BURP_verbose(msgVerbose_write_collations, NULL, NULL, NULL, NULL,
NULL);
write_collations();

}

// Now go back and write all data
// Now go back and write all data

for (burp_rel* relation = tdgbl->relations; relation; relation = relation->rel_next) {
put(tdgbl, (UCHAR) (rec_relation_data));
Expand All @@ -412,7 +414,7 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)
put(tdgbl, (UCHAR) (rec_relation_end));
}

// now for the new triggers in rdb$triggers
// now for the new triggers in rdb$triggers
if (tdgbl->BCK_capabilities & BCK_ffmptt) {
BURP_verbose(159, NULL, NULL, NULL, NULL, NULL);
// msg 159 writing triggers
Expand All @@ -423,7 +425,7 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)
write_user_privileges();
}

// Last, but not least, go back and add any access control lists
// Last, but not least, go back and add any access control lists

if (tdgbl->BCK_capabilities & BCK_security)
{
Expand Down Expand Up @@ -474,7 +476,7 @@ int BACKUP_backup(const TEXT* dbb_file, const TEXT* file_name)
write_sql_roles();
}

// Finish up
// Finish up

put(tdgbl, (UCHAR) (rec_end));

Expand Down

0 comments on commit 1955e81

Please sign in to comment.