#At file:///localhome/jl208045/mysql/mysql-6.0-backup-empty/
2740 Jorgen Loland 2008-11-20
Bug#34579 - Backup: Restore overwrites the new / modified data without warning
Follow-up patch: Fix compile warning and cleanup iterator object in case of
DBUG_RETURN
modified:
sql/backup/kernel.cc
per-file messages:
sql/backup/kernel.cc
Fix compile warning and cleanup iterator object in case of DBUG_RETURN
=== modified file 'sql/backup/kernel.cc'
--- a/sql/backup/kernel.cc 2008-11-17 09:57:51 +0000
+++ b/sql/backup/kernel.cc 2008-11-20 13:53:41 +0000
@@ -1236,8 +1236,9 @@ int Backup_restore_ctx::do_restore(bool
}
Image_info::Db *mydb;
- while (mydb= static_cast<Image_info::Db*>((*dbit)++)) {
+ while ((mydb= static_cast<Image_info::Db*>((*dbit)++))) {
if (!obs::check_db_existence(&mydb->name())) {
+ delete dbit;
DBUG_RETURN(fatal_error(ER_RESTORE_DB_EXISTS, mydb->name().ptr()));
}
}