ISSUES-16605 try fix review comment

This commit is contained in:
zhang2014 2020-11-22 20:42:55 +08:00
parent 0985029f49
commit ade04b5dc4

View File

@ -328,8 +328,15 @@ void MySQLHandler::comQuery(ReadBuffer & payload)
Context query_context = connection_context; Context query_context = connection_context;
size_t affected_rows = 0; std::atomic<size_t> affected_rows {0};
query_context.setProgressCallback([&](const Progress & progress) { affected_rows += progress.written_rows; }); auto prev = query_context.getProgressCallback();
query_context.setProgressCallback([&, prev = prev](const Progress & progress)
{
if (prev)
prev(progress);
affected_rows += progress.written_rows;
});
executeQuery(should_replace ? replacement : payload, *out, true, query_context, executeQuery(should_replace ? replacement : payload, *out, true, query_context,
[&with_output](const String &, const String &, const String &, const String &) [&with_output](const String &, const String &, const String &, const String &)