diff --git a/arangod/Aql/IndexBlock.cpp b/arangod/Aql/IndexBlock.cpp index f7083e1085..e4ff362716 100644 --- a/arangod/Aql/IndexBlock.cpp +++ b/arangod/Aql/IndexBlock.cpp @@ -284,7 +284,7 @@ bool IndexBlock::initIndexes() { _currentIndex = 0; } - _cursor = createCursor(); + createCursor(); if (_cursor->failed()) { THROW_ARANGO_EXCEPTION(_cursor->code); } @@ -297,7 +297,7 @@ bool IndexBlock::initIndexes() { } if (_currentIndex < _indexes.size()) { // This check will work as long as _indexes.size() < MAX_SIZE_T - _cursor = createCursor(); + createCursor(); if (_cursor->failed()) { THROW_ARANGO_EXCEPTION(_cursor->code); } @@ -312,7 +312,7 @@ bool IndexBlock::initIndexes() { } /// @brief create an OperationCursor object -std::shared_ptr IndexBlock::createCursor() { +void IndexBlock::createCursor() { DEBUG_BEGIN_BLOCK(); IndexNode const* node = static_cast(getPlanNode()); auto outVariable = node->outVariable(); @@ -328,10 +328,10 @@ std::shared_ptr IndexBlock::createCursor() { TRI_ASSERT(_indexes.size() > _currentIndex); - return ast->query()->trx()->indexScanForCondition( + _cursor.reset(ast->query()->trx()->indexScanForCondition( _collection->getName(), _indexes[_currentIndex], ast, conditionNode, outVariable, UINT64_MAX, - Transaction::defaultBatchSize(), node->_reverse); + Transaction::defaultBatchSize(), node->_reverse)); DEBUG_END_BLOCK(); } @@ -347,9 +347,9 @@ void IndexBlock::startNextCursor() { } if (_currentIndex < _indexes.size()) { // This check will work as long as _indexes.size() < MAX_SIZE_T - _cursor = createCursor(); + createCursor(); } else { - _cursor = nullptr; + _cursor.reset(nullptr); } DEBUG_END_BLOCK(); } diff --git a/arangod/Aql/IndexBlock.h b/arangod/Aql/IndexBlock.h index f6404d1ed7..c8b8fd9b0b 100644 --- a/arangod/Aql/IndexBlock.h +++ b/arangod/Aql/IndexBlock.h @@ -80,7 +80,7 @@ class IndexBlock : public ExecutionBlock { arangodb::aql::AstNode* makeUnique(arangodb::aql::AstNode*) const; /// @brief create an iterator object - std::shared_ptr createCursor(); + void createCursor(); /// @brief Forwards _cursor to the next available index void startNextCursor(); @@ -134,7 +134,7 @@ class IndexBlock : public ExecutionBlock { /// @brief _cursor: holds the index cursor found using /// getIndexCursor (if any) so that it can be read in chunks and not /// necessarily all at once. - std::shared_ptr _cursor; + std::unique_ptr _cursor; /// @brief _condition: holds the complete condition this Block can serve for AstNode const* _condition; diff --git a/arangod/Utils/Transaction.cpp b/arangod/Utils/Transaction.cpp index 1904bf5870..fa7712844c 100644 --- a/arangod/Utils/Transaction.cpp +++ b/arangod/Utils/Transaction.cpp @@ -2754,7 +2754,7 @@ std::pair Transaction::getIndexForSortCondition( /// calling this method ////////////////////////////////////////////////////////////////////////////// -std::shared_ptr Transaction::indexScanForCondition( +OperationCursor* Transaction::indexScanForCondition( std::string const& collectionName, IndexHandle const& indexId, arangodb::aql::Ast* ast, arangodb::aql::AstNode const* condition, arangodb::aql::Variable const* var, uint64_t limit, uint64_t batchSize, @@ -2767,7 +2767,7 @@ std::shared_ptr Transaction::indexScanForCondition( if (limit == 0) { // nothing to do - return std::make_shared(TRI_ERROR_NO_ERROR); + return new OperationCursor(TRI_ERROR_NO_ERROR); } // Now collect the Iterator @@ -2783,10 +2783,10 @@ std::shared_ptr Transaction::indexScanForCondition( if (iterator == nullptr) { // We could not create an ITERATOR and it did not throw an error itself - return std::make_shared(TRI_ERROR_OUT_OF_MEMORY); + return new OperationCursor(TRI_ERROR_OUT_OF_MEMORY); } - return std::make_shared( + return new OperationCursor( transactionContext()->orderCustomTypeHandler(), iterator.release(), limit, batchSize); } diff --git a/arangod/Utils/Transaction.h b/arangod/Utils/Transaction.h index 544f54068b..68ed9b4c27 100644 --- a/arangod/Utils/Transaction.h +++ b/arangod/Utils/Transaction.h @@ -558,7 +558,7 @@ class Transaction { /// calling this method ////////////////////////////////////////////////////////////////////////////// - std::shared_ptr indexScanForCondition( + OperationCursor* indexScanForCondition( std::string const& collectionName, IndexHandle const& indexId, arangodb::aql::Ast*, arangodb::aql::AstNode const*, arangodb::aql::Variable const*, uint64_t, uint64_t, bool); diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/loginView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/loginView.js index 404daee5de..cb04e40f99 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/loginView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/loginView.js @@ -115,8 +115,8 @@ } }; - var path = window.location.protocol + "//" + - window.location.host + "/_db/" + database + "/_admin/aardvark/index.html"; + var path = window.location.protocol + "//" + window.location.host + + "/_db/" + database + "/_admin/aardvark/index.html"; window.location.href = path;