Skip to content

Commit

Permalink
Allow backup/restore of MSSQL database with spaces in name
Browse files Browse the repository at this point in the history
Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
zkrapavickas authored and Marco van Wieringen committed Oct 28, 2015
1 parent 7559374 commit 8ebd890
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -137,3 +137,4 @@ Vitaliy Kosharskiy
Wolfgang Denk
Yuri Timofeev
Yves Orton
Zilvinas Krapavickas
8 changes: 4 additions & 4 deletions src/win32/plugins/filed/mssqlvdi-fd.c
Expand Up @@ -1178,7 +1178,7 @@ static inline void perform_ado_backup(bpContext *ctx)
break;
case L_DIFFERENTIAL:
Mmsg(ado_query,
"BACKUP DATABASE %s TO VIRTUAL_DEVICE='%s' WITH DIFFERENTIAL, BLOCKSIZE=%d, BUFFERCOUNT=%d, MAXTRANSFERSIZE=%d",
"BACKUP DATABASE [%s] TO VIRTUAL_DEVICE='%s' WITH DIFFERENTIAL, BLOCKSIZE=%d, BUFFERCOUNT=%d, MAXTRANSFERSIZE=%d",
p_ctx->database,
vdsname,
DEFAULT_BLOCKSIZE,
Expand All @@ -1187,7 +1187,7 @@ static inline void perform_ado_backup(bpContext *ctx)
break;
default:
Mmsg(ado_query,
"BACKUP DATABASE %s TO VIRTUAL_DEVICE='%s' WITH BLOCKSIZE=%d, BUFFERCOUNT=%d, MAXTRANSFERSIZE=%d",
"BACKUP DATABASE [%s] TO VIRTUAL_DEVICE='%s' WITH BLOCKSIZE=%d, BUFFERCOUNT=%d, MAXTRANSFERSIZE=%d",
p_ctx->database,
vdsname,
DEFAULT_BLOCKSIZE,
Expand Down Expand Up @@ -1238,7 +1238,7 @@ static inline void perform_ado_restore(bpContext *ctx)
break;
default:
Mmsg(ado_query,
"RESTORE DATABASE %s FROM VIRTUAL_DEVICE='%s' WITH BLOCKSIZE=%d, BUFFERCOUNT=%d, MAXTRANSFERSIZE=%d, %s",
"RESTORE DATABASE [%s] FROM VIRTUAL_DEVICE='%s' WITH BLOCKSIZE=%d, BUFFERCOUNT=%d, MAXTRANSFERSIZE=%d, %s",
p_ctx->database,
vdsname,
DEFAULT_BLOCKSIZE,
Expand Down Expand Up @@ -1377,7 +1377,7 @@ static inline bool perform_ado_recover(bpContext *ctx)
plugin_ctx *p_ctx = (plugin_ctx *)ctx->pContext;

set_ado_connect_string(ctx);
Mmsg(recovery_query, "RESTORE DATABASE %s WITH RECOVERY", p_ctx->database);
Mmsg(recovery_query, "RESTORE DATABASE [%s] WITH RECOVERY", p_ctx->database);

return run_ado_query(ctx, recovery_query.c_str());
}
Expand Down

0 comments on commit 8ebd890

Please sign in to comment.