File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 16
16
#include < Common/QueryFuzzer.h>
17
17
#include < Common/ShellCommand.h>
18
18
#include < Common/Stopwatch.h>
19
+ #include " IO/WriteBufferFromVector.h"
19
20
20
21
#include < Storages/MergeTree/MergeTreeSettings.h>
21
22
#include < Storages/SelectQueryInfo.h>
24
25
#include < boost/program_options.hpp>
25
26
26
27
#include < atomic>
28
+ #include < memory>
27
29
#include < optional>
28
30
#include < string>
29
31
#include < string_view>
@@ -105,12 +107,14 @@ class ClientBase
105
107
return query_result_memory;
106
108
}
107
109
108
- std::span<char > getQueryOutputSpan ()
110
+ // / Steals and returns the query output vector, replacing it with a new one
111
+ std::vector<char > * stealQueryOutputVector ()
109
112
{
110
- if (!query_result_memory || !query_result_buf)
111
- return {};
112
- auto size = query_result_buf->count ();
113
- return std::span<char >(query_result_memory->begin (), size);
113
+ auto * result = query_result_memory;
114
+ query_result_memory = new std::vector<char >(4096 );
115
+ // WriteBufferFromVector takes a reference to the vector but doesn't own it
116
+ query_result_buf = std::make_shared<WriteBufferFromVector<std::vector<char >>>(*query_result_memory);
117
+ return result;
114
118
}
115
119
116
120
size_t getProcessedRows () const { return processed_rows; }
You can’t perform that action at this time.
0 commit comments