mirror of https://gitee.com/bigwinds/arangodb
add initializeCursor back to DistinctCollectExecutor (#9386)
This commit is contained in:
parent
61f3397e33
commit
801c957348
|
@ -64,12 +64,11 @@ DistinctCollectExecutor::DistinctCollectExecutor(Fetcher& fetcher, Infos& infos)
|
|||
AqlValueGroupEqual(_infos.getTransaction())) {}
|
||||
|
||||
DistinctCollectExecutor::~DistinctCollectExecutor() {
|
||||
// destroy all AqlValues captured
|
||||
for (auto& it : _seen) {
|
||||
for (auto& it2 : it) {
|
||||
const_cast<AqlValue*>(&it2)->destroy();
|
||||
}
|
||||
}
|
||||
destroyValues();
|
||||
}
|
||||
|
||||
void DistinctCollectExecutor::initializeCursor() {
|
||||
destroyValues();
|
||||
}
|
||||
|
||||
std::pair<ExecutionState, NoStats> DistinctCollectExecutor::produceRows(OutputAqlItemRow& output) {
|
||||
|
@ -138,3 +137,13 @@ std::pair<ExecutionState, size_t> DistinctCollectExecutor::expectedNumberOfRows(
|
|||
// but it is upper bounded by the input.
|
||||
return _fetcher.preFetchNumberOfRows(atMost);
|
||||
}
|
||||
|
||||
void DistinctCollectExecutor::destroyValues() {
|
||||
// destroy all AqlValues captured
|
||||
for (auto& it : _seen) {
|
||||
for (auto& it2 : it) {
|
||||
const_cast<AqlValue*>(&it2)->destroy();
|
||||
}
|
||||
}
|
||||
_seen.clear();
|
||||
}
|
||||
|
|
|
@ -95,6 +95,8 @@ class DistinctCollectExecutor {
|
|||
DistinctCollectExecutor(DistinctCollectExecutor const&) = delete;
|
||||
DistinctCollectExecutor(Fetcher& fetcher, Infos&);
|
||||
~DistinctCollectExecutor();
|
||||
|
||||
void initializeCursor();
|
||||
|
||||
/**
|
||||
* @brief produce the next Row of Aql Values.
|
||||
|
@ -107,6 +109,7 @@ class DistinctCollectExecutor {
|
|||
|
||||
private:
|
||||
Infos const& infos() const noexcept { return _infos; };
|
||||
void destroyValues();
|
||||
|
||||
private:
|
||||
Infos const& _infos;
|
||||
|
|
|
@ -372,6 +372,9 @@ std::pair<ExecutionState, Result> ExecutionBlockImpl<Executor>::initializeCursor
|
|||
static_assert(!std::is_same<Executor, IndexExecutor>::value || customInit,
|
||||
"IndexExecutor is expected to implement a custom "
|
||||
"initializeCursor method!");
|
||||
static_assert(!std::is_same<Executor, DistinctCollectExecutor>::value || customInit,
|
||||
"DistinctCollectExecutor is expected to implement a custom "
|
||||
"initializeCursor method!");
|
||||
InitializeCursor<customInit>::init(_executor, _rowFetcher, _infos);
|
||||
|
||||
// // use this with c++17 instead of specialisation below
|
||||
|
|
Loading…
Reference in New Issue