Fix copying of query contexts for async backup/restore.

This commit is contained in:
Vitaly Baranov 2022-12-10 23:50:00 +01:00
parent 5aaff60650
commit 4f0d1c5e0f

View File

@ -181,6 +181,7 @@ OperationID BackupsWorker::startMakingBackup(const ASTPtr & query, const Context
/// For ON CLUSTER queries we will need to change some settings.
/// For ASYNC queries we have to clone the context anyway.
context_in_use = mutable_context = Context::createCopy(context);
mutable_context->makeQueryContext();
}
if (backup_settings.async)
@ -400,6 +401,7 @@ OperationID BackupsWorker::startRestoring(const ASTPtr & query, ContextMutablePt
/// For ON CLUSTER queries we will need to change some settings.
/// For ASYNC queries we have to clone the context anyway.
context_in_use = Context::createCopy(context);
context_in_use->makeQueryContext();
}
if (restore_settings.async)