1
0
Fork 0

Merge branch 'spdvpk' of https://github.com/arangodb/arangodb into spdvpk

This commit is contained in:
jsteemann 2016-03-18 11:23:44 +01:00
commit a3ce925066
5 changed files with 18 additions and 14 deletions

View File

@ -42,6 +42,7 @@ using Json = arangodb::basics::Json;
IndexBlock::IndexBlock(ExecutionEngine* engine, IndexNode const* en)
: ExecutionBlock(engine, en),
_collection(en->collection()),
_result(std::make_shared<OperationResult>(TRI_ERROR_NO_ERROR)),
_posInDocs(0),
_currentIndex(0),
_indexes(en->getIndexes()),
@ -377,17 +378,17 @@ bool IndexBlock::readIndex(size_t atMost) {
bool isReverse = (static_cast<IndexNode const*>(getPlanNode()))->_reverse;
bool isLastIndex = (_currentIndex == lastIndexNr && !isReverse) ||
(_currentIndex == 0 && isReverse);
auto result = std::make_shared<OperationResult>(TRI_ERROR_NO_ERROR);
auto _result = std::make_shared<OperationResult>(TRI_ERROR_NO_ERROR);
while (_cursor != nullptr) {
if (!_cursor->hasMore()) {
startNextCursor();
continue;
}
_cursor->getMore(result, atMost, true);
if (result->failed()) {
THROW_ARANGO_EXCEPTION(result->code);
_cursor->getMore(_result, atMost, true);
if (_result->failed()) {
THROW_ARANGO_EXCEPTION(_result->code);
}
VPackSlice slice = result->slice();
VPackSlice slice = _result->slice();
TRI_ASSERT(slice.isArray());
size_t length = static_cast<size_t>(slice.length());

View File

@ -130,6 +130,12 @@ class IndexBlock : public ExecutionBlock {
Collection const* _collection;
//////////////////////////////////////////////////////////////////////////////
/// @brief document result
//////////////////////////////////////////////////////////////////////////////
std::shared_ptr<OperationResult> _result;
//////////////////////////////////////////////////////////////////////////////
/// @brief document buffer
//////////////////////////////////////////////////////////////////////////////

View File

@ -1,5 +1,5 @@
/*jshint globalstrict:false, strict:false, maxlen: 5000 */
/*global fail, assertEqual */
/*global describe, beforeEach, afterEach, it */
'use strict';
////////////////////////////////////////////////////////////////////////////////
@ -25,7 +25,6 @@
////////////////////////////////////////////////////////////////////////////////
const expect = require('chai').expect;
const sinon = require('sinon');
const arangodb = require("@arangodb");
const request = require('@arangodb/request');
@ -512,7 +511,7 @@ describe('babies collection document', function() {
expect(req2.statusCode).to.equal(202);
expect(collection.count()).to.equal(l1.length);
let b2 = JSON.parse(req2.rawBody);
JSON.parse(req2.rawBody);
let l3 = [{
value: 7
@ -575,7 +574,7 @@ describe('babies collection document', function() {
expect(req2.statusCode).to.equal(202);
expect(collection.count()).to.equal(l1.length);
let b2 = JSON.parse(req2.rawBody);
JSON.parse(req2.rawBody);
let l3 = [{
value: 7

View File

@ -1,5 +1,5 @@
/*jshint globalstrict:false, strict:false, maxlen: 5000 */
/*global fail, assertEqual */
/*global fail, assertEqual, assertTypeOf, assertTrue */
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
@ -853,7 +853,6 @@ function CollectionDocumentSuiteBabies() {
function CollectionDocumentSuiteReturnStuff() {
'use strict';
var cn = "UnitTestsCollectionBasics";
var ERRORS = require("internal").errors;
var collection = null;
return {

View File

@ -1966,7 +1966,7 @@ function DatabaseDocumentSuite () {
assertTypeOf("string", a3._key);
try {
var a4 = db._remove(a1, {"overwrite" : true});
db._remove(a1, {"overwrite" : true});
fail();
}
catch (err2) {
@ -2006,7 +2006,7 @@ function DatabaseDocumentSuite () {
assertTypeOf("string", a3._key);
try {
var a4 = db._remove(a1, {"overwrite" : true});
db._remove(a1, {"overwrite" : true});
fail();
}
catch (err2) {
@ -2079,7 +2079,6 @@ function DatabaseDocumentSuite () {
function DatabaseDocumentSuiteReturnStuff () {
'use strict';
var cn = "UnitTestsCollectionBasics";
var ERRORS = require("internal").errors;
var collection = null;
return {