mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-29 13:10:48 +00:00
ISSUES-16605 try fix review comment
This commit is contained in:
parent
0985029f49
commit
ade04b5dc4
@ -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 &)
|
||||||
|
Loading…
Reference in New Issue
Block a user